mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-02 23:13:20 +02:00
Virtual categories management
git-svn-id: http://piwigo.org/svn/trunk@68 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user