Changeset 478
- Timestamp:
- Aug 6, 2004, 11:42:07 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/category.php
r459 r478 46 46 check_restrictions( $page['cat'] ); 47 47 } 48 49 48 //-------------------------------------------------------------- initialization 50 function display_category( $category, $indent )51 {52 global $user,$template,$page;53 54 $url = PHPWG_ROOT_PATH.'category.php?cat='.$category['id'];55 56 $style = '';57 if ( isset( $page['cat'] )58 and is_numeric( $page['cat'] )59 and $category['id'] == $page['cat'] )60 {61 $style = 'font-weight:normal;color:yellow;';62 }63 64 $name = $category['name'];65 if (empty($name)) $name = str_replace( '_', ' ', $category['dir'] );66 67 $template->assign_block_vars('category', array(68 'T_NAME' => $style,69 'LINK_NAME' => $name,70 'INDENT' => $indent,71 'U_LINK' => add_session_id($url),72 'BULLET_IMAGE' => $user['lien_collapsed'])73 );74 75 if ( $category['nb_images'] > 0 )76 {77 $template->assign_block_vars(78 'category.infocat',79 array(80 'TOTAL_CAT'=>$category['nb_images'],81 'CAT_ICON'=>get_icon($category['date_last'])82 ));83 }84 85 // recursive call86 if ( $category['expanded'] )87 {88 foreach ( $category['subcats'] as $subcat ) {89 display_category( $subcat, $indent.str_repeat( ' ', 2 ));90 }91 }92 }93 94 49 // detection of the start picture to display 95 50 if ( !isset( $_GET['start'] ) … … 139 94 $page['structure'] = create_user_structure( '' ); 140 95 $page['structure'] = update_structure( $page['structure'] ); 141 142 96 //----------------------------------------------------- template initialization 143 144 97 // 145 98 // Start output of page … … 163 116 $icon_recent = get_icon(date('Y-m-d')); 164 117 118 $page['menu'] = ''; 119 foreach ($page['structure'] as $category) 120 { 121 $page['menu'].= get_html_menu_category($category); 122 } 123 165 124 $template->assign_vars(array( 166 125 'NB_PICTURE' => count_user_total_images(), … … 168 127 'USERNAME' => $user['username'], 169 128 'TOP_VISITED'=>$conf['top_number'], 129 'MENU_CATEGORIES_CONTENT'=>$page['menu'], 170 130 171 131 'L_CATEGORIES' => $lang['categories'], … … 216 176 ); 217 177 218 foreach ( $page['structure'] as $category ) {219 // display category is a function relative to the template220 display_category( $category, ' ');221 }222 223 178 // authentification mode management 224 179 if ( !$user['is_the_guest'] ) -
trunk/template/default/category.tpl
r445 r478 8 8 </div> 9 9 <div class="menu"> 10 <!-- BEGIN category --> 11 {category.INDENT} 12 <img src="{category.BULLET_IMAGE}" style="border:none;" alt="" /> 13 <a href="{category.U_LINK}"><span title='{L_HINT_CATEGORY}' style="{category.T_NAME}">{category.LINK_NAME}</span></a> 14 <!-- BEGIN infocat --> 15 <span class="menuInfoCat">[<span title="{category.infocat.TOTAL_CAT} {L_IMG_AVAILABLE}">{category.infocat.TOTAL_CAT}</span>]</span> 16 {category.infocat.CAT_ICON} 17 <!-- END infocat --> 18 <br /> 19 <!-- END category --> 10 <ul class="menu"> 11 {MENU_CATEGORIES_CONTENT} 12 </ul> 20 13 <div class="totalImages">[ {NB_PICTURE} {L_TOTAL} ]</div> 21 14 <br />
Note: See TracChangeset
for help on using the changeset viewer.