From a5b2cf82007ac1b2461ba86b79c48e43c2640053 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Mon, 26 May 2014 22:03:57 +0000 Subject: feature 3077 : factorize code for categories cache (TODO for other collections) + fix incorrect categories list for dissociation git-svn-id: http://piwigo.org/svn/trunk@28542 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/picture_modify.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'admin/picture_modify.php') diff --git a/admin/picture_modify.php b/admin/picture_modify.php index 370d64caf..134859ca4 100644 --- a/admin/picture_modify.php +++ b/admin/picture_modify.php @@ -42,7 +42,7 @@ SELECT id FROM '.CATEGORIES_TABLE.' WHERE representative_picture_id = '.$_GET['image_id'].' ;'; -$represent_options_selected = query2array($query, null, 'id'); +$represented_albums = query2array($query, null, 'id'); // +-----------------------------------------------------------------------+ // | delete photo | @@ -165,13 +165,13 @@ if (isset($_POST['submit'])) $_POST['represent'] = array(); } - $no_longer_thumbnail_for = array_diff($represent_options_selected, $_POST['represent']); + $no_longer_thumbnail_for = array_diff($represented_albums, $_POST['represent']); if (count($no_longer_thumbnail_for) > 0) { set_random_representant($no_longer_thumbnail_for); } - $new_thumbnail_for = array_diff($_POST['represent'], $represent_options_selected); + $new_thumbnail_for = array_diff($_POST['represent'], $represented_albums); if (count($new_thumbnail_for) > 0) { $query = ' @@ -182,7 +182,7 @@ UPDATE '.CATEGORIES_TABLE.' pwg_query($query); } - $represent_options_selected = $_POST['represent']; + $represented_albums = $_POST['represent']; $page['infos'][] = l10n('Photo informations updated'); } @@ -406,11 +406,12 @@ SELECT id INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = category_id WHERE image_id = '.$_GET['image_id'].' ;'; -$associate_options_selected = query2array($query, null, 'id'); +$associated_albums = query2array($query, null, 'id'); $template->assign(array( - 'associate_options_selected' => $associate_options_selected, - 'represent_options_selected' => $represent_options_selected, + 'associated_albums' => $associated_albums, + 'represented_albums' => $represented_albums, + 'STORAGE_ALBUM' => $storage_category_id, 'CACHE_KEYS' => get_admin_client_cache_keys(array('tags', 'categories')), )); -- cgit v1.2.3