Hanno Böck To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/ Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code. */ if (! defined("TOP_INCLUDED")) { define("TOP_INCLUDED", true); require_once("inc/error.php"); require_once("inc/debug.php"); global $prefix, $section; $menuitem = array(); $weighted_menuitem = array(); $submenu = array(); foreach (config('modules') as $module) { $menu = false; if (file_exists("modules/{$module}/menu.php")) include("modules/{$module}/menu.php"); if ($menu === false) { DEBUG("Modul {$module} hat keine Menüeinträge"); continue; } // Menüeinträge spammen den debug-output zu //DEBUG("

$module

"); //DEBUG($menu); // $menu["foo"]["file"] enthält den Link foreach (array_keys($menu) as $key) { $menu[$key]["file"] = $prefix."go/".$module."/".$menu[$key]["file"]; $weight = $menu[$key]["weight"]; if (isset($menu[$key]['submenu'])) { if (isset($submenu[$menu[$key]['submenu']][$weight])) $submenu[$menu[$key]['submenu']][$weight] = array_merge($submenu[$menu[$key]['submenu']][$weight], array($key => $menu[$key])); else $submenu[$menu[$key]['submenu']][$weight] = array($key => $menu[$key]); } else { if (array_key_exists($weight, $weighted_menuitem)) $weighted_menuitem[$weight] = array_merge($weighted_menuitem[$weight], array($key => $menu[$key])); else $weighted_menuitem[$weight] = array($key => $menu[$key]); } } $menuitem = array_merge($menuitem, $menu); } ksort($weighted_menuitem); DEBUG($weighted_menuitem); foreach ($submenu AS $weight => $data) { ksort($submenu[$weight]); } DEBUG($submenu); // Verbiete das Laden in jeglichem Frameset header("X-FRAME-OPTIONS: DENY"); header("Content-Type: ".config('mime_type')); if (!isset($html_header)) $html_header = ''; function array_key_exists_r($needle, $haystack) { $result = array_key_exists($needle, $haystack); if ($result) return $result; foreach ($haystack as $v) { if (is_array($v)) { $result = array_key_exists_r($needle, $v); } if ($result) return $result; } return $result; } $menu = ''; foreach ($weighted_menuitem as $key => $menuitem) foreach ($menuitem as $key => $item) { if ($key == $section) $menu .= ''.$item['label'].''."\n"; else $menu .= ''.$item['label'].''."\n"; if (isset($submenu[$key])) { if ($key == $section || (array_key_exists($key, $submenu) && array_key_exists_r($section, $submenu[$key]))) { $menu .= "\n"; foreach ($submenu[$key] as $weight => $mysub) { foreach ($mysub as $sec => $item) { if ($sec == $section) $menu .= ''.$item['label'].''."\n"; else $menu .= ''.$item['label'].''."\n"; } } $menu .= "\n"; } } } $userinfo = ''; $role = $_SESSION['role']; if ($role != ROLE_ANONYMOUS) { $userinfo .= '

Angemeldet als:
'; if ($role & ROLE_SYSTEMUSER && isset($_SESSION['subuser'])) { $userinfo .= ''.$_SESSION['subuser'].''; $userinfo .= '
Mitbenutzer von '.$_SESSION['userinfo']['username']; } elseif ($role & ROLE_SYSTEMUSER) { $userinfo .= ''.$_SESSION['userinfo']['username'].''; $userinfo .= '
'.$_SESSION['userinfo']['name']; $userinfo .= '
(UID '.$_SESSION['userinfo']['uid'].(($role & ROLE_CUSTOMER) ? ', Kunde '.$_SESSION['customerinfo']['customerno'] : '').')'; } elseif ($role & ROLE_CUSTOMER) { $userinfo .= ''.$_SESSION['customerinfo']['name'].''; $userinfo .= '
(Kunde '.$_SESSION['customerinfo']['customerno'].')'; } elseif ($role & (ROLE_MAILACCOUNT | ROLE_VMAIL_ACCOUNT)) { $userinfo .= ''.$_SESSION['mailaccount'].'
(Postfach von Benutzer '.$_SESSION['userinfo']['username'].')'; } $userinfo .= '

'; } if (isset($_SESSION['admin_user'])) { $userinfo .= '

'; $userinfo .= 'Zurück zu »'.$_SESSION['admin_user'].'«'; $userinfo .= '

'; } $messages = get_messages(); $BASE_PATH = $prefix; $THEME_PATH = $prefix."themes/".config('theme')."/"; } ?>