From 7b3783c9814173d05d5efb216d5b383a4aa2a8fe Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 28 May 2014 16:41:56 +0000 Subject: feature 2616: better behavior at the end of upload (more like with uploadify, but no page reload) git-svn-id: http://piwigo.org/svn/trunk@28554 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/ws_functions/pwg.images.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/ws_functions') diff --git a/include/ws_functions/pwg.images.php b/include/ws_functions/pwg.images.php index 70a7f694f..bb43be983 100644 --- a/include/ws_functions/pwg.images.php +++ b/include/ws_functions/pwg.images.php @@ -1365,10 +1365,25 @@ SELECT ;'; $image_infos = pwg_db_fetch_assoc(pwg_query($query)); + $query = ' +SELECT + COUNT(*) AS nb_photos + FROM '.IMAGE_CATEGORY_TABLE.' + WHERE category_id = '.$params['category'][0].' +;'; + $category_infos = pwg_db_fetch_assoc(pwg_query($query)); + + $category_name = get_cat_display_name_from_id($params['category'][0], null); + return array( 'image_id' => $image_id, 'src' => DerivativeImage::thumb_url($image_infos), 'name' => $image_infos['name'], + 'category' => array( + 'id' => $params['category'][0], + 'nb_photos' => $category_infos['nb_photos'], + 'label' => $category_name, + ) ); } } -- cgit v1.2.3