diff options
author | z0rglub <z0rglub@piwigo.org> | 2003-10-11 13:36:43 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2003-10-11 13:36:43 +0000 |
commit | 37deeb17a6a092d03850abe30d5339e37be3f275 (patch) | |
tree | 5b774a677a0923075ea5affd600d33b7d1a22e5b /category.php | |
parent | 8d0d3eb05817caec2cc0c2fe30412a001c24d5ce (diff) |
All parent categories of the displayed category are expanded in the menu
git-svn-id: http://piwigo.org/svn/trunk@193 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'category.php')
-rw-r--r-- | category.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/category.php b/category.php index 3eb7bc095..55c4c9d63 100644 --- a/category.php +++ b/category.php @@ -56,6 +56,17 @@ if ( isset ( $_GET['expand'] ) and $_GET['expand'] != 'all' ) foreach ( $tab_expand as $id ) { if ( is_numeric( $id ) ) array_push( $page['tab_expand'], $id ); } + if ( is_numeric( $page['cat'] ) ) + { + // the category displayed (in the URL cat=23) must be seen in the menu -> + // parent categories must be expanded + $parent = $page['plain_structure'][$page['cat']]['id_uppercat']; + while ( $parent != '' ) + { + array_push( $page['tab_expand'], $parent ); + $parent = $page['plain_structure'][$parent]['id_uppercat']; + } + } $page['expand'] = implode( ',', $page['tab_expand'] ); } // in case of expanding all authorized cats |