submenu generation implemented
All checks were successful
Build and push / Pulling repo on server (push) Successful in 19s

This commit is contained in:
2023-10-22 09:57:29 +02:00
parent 004e38b3bb
commit 81d4c09533
9 changed files with 94 additions and 14 deletions

View File

@ -46,6 +46,33 @@ class Page
$this->menu_priority = 1;
}
function addSubmenuItem($text, $action, $icon = '', $classes = '')
{
$active = $GLOBALS['url'][0];
if (!$active) $active = 'index';
if ($active == $action)
$act = 1;
else $act = 0;
$this->submenu[] = array('text' => $text, 'action' => $action, 'active' => $act, 'icon' => $icon, 'classes' => $classes);
}
function setSubmenu()
{
//run addsubmenuitem here
}
function getSubmenu($active = 0)
{
$prepare = array();
if (is_array($this->submenu))
foreach ($this->submenu as $key => $var)
$prepare[] = array('text' => $var['text'], 'base' => strtolower($this->_controller), 'action' => $var['action'], 'active' => $var['active']);
return $prepare;
}
function redirect($url)
{
//header("Location: $url");