42 lines
891 B
PHP
42 lines
891 B
PHP
|
<?php
|
||
|
/*****************************************************************************
|
||
|
* MainMenu.php
|
||
|
* Contains the main navigation logic.
|
||
|
*
|
||
|
* Global Data Lab code (C) Radboud University Nijmegen
|
||
|
* Programming (C) Aaron van Geffen, 2015-2022
|
||
|
*****************************************************************************/
|
||
|
|
||
|
class MainMenu extends Menu
|
||
|
{
|
||
|
public function __construct()
|
||
|
{
|
||
|
$this->items = [
|
||
|
[
|
||
|
'uri' => '/',
|
||
|
'label' => 'Albums',
|
||
|
],
|
||
|
[
|
||
|
'uri' => '/people/',
|
||
|
'label' => 'People',
|
||
|
],
|
||
|
[
|
||
|
'uri' => '/timeline/',
|
||
|
'label' => 'Timeline',
|
||
|
],
|
||
|
];
|
||
|
|
||
|
foreach ($this->items as $i => $item)
|
||
|
{
|
||
|
if (isset($item['uri']))
|
||
|
$this->items[$i]['url'] = BASEURL . $item['uri'];
|
||
|
|
||
|
if (!isset($item['subs']))
|
||
|
continue;
|
||
|
|
||
|
foreach ($item['subs'] as $j => $subitem)
|
||
|
$this->items[$i]['subs'][$j]['url'] = BASEURL . $subitem['uri'];
|
||
|
}
|
||
|
}
|
||
|
}
|