menu seperated
This commit is contained in:
parent
de66e87c6f
commit
ded660adb6
|
@ -11,22 +11,36 @@ function make_navigation() {
|
||||||
$menu = "";
|
$menu = "";
|
||||||
|
|
||||||
// Standard Navigation
|
// Standard Navigation
|
||||||
$menu .= '<nav class="container"><h4>' . Get_Text('/') . '</h4><ul class="content">';
|
$menu .= make_navigation_for(Get_Text('/'), array (
|
||||||
foreach ($menu_items as $item)
|
"start",
|
||||||
$menu .= '<li' . ($item == $p ? ' class="selected"' : '') . '><a href="' . page_link_to($item) . '">' . Get_Text($item) . '</a></li>';
|
"login",
|
||||||
$menu .= '</ul></nav>';
|
"logout",
|
||||||
|
"register",
|
||||||
|
"faq"
|
||||||
|
));
|
||||||
|
|
||||||
// Engel Navigation
|
// Engel Navigation
|
||||||
$menu .= '<nav class="container"><h4>' . Get_Text('inc_schicht_engel') . '</h4><ul class="content">';
|
$menu .= make_navigation_for(Get_Text('inc_schicht_engel'), array (
|
||||||
foreach ($menu_items as $item)
|
"news"
|
||||||
$menu .= '<li' . ($item == $p ? ' class="selected"' : '') . '><a href="' . page_link_to($item) . '">' . Get_Text($item) . '</a></li>';
|
));
|
||||||
$menu .= '</ul></nav>';
|
|
||||||
|
|
||||||
// Admin Navigation
|
// Admin Navigation
|
||||||
$menu .= '<nav class="container"><h4>' . Get_Text('admin/') . '</h4><ul class="content">';
|
$menu .= make_navigation_for(Get_Text('admin/'), array (
|
||||||
foreach ($menu_items as $item)
|
"admin_rooms"
|
||||||
$menu .= '<li' . ($item == $p ? ' class="selected"' : '') . '><a href="' . page_link_to($item) . '">' . Get_Text($item) . '</a></li>';
|
));
|
||||||
$menu .= '</ul></nav>';
|
return $menu;
|
||||||
|
}
|
||||||
|
|
||||||
|
function make_navigation_for($name, $pages) {
|
||||||
|
global $privileges, $p;
|
||||||
|
|
||||||
|
$menu = "";
|
||||||
|
foreach ($pages as $page)
|
||||||
|
if (in_array($page, $privileges))
|
||||||
|
$menu .= '<li' . ($page == $p ? ' class="selected"' : '') . '><a href="' . page_link_to($page) . '">' . Get_Text($page) . '</a></li>';
|
||||||
|
|
||||||
|
if ($menu != "")
|
||||||
|
$menu = '<nav class="container"><h4>' . $name . '</h4><ul class="content">' . $menu . '</ul></nav>';
|
||||||
return $menu;
|
return $menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue