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
This commit is contained in:
rub 2007-02-22 20:20:30 +00:00
commit 6f03e29735
10 changed files with 65 additions and 25 deletions

View file

@ -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');