72 lines
3.5 KiB
PHP
72 lines
3.5 KiB
PHP
<?php
|
|
/** \file scripts\page\menu_system.php
|
|
* \brief DI webinterface menu system script.
|
|
* \author Rob Schalken, Core|Vision
|
|
* \version 1.0
|
|
* \date 17-10-2008
|
|
*
|
|
* This file contains the menu system
|
|
*
|
|
*/
|
|
|
|
//== Required settings ======================
|
|
if (is_valid_action("system_overview")) {
|
|
$_PAGE_INFO['page_title'] = "system maintenance menu";
|
|
|
|
$_PAGE_INFO['history_menu_buttons'] = array("Project overview", $_PAGE_INFO['HIST_MAIN']);
|
|
$_PAGE_INFO['history_menu_links'] = array("page/project", "page/menu");
|
|
//Button text //Page (including next action) // Rights needed
|
|
$_PAGE_INFO['menu_items'] = array( array("Equipment type maintenance" ,"page/menu_system&action=equipment_overview" ,"menu:systeemonderhoud"),
|
|
array("Help maintenance" ,"page/menu_system_info&action=help" ,"menu:systeemonderhoud"),
|
|
array("Message of the day" ,"page/menu_system_info&action=system_motd" ,"menu:systeemonderhoud"));
|
|
$title = "System maintenance";
|
|
$menu = "menu:systeemonderhoud";
|
|
}
|
|
else {
|
|
$_PAGE_INFO['page_title'] = "equipment type maintenance menu";
|
|
|
|
$_PAGE_INFO['history_menu_buttons'] = array("Project overview", $_PAGE_INFO['HIST_MAIN'], "System maintenance");
|
|
$_PAGE_INFO['history_menu_links'] = array("page/project", "page/menu", "page/menu_system&action=system_overview");
|
|
//Button text //Page (including next action) // Rights needed
|
|
$_PAGE_INFO['menu_items'] = array( array("Search equipment type" ,"page/menu_system_search&action=equipment_info" ,"menu:systeemonderhoud"),
|
|
array("Add equipment type" ,"page/menu_system_search&action=equipment_new" ,"menu:systeemonderhoud"),
|
|
array("Change equipment type" ,"page/menu_system_search&action=equipment_change" ,"menu:systeemonderhoud"),
|
|
array("Delete equipment type" ,"page/menu_system_search&action=equipment_delete" ,"menu:systeemonderhoud"));
|
|
$title = "Equipment type maintenance";
|
|
$menu = "menu:systeemonderhoud:materieel_type";
|
|
}
|
|
//===========================================
|
|
|
|
// Clear previous session info
|
|
unset($_SESSION[$_PAGE_INFO['id']]['action']);
|
|
unset($_SESSION[$_PAGE_INFO['id']]['recall']);
|
|
|
|
// Verify project/rights and log
|
|
if (Ver_Rights_Project_Log("menu:systeemonderhoud", $menu)) {
|
|
// Show page header
|
|
print_page_header();
|
|
|
|
// Collect menu items
|
|
for ($i = 0; $i < (sizeof($_PAGE_INFO['menu_items'])); $i++) {
|
|
// Retrieve button text
|
|
$menu_items[$i] = $_PAGE_INFO['menu_items'][$i][0];
|
|
// Verify menu rights and available link => enable/disable
|
|
if ((db_ver_rights_user_one_valid($_SESSION[$_PAGE_INFO['id']]['login']['user']['id'], $_PAGE_INFO['menu_items'][$i][2])) && (!empty($_PAGE_INFO['menu_items'][$i][1]))) {
|
|
$menu_rights[$i] = 1;
|
|
}
|
|
else {
|
|
$menu_rights[$i] = 0;
|
|
}
|
|
// Retrieve button link
|
|
$menu_links[$i] = "?id=" . $_PAGE_INFO['id'] . "&href=" . $_PAGE_INFO['menu_items'][$i][1];
|
|
}
|
|
|
|
// Display main menu
|
|
print_menu($title, $menu_items, $menu_links, $menu_rights);
|
|
|
|
// Show page footer
|
|
print_page_footer();
|
|
|
|
}
|
|
?>
|