<?php
if (! defined("TOP_INCLUDED"))
{
define("TOP_INCLUDED", true);
include("config.php");
require_once("inc/error.php");
global $prefix;
$menuitem = array();
$weighted_menuitem = array();
foreach ($config['modules'] as $module)
{
include("modules/{$module}/menu.php");
if ($menu === false)
{
DEBUG("Modul {$module} hat keine Menüeinträge");
continue;
}
DEBUG("<h4>$module</h4>");
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 (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(print_r($weighted_menuitem, true));
/*
$menuitem["index"]["label"] = "Übersicht";
$menuitem["index"]["file"] = "index.php";
$menuitem["domains"]["label"] = "Domains";
$menuitem["domains"]["file"] = "domains.php";