mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-07 02:11:26 +02:00
feqture 1583 : show related tags block also when browsing non tag sections
git-svn-id: http://piwigo.org/svn/trunk@5752 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
+42
-20
@@ -110,32 +110,54 @@ function initialize_menu()
|
||||
|
||||
//------------------------------------------------------------------------ tags
|
||||
$block = $menu->get_block('mbTags');
|
||||
if ( $block!=null and 'tags'==@$page['section'] and !empty($page['items']) )
|
||||
if ( $block!=null and !empty($page['items']) )
|
||||
{
|
||||
$tags = get_common_tags(
|
||||
$page['items'],
|
||||
$conf['menubar_tag_cloud_items_number'],
|
||||
$page['tag_ids']
|
||||
);
|
||||
$tags = add_level_to_tags($tags);
|
||||
|
||||
foreach ($tags as $tag)
|
||||
if ('tags'==@$page['section'])
|
||||
{
|
||||
$block->data[] = array_merge(
|
||||
$tag,
|
||||
array(
|
||||
'U_ADD' => make_index_url(
|
||||
array(
|
||||
'tags' => array_merge(
|
||||
$page['tags'],
|
||||
array($tag)
|
||||
$tags = get_common_tags(
|
||||
$page['items'],
|
||||
$conf['menubar_tag_cloud_items_number'],
|
||||
$page['tag_ids']
|
||||
);
|
||||
$tags = add_level_to_tags($tags);
|
||||
|
||||
foreach ($tags as $tag)
|
||||
{
|
||||
$block->data[] = array_merge(
|
||||
$tag,
|
||||
array(
|
||||
'U_ADD' => make_index_url(
|
||||
array(
|
||||
'tags' => array_merge(
|
||||
$page['tags'],
|
||||
array($tag)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
'URL' => make_index_url( array( 'tags' => array($tag) )
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$selection = array_slice( $page['items'], $page['start'], $page['nb_image_page'] );
|
||||
$tags = add_level_to_tags( get_common_tags($selection, 12) );
|
||||
foreach ($tags as $tag)
|
||||
{
|
||||
$block->data[] =
|
||||
array_merge( $tag,
|
||||
array(
|
||||
'URL' => make_index_url( array( 'tags' => array($tag) ) ),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
if ( !empty($block->data) )
|
||||
{
|
||||
$block->template = 'menubar_tags.tpl';
|
||||
}
|
||||
$block->template = 'menubar_tags.tpl';
|
||||
}
|
||||
|
||||
//----------------------------------------------------------- special categories
|
||||
|
||||
Reference in New Issue
Block a user