aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_category.inc.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2009-03-04 21:49:21 +0000
committerpatdenice <patdenice@piwigo.org>2009-03-04 21:49:21 +0000
commitd3e6eabb053f311d5d8fd4ec80cfb0c1b32cf141 (patch)
tree8d1a164df1106c5238917c94ef8eaffb4f152b5b /include/functions_category.inc.php
parent9045f11c700970825022eb2762cfeb8db0598764 (diff)
Remove get_html_menu_category function and use smarty abilities.
git-svn-id: http://piwigo.org/svn/trunk@3171 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_category.inc.php')
-rw-r--r--include/functions_category.inc.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php
index b2f3f1f4b..8d05a6c2a 100644
--- a/include/functions_category.inc.php
+++ b/include/functions_category.inc.php
@@ -100,8 +100,31 @@ WHERE '.$where.'
$result = pwg_query($query);
$cats = array();
+ $selected_category = isset($page['category']) ? $page['category'] : null;
while ($row = mysql_fetch_assoc($result))
{
+ $child_date_last = @$row['max_date_last']> @$row['date_last'];
+ $row = array_merge($row,
+ array(
+ 'NAME' => trigger_event(
+ 'render_category_name',
+ $row['name'],
+ 'get_categories_menu'
+ ),
+ 'TITLE' => get_display_images_count(
+ $row['nb_images'],
+ $row['count_images'],
+ $row['count_categories'],
+ false,
+ ' / '
+ ),
+ 'URL' => make_index_url(array('category' => $row)),
+ 'LEVEL' => substr_count($row['global_rank'], '.') + 1,
+ 'ICON_TS' => get_icon($row['max_date_last'], $child_date_last),
+ 'SELECTED' => $selected_category['id'] == $row['id'] ? true : false,
+ 'IS_UPPERCAT' => $selected_category['id_uppercat'] == $row['id'] ? true : false,
+ )
+ );
array_push($cats, $row);
if ($row['id']==@$page['category']['id']) //save the number of subcats for later optim
$page['category']['count_categories'] = $row['count_categories'];
@@ -114,7 +137,7 @@ WHERE '.$where.'
update_cats_with_filtered_data($cats);
}
- return get_html_menu_category($cats, @$page['category'] );
+ return $cats;
}