diff options
author | z0rglub <z0rglub@piwigo.org> | 2004-08-06 09:42:07 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2004-08-06 09:42:07 +0000 |
commit | 0188ea673ec204d3cdb98a78f88992e0fac89748 (patch) | |
tree | 4faa4f6177598305d6d29718334edbfc30c3fe28 | |
parent | 773577bc4f0d8ec81b3400bf786a5c174b1a9cea (diff) |
menu categories managed as list items
git-svn-id: http://piwigo.org/svn/trunk@478 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | category.php | 59 | ||||
-rw-r--r-- | template/default/category.tpl | 13 |
2 files changed, 10 insertions, 62 deletions
diff --git a/category.php b/category.php index 3fbc5eae8..781d3bda1 100644 --- a/category.php +++ b/category.php @@ -45,52 +45,7 @@ if ( isset( $page['cat'] ) and is_numeric( $page['cat'] ) ) { check_restrictions( $page['cat'] ); } - //-------------------------------------------------------------- initialization -function display_category( $category, $indent ) -{ - global $user,$template,$page; - - $url = PHPWG_ROOT_PATH.'category.php?cat='.$category['id']; - - $style = ''; - if ( isset( $page['cat'] ) - and is_numeric( $page['cat'] ) - and $category['id'] == $page['cat'] ) - { - $style = 'font-weight:normal;color:yellow;'; - } - - $name = $category['name']; - if (empty($name)) $name = str_replace( '_', ' ', $category['dir'] ); - - $template->assign_block_vars('category', array( - 'T_NAME' => $style, - 'LINK_NAME' => $name, - 'INDENT' => $indent, - 'U_LINK' => add_session_id($url), - 'BULLET_IMAGE' => $user['lien_collapsed']) - ); - - if ( $category['nb_images'] > 0 ) - { - $template->assign_block_vars( - 'category.infocat', - array( - 'TOTAL_CAT'=>$category['nb_images'], - 'CAT_ICON'=>get_icon($category['date_last']) - )); - } - - // recursive call - if ( $category['expanded'] ) - { - foreach ( $category['subcats'] as $subcat ) { - display_category( $subcat, $indent.str_repeat( ' ', 2 )); - } - } -} - // detection of the start picture to display if ( !isset( $_GET['start'] ) or !is_numeric( $_GET['start'] ) @@ -138,9 +93,7 @@ if ( isset( $_GET['num'] ) $page['plain_structure'] = get_user_plain_structure(); $page['structure'] = create_user_structure( '' ); $page['structure'] = update_structure( $page['structure'] ); - //----------------------------------------------------- template initialization - // // Start output of page // @@ -162,11 +115,18 @@ if ( isset( $page['cat_nb_images'] ) and $page['cat_nb_images'] > 0 ) $icon_recent = get_icon(date('Y-m-d')); +$page['menu'] = ''; +foreach ($page['structure'] as $category) +{ + $page['menu'].= get_html_menu_category($category); +} + $template->assign_vars(array( 'NB_PICTURE' => count_user_total_images(), 'TITLE' => $template_title, 'USERNAME' => $user['username'], 'TOP_VISITED'=>$conf['top_number'], + 'MENU_CATEGORIES_CONTENT'=>$page['menu'], 'L_CATEGORIES' => $lang['categories'], 'L_HINT_CATEGORY' => $lang['hint_category'], @@ -215,11 +175,6 @@ $template->assign_vars(array( ) ); -foreach ( $page['structure'] as $category ) { - // display category is a function relative to the template - display_category( $category, ' '); -} - // authentification mode management if ( !$user['is_the_guest'] ) { diff --git a/template/default/category.tpl b/template/default/category.tpl index 213b53050..2eb19b642 100644 --- a/template/default/category.tpl +++ b/template/default/category.tpl @@ -7,16 +7,9 @@ <a href="{U_HOME}">{L_CATEGORIES}</a> </div> <div class="menu"> - <!-- BEGIN category --> - {category.INDENT} - <img src="{category.BULLET_IMAGE}" style="border:none;" alt="" /> - <a href="{category.U_LINK}"><span title='{L_HINT_CATEGORY}' style="{category.T_NAME}">{category.LINK_NAME}</span></a> - <!-- BEGIN infocat --> - <span class="menuInfoCat">[<span title="{category.infocat.TOTAL_CAT} {L_IMG_AVAILABLE}">{category.infocat.TOTAL_CAT}</span>]</span> - {category.infocat.CAT_ICON} - <!-- END infocat --> - <br /> - <!-- END category --> + <ul class="menu"> + {MENU_CATEGORIES_CONTENT} + </ul> <div class="totalImages">[ {NB_PICTURE} {L_TOTAL} ]</div> <br /> <ul class="menu"> |