Changeset 478 for trunk/category.php


Ignore:
Timestamp:
Aug 6, 2004, 11:42:07 AM (20 years ago)
Author:
z0rglub
Message:

menu categories managed as list items

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/category.php

    r459 r478  
    4646  check_restrictions( $page['cat'] );
    4747}
    48 
    4948//-------------------------------------------------------------- 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 call
    86   if ( $category['expanded'] )
    87   {
    88     foreach ( $category['subcats'] as $subcat ) {
    89       display_category( $subcat, $indent.str_repeat( ' ', 2 ));
    90     }
    91   }
    92 }
    93 
    9449// detection of the start picture to display
    9550if ( !isset( $_GET['start'] )
     
    13994$page['structure'] = create_user_structure( '' );
    14095$page['structure'] = update_structure( $page['structure'] );
    141 
    14296//----------------------------------------------------- template initialization
    143 
    14497//
    14598// Start output of page
     
    163116$icon_recent = get_icon(date('Y-m-d'));
    164117
     118$page['menu'] = '';
     119foreach ($page['structure'] as $category)
     120{
     121  $page['menu'].= get_html_menu_category($category);
     122}
     123
    165124$template->assign_vars(array(
    166125  'NB_PICTURE' => count_user_total_images(),
     
    168127  'USERNAME' => $user['username'],
    169128  'TOP_VISITED'=>$conf['top_number'],
     129  'MENU_CATEGORIES_CONTENT'=>$page['menu'],
    170130
    171131  'L_CATEGORIES' => $lang['categories'],
     
    216176);
    217177
    218 foreach ( $page['structure'] as $category ) {
    219   // display category is a function relative to the template
    220   display_category( $category, ' ');
    221 }
    222 
    223178// authentification mode management
    224179if ( !$user['is_the_guest'] )
Note: See TracChangeset for help on using the changeset viewer.