diff options
author | z0rglub <z0rglub@piwigo.org> | 2003-09-07 10:14:33 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2003-09-07 10:14:33 +0000 |
commit | e56d53fe20bef7b8b2a05b30ad15ab3fb38db6dc (patch) | |
tree | 272ca8dccfdca6ca8f577f5c895ddf01e99c2c07 /admin/include/functions.php | |
parent | 377042a27d9d2de8bcadf77ffcfd1e7d48b64add (diff) |
Virtual categories management
git-svn-id: http://piwigo.org/svn/trunk@68 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/include/functions.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php index 7115f163b..2763c890e 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -385,17 +385,24 @@ function get_keywords( $keywords_string ) return array_unique( $keywords ); } -function display_categories( $categories, $indent ) +function display_categories( $categories, $indent, + $selected = -1, $forbidden = -1 ) { global $vtp,$sub; foreach ( $categories as $category ) { - $vtp->addSession( $sub, 'associate_cat' ); - $vtp->setVar( $sub, 'associate_cat.value', $category['id'] ); - $content = $indent.'- '.$category['name']; - $vtp->setVar( $sub, 'associate_cat.content', $content ); - $vtp->closeSession( $sub, 'associate_cat' ); - display_categories( $category['subcats'], $indent.str_repeat(' ',3) ); + if ( $category['id'] != $forbidden ) + { + $vtp->addSession( $sub, 'associate_cat' ); + $vtp->setVar( $sub, 'associate_cat.value', $category['id'] ); + $content = $indent.'- '.$category['name']; + $vtp->setVar( $sub, 'associate_cat.content', $content ); + if ( $category['id'] == $selected ) + $vtp->setVar( $sub, 'associate_cat.selected', ' selected="selected"' ); + $vtp->closeSession( $sub, 'associate_cat' ); + display_categories( $category['subcats'], $indent.str_repeat(' ',3), + $selected, $forbidden ); + } } } ?>
\ No newline at end of file |