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:
plegall
2020-11-09 13:00:01 +01:00
parent 35f0450699
commit 4f3880af89
9 changed files with 388 additions and 6 deletions
+28
View File
@@ -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() )