aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_category.inc.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-02-22 20:20:30 +0000
committerrub <rub@piwigo.org>2007-02-22 20:20:30 +0000
commit6f03e29735ea395f31d09bbfd15a4e15eaf961e3 (patch)
tree25af7ae0f975493ccc050f48c56a28f72ca5481f /include/functions_category.inc.php
parent20ba76b753f53c00fece9cc727e60414c7e95570 (diff)
o Proposition: improved display of 'x images in y sub-categories' or 'x images in this category' for cases when categories contain both images and sub-categories
o Good idea of this new way for way conf['guest_access'], but I kept last implementation for access methods (Could be useful on future development) git-svn-id: http://piwigo.org/svn/trunk@1851 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_category.inc.php')
-rw-r--r--include/functions_category.inc.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php
index 9b38ae440..040d91d9e 100644
--- a/include/functions_category.inc.php
+++ b/include/functions_category.inc.php
@@ -386,16 +386,25 @@ function rank_compare($a, $b)
* @param array categories
* @return string
*/
-function get_display_images_count($cat_nb_images, $cat_count_images, $cat_count_categories, $short_message = true)
+function get_display_images_count($cat_nb_images, $cat_count_images, $cat_count_categories, $short_message = true, $Separator = '\n')
{
$display_text = '';
- if ($cat_count_images>0)
- {//at least one image direct or indirect
+ if ($cat_count_images > 0)
+ {
+ if ($cat_nb_images > 0 and $cat_nb_images < $cat_count_images)
+ {
+ $display_text.= get_display_images_count($cat_nb_images, $cat_nb_images, 0, $short_message, $Separator).$Separator;
+ $cat_count_images-= $cat_nb_images;
+ $cat_nb_images = 0;
+ }
+
+ //at least one image direct or indirect
$display_text.= l10n_dec('image_available', 'images_available', $cat_count_images);
- if ($cat_count_categories==0 or $cat_nb_images>=$cat_count_images)
- {//no descendant categories or descendants do not contain images
+ if ($cat_count_categories == 0 or $cat_nb_images == $cat_count_images)
+ {
+ //no descendant categories or descendants do not contain images
if (! $short_message)
{
$display_text.= ' '.l10n('images_available_cpl');