aboutsummaryrefslogtreecommitdiffstats
path: root/admin/picture_modify.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2014-05-26 22:03:57 +0000
committermistic100 <mistic@piwigo.org>2014-05-26 22:03:57 +0000
commita5b2cf82007ac1b2461ba86b79c48e43c2640053 (patch)
tree9cc97025f60101372081320a1fe9f56a8b69451e /admin/picture_modify.php
parentb97c45b941170247107445ce4a8fffbae8267c1e (diff)
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
Diffstat (limited to '')
-rw-r--r--admin/picture_modify.php15
1 files changed, 8 insertions, 7 deletions
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')),
));