Changeset 193 for trunk


Ignore:
Timestamp:
Oct 11, 2003, 3:36:43 PM (20 years ago)
Author:
z0rglub
Message:

All parent categories of the displayed category are expanded in the menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/category.php

    r175 r193  
    5656  foreach ( $tab_expand as $id ) {
    5757    if ( is_numeric( $id ) ) array_push( $page['tab_expand'], $id );
     58  }
     59  if ( is_numeric( $page['cat'] ) )
     60  {
     61    // the category displayed (in the URL cat=23) must be seen in the menu ->
     62    // parent categories must be expanded
     63    $parent = $page['plain_structure'][$page['cat']]['id_uppercat'];
     64    while ( $parent != '' )
     65    {
     66      array_push( $page['tab_expand'], $parent );
     67      $parent = $page['plain_structure'][$parent]['id_uppercat'];
     68    }
    5869  }
    5970  $page['expand'] = implode( ',', $page['tab_expand'] );
Note: See TracChangeset for help on using the changeset viewer.