Rev 50 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
<div class="menu">
<div class="boxtitle">
Menu
</div>
<?php
if ( isset( $_SESSION['user'] ) && $_SESSION['user']->name() ) {
include_once("DBMenu.class.php");
$menu = new DBMenu( $dbConnection, '_menu', '_menu_id' );
$additionalMenus = array(
array(
'caption' => 'User: ' . $_SESSION['user']->name(),
'url' => "/index.php?doAdmin=1",
'shortname' => 'user'
),
array(
'caption' => 'Log Out',
'url' => "/index.php?logout=1",
'shortname' => 'logout'
)
);
if ( $_SESSION['user']->isAdmin() ) {
$additionalMenus[] = array(
'caption' => 'Administration',
'url' => "/index.php?module=admin",
'shortname' => 'admin'
);
}
/*
* if they are an admin, pass an empty array
* which gives them all menu. If not an admin
* pass in the permissions
*/
print $menu->DBMenu2String( $baseURL, $additionalMenus, $_SESSION['user']->isAdmin() ? array() : $_SESSION['user']->getPermissionList() );
}
?>
</div>