function menuusuario(){ $fmenu = null; $menu = new xpMenu(); $fmenu .= $menu->javaScript(); $fmenu .= $menu->style(); $menu->addMenu('menuusuario'); $menu->addCategory('reporte', 'Seguimientos', 'imagenes/menu/network.gif', 'menuusuario'); $menu->addOption('orden', 'Orden', 'imagenes/menu/si.gif', 'orden.php', 'reporte', 'menuusuario'); $menu->addOption('seguimiento', 'Seguimiento', 'imagenes/menu/si.gif', 'seguimiento.php', 'reporte', 'menuusuario'); $menu->addOption('salir', 'Salir', 'imagenes/menu/logout.gif', 'ingreso.php', 'reporte', 'menuusuario'); $fmenu .= $menu->mountMenu('menuusuario'); return $fmenu; }
<? //make class file require require('xpMenu.class.php'); //construct the class $xpmenu = new xpMenu(); //add category and options on menu //use the format: //addMenu("short_name") //addCategory("short_name", "name", "image", "menu") //addOption("short_name", "name", "image", "link", "category", "menu") //remember: short_name can be anything without spaces or specials chars $xpmenu->addMenu("menu1"); $xpmenu->addCategory("menusup1", "Google Links on Menu 1", "icons/network.gif", "menu1"); $xpmenu->addOption("google", "Google on Menu 1", "icons/wmail.gif", "http://www.google.com", "menusup1", "menu1"); $xpmenu->addOption("gmail", "GMail on Menu 1", "icons/news.gif", "http://www.gmail.com", "menusup1", "menu1"); $xpmenu->addOption("maps", "Google Maps on Menu 1", "icons/wmail.gif", "http://maps.google.com", "menusup1", "menu1"); $xpmenu->addOption("labs", "Google Labs on Menu 1", "icons/news.gif", "http://labs.google.com", "menusup1", "menu1"); $xpmenu->addCategory("menusup2", "My Links on Menu 1", "icons/wmail.gif", "menu1"); $xpmenu->addOption("inter", "Internacional on Menu 1", "icons/wmail.gif", "http://www.internacional.com.br", "menusup2", "menu1"); $xpmenu->addOption("theblog", "TheBlog.br on Menu 1", "icons/news.gif", "http://the.blog.br", "menusup2", "menu1"); $xpmenu->addOption("portalsi", "PortalSI.info on Menu 1", "icons/si.gif", "http://www.portalsi.info", "menusup2", "menu1"); $xpmenu->addMenu("menu2"); $xpmenu->addCategory("menu2sup1", "Google Links on Menu 2", "icons/network.gif", "menu2"); $xpmenu->addOption("google1", "Google on Menu 2", "icons/wmail.gif", "http://www.google.com", "menu2sup1", "menu2"); $xpmenu->addOption("gmail1", "GMail on Menu 2", "icons/news.gif", "http://www.gmail.com", "menu2sup1", "menu2");
function menu_header($title, $no_menu, $is_index) { global $path_to_root, $help_base_url, $power_by, $version, $db_connections, $installed_extensions; if (!$no_menu) { echo "<script type='text/javascript' src='{$path_to_root}/themes/dashboard/js/jquery-1.3.2.js'></script>\n"; echo "<script type='text/javascript' src='{$path_to_root}/themes/dashboard/js/jquery-ui-1.7.2.custom.min.js'></script>\n"; echo "<script type='text/javascript' src='{$path_to_root}/themes/dashboard/js/jquery.json-2.2.min.js'></script>\n"; echo "<script type='text/javascript' src='{$path_to_root}/themes/dashboard/js/dashboard.js'></script>\n"; echo "<script type='text/javascript' src='https://www.google.com/jsapi'></script>\n"; } $sel_app = $_SESSION['sel_app']; echo "<div class='fa-main'>\n"; if (!$no_menu) { $applications = $_SESSION['App']->applications; $local_path_to_root = $path_to_root; $img = "<img src='{$local_path_to_root}/themes/exclusive_db/images/login.gif' width='14' height='14' border='0' alt='" . _('Logout') . "'> "; $himg = "<img src='{$local_path_to_root}/themes/exclusive_db/images/help.gif' width='14' height='14' border='0' alt='" . _('Help') . "'> "; echo "<div id='header'>\n"; echo "<ul>\n"; echo " <li><a href='{$path_to_root}/admin/display_prefs.php?'>" . _("Preferences") . "</a></li>\n"; echo " <li><a href='{$path_to_root}/admin/change_current_user_password.php?selected_id=" . $_SESSION["wa_current_user"]->username . "'>" . _("Change password") . "</a></li>\n"; if ($help_base_url != null) { echo " <li><a target = '_blank' onclick=" . '"' . "javascript:openWindow(this.href,this.target); return false;" . '" ' . "href='" . help_url() . "'>{$himg}" . _("Help") . "</a></li>"; } echo " <li><a href='{$path_to_root}/access/logout.php?'>{$img}" . _("Logout") . "</a></li>"; echo "</ul>\n"; $indicator = "{$path_to_root}/themes/" . user_theme() . "/images/ajax-loader.gif"; echo "<h1>{$power_by} {$version}<span style='padding-left:300px;'><img id='ajaxmark' src='{$indicator}' align='center' style='visibility:hidden;'></span></h1>\n"; echo "</div>\n"; // header echo "<div class='fa-menu'>"; echo "<ul>\n"; foreach ($applications as $app) { if ($sel_app == $app->id) { $sel_application = $app; } $acc = access_string($app->name); echo "<li " . ($sel_app == $app->id ? "class='active' " : "") . "><a href='{$local_path_to_root}/index.php?application=" . $app->id . "'{$acc['1']}><b>" . $acc[0] . "</b></a></li>\n"; } echo "</ul>\n"; echo "</div>\n"; // menu echo "<div class='clear'></div>\n"; } echo "<div class='fa-body'>\n"; if (!$no_menu) { add_access_extensions(); echo "<div class='fa-side'>\n"; echo "<div class='fa-submenu'>\n"; $app = $sel_application; $xpmenu = new xpMenu(); $xpmenu->addMenu($sel_app); $acc = access_string($app->name); $imgs = array('orders' => 'invoice.gif', 'AP' => 'receive.gif', 'stock' => 'basket.png', 'manuf' => 'cog.png', 'proj' => 'time.png', 'GL' => 'gl.png', 'system' => 'controller.png'); if (!isset($imgs[$app->id])) { $imgs[$app->id] = "controller.png"; } $xpmenu->addCategory($app->id, $acc[0], "{$local_path_to_root}/themes/exclusive_db/images/" . $imgs[$app->id], $app->id); $i = $j = 0; if ($sel_app == "system") { $imgs2 = array("page_edit.png", "page_edit.png", "page_edit.png", "page_edit.png", "folder.gif"); } else { $imgs2 = array("folder.gif", "report.png", "page_edit.png", "money.png", "folder.gif"); } foreach ($app->modules as $module) { $xpmenu->addOption($i++, $module->name, "{$local_path_to_root}/themes/exclusive_db/images/transparent.gif", "", $app->id, $sel_app); $apps = array(); foreach ($module->lappfunctions as $appfunction) { $apps[] = $appfunction; } foreach ($module->rappfunctions as $appfunction) { $apps[] = $appfunction; } $application = array(); foreach ($apps as $application) { $lnk = access_string($application->label); if ($_SESSION["wa_current_user"]->can_access_page($application->access)) { if ($application->label != "") { $xpmenu->addOption($i++, $lnk[0], "{$local_path_to_root}/themes/exclusive_db/images/" . $imgs2[$j], "{$path_to_root}/{$application->link}", $app->id, $sel_app); } } else { $xpmenu->addOption($i++, $lnk[0], "{$local_path_to_root}/themes/exclusive_db/images/" . $imgs2[$j], "#", $app->id, $sel_app); } } $j++; } $txt = $xpmenu->javaScript(); $txt .= $xpmenu->javaScript(); $txt .= $xpmenu->style(); $txt .= $xpmenu->mountMenu($sel_app, $sel_app); echo $txt; echo "</div>\n"; // submenu echo "<div class='clear'></div>\n"; echo "</div>\n"; // fa-side echo "<div class='fa-content'>\n"; } if ($no_menu) { echo "<br>"; } elseif ($title && !$no_menu && !$is_index) { echo "<center><table id='title'><tr><td width='100%' class='titletext'>{$title}</td>" . "<td align=right>" . (user_hints() ? "<span id='hints'></span>" : '') . "</td>" . "</tr></table></center>"; } }