aboutsummaryrefslogtreecommitdiffstats
path: root/admin/cat_modify.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2015-12-01 12:08:10 +0100
committerplegall <plg@piwigo.org>2015-12-01 12:08:10 +0100
commitbe6afad731b965a75d9fe0b254ea72858a4deec4 (patch)
tree0c061688186e3ab9298cf4e64deabc996b8b27bb /admin/cat_modify.php
parent27389102d1275cdefcaee9c5a4a93297fc797b8c (diff)
fixes #377 use Ajax calls to refresh/delete album thumbnail
Diffstat (limited to 'admin/cat_modify.php')
-rw-r--r--admin/cat_modify.php33
1 files changed, 2 insertions, 31 deletions
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 ?