Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv14870
Added Files:
menu.php
Log Message:
menu generation
--- NEW FILE: menu.php ---
<?php
include_once("../config/uc_config.inc");
include_once("lib/uc_page.php");
$page = new UcPage("menu");
$page->open();
$sess = $page->getSession();
if (!empty($logout))
{
$sess->logout();
header("Location: " . $ucConfig->wwwRoot . "/admin/menu.php?content=main.php");
}
if (!empty($username) && !empty($password))
{
$sess->login($username, $password);
}
$user = $sess->getUser();
$userGroups = $user->groups;
$userGroups[] = $user->gid;
include("config/uc_templates.inc");
$tmpl = new ModeliXe($uc_tmpl["MENU"]);
$tmpl->SetModeliXe();
$tmpl->SetMxSession(SID);
if (!empty($content))
$tmpl->MxAttribut("contentframe", "JavaScript:parent.content.location.href = '$content'");
// Login / logout box
if ($user->uid == -1)
{
$tmpl->MxBloc("login", "modify", "../templates/" . $uc_tmpl['LOGIN']);
}
else
{
$tmpl->MxBloc("login", "modify", "../templates/" . $uc_tmpl['LOGOUT']);
$tmpl->MxUrl("login.logout", $ucConfig->wwwRoot
. "/admin/menu.php", array( "logout" => "1"));
$tmpl->MxText("login.username", $user->name);
$tmpl->MxUrl("login.myaccount", "myaccount.php");
}
// Menu generation
$tmpl->MxBloc("menu", "append", "../templates/" . $uc_tmpl['APP_MENU']);
$apps = array( "WebCalendar" => $ucConfig->wwwModules . "/WebCalendar",
"Owl" => $ucConfig->wwwModules . "/Owl",
"phpBB" => $ucConfig->wwwModules . "/phpBB2",
"SPIP" => $ucConfig->wwwModules . "/SPIP");
foreach ($apps as $appName => $appUrl)
{
$tmpl->MxText("menu.appmenu.application", $appName);
$tmpl->MxUrl("menu.appmenu.appurl", $appUrl);
$tmpl->MxBloc("menu.appmenu", "loop");
}
// append administrative menu items
if ($user->uid != -1)
{
$tmpl->MxBloc("menu", "append", "../templates/"
. $uc_tmpl['ADMIN_MENU']);
$tmpl->MxUrl("menu.packages", "packages.php", "");
$tmpl->MxUrl("menu.accounts", "userslist.php");
$tmpl->MxUrl("menu.permissions", "permissions.php");
}
$tmpl->MxWrite();
?>
|