From be6afad731b965a75d9fe0b254ea72858a4deec4 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 1 Dec 2015 12:08:10 +0100 Subject: fixes #377 use Ajax calls to refresh/delete album thumbnail --- admin/cat_modify.php | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'admin/cat_modify.php') diff --git a/admin/cat_modify.php b/admin/cat_modify.php index 3cf8239c1..2b0f37833 100644 --- a/admin/cat_modify.php +++ b/admin/cat_modify.php @@ -172,21 +172,6 @@ UPDATE '.CATEGORIES_TABLE.' $_SESSION['page_infos'][] = l10n('Album updated successfully'); $redirect = true; } -elseif (isset($_POST['set_random_representant'])) -{ - set_random_representant(array($_GET['cat_id'])); - $redirect = true; -} -elseif (isset($_POST['delete_representant'])) -{ - $query = ' -UPDATE '.CATEGORIES_TABLE.' - SET representative_picture_id = NULL - WHERE id = '.$_GET['cat_id'].' -;'; - pwg_query($query); - $redirect = true; -} if (isset($redirect)) { @@ -336,8 +321,7 @@ else } // representant management -if ($category['has_images'] - or !empty($category['representative_picture_id'])) +if ($category['has_images'] or !empty($category['representative_picture_id'])) { $tpl_representant = array(); @@ -345,20 +329,7 @@ if ($category['has_images'] // representant ? if (!empty($category['representative_picture_id'])) { - $query = ' -SELECT id,representative_ext,path - FROM '.IMAGES_TABLE.' - WHERE id = '.$category['representative_picture_id'].' -;'; - $row = pwg_db_fetch_assoc(pwg_query($query)); - $src = DerivativeImage::thumb_url($row); - $url = get_root_url().'admin.php?page=photo-'.$category['representative_picture_id']; - - $tpl_representant['picture'] = - array( - 'SRC' => $src, - 'URL' => $url - ); + $tpl_representant['picture'] = get_category_representant_properties($category['representative_picture_id']); } // can the admin choose to set a new random representant ? -- cgit v1.2.3