mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-12 11:43:01 +02:00
fixes #626 related albums (menu, combine, url)
* ability to combine albums in URL index.php?/category/1/2/3 will consider 1 as $page['category'] and {2,3} as $page['combined_categories']
* new menu block "related albums" which displays only the hierarchy of albums related to the current set of photos, excluding current album(s). In the hierarchy, only the related albums have a link, not ancestors
This commit is contained in:
@@ -101,6 +101,34 @@ function initialize_menu()
|
||||
$block->template = 'menubar_categories.tpl';
|
||||
}
|
||||
|
||||
//------------------------------------------------------------ related categories
|
||||
$block = $menu->get_block('mbRelatedCategories');
|
||||
|
||||
if ($block != null and !empty($page['items']))
|
||||
{
|
||||
$exclude_cat_ids = array();
|
||||
if (isset($page['category']))
|
||||
{
|
||||
$exclude_cat_ids = array($page['category']['id']);
|
||||
if (isset($page['combined_categories']))
|
||||
{
|
||||
foreach ($page['combined_categories'] as $cat)
|
||||
{
|
||||
$exclude_cat_ids[] = $cat['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$block->data = array(
|
||||
'MENU_CATEGORIES' => get_related_categories_menu($page['items'], $exclude_cat_ids),
|
||||
);
|
||||
|
||||
if (!empty($block->data['MENU_CATEGORIES']) )
|
||||
{
|
||||
$block->template = 'menubar_related_categories.tpl';
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------ tags
|
||||
$block = $menu->get_block('mbTags');
|
||||
if ( $block!=null and 'picture' != script_basename() )
|
||||
|
||||
Reference in New Issue
Block a user