Implemented: Extend menus by putting *.menu.php inside the module/lib/menu.d/ folder
| | |
| | | <?php
|
| | |
|
| | | $items[] = array( 'title' => 'Default Theme',
|
| | | 'target' => 'content',
|
| | | 'link' => 'admin/tpl_default.php',
|
| | | 'html_id' => 'tpl_default');
|
| | | for($m = 0; $m < count($module['nav']); $m++) {
|
| | | if($module['nav'][$m]['title'] == 'Interface') {
|
| | |
|
| | | $module['nav'][$m]['items'][] = array( 'title' => 'Default Theme',
|
| | | 'target' => 'content',
|
| | | 'link' => 'admin/tpl_default.php',
|
| | | 'html_id' => 'tpl_default');
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | ?>
|
| | |
| | | 'link' => 'admin/system_config_edit.php?id=1', |
| | | 'html_id' => 'interface_config'); |
| | | |
| | | //**** Load the settings pages of all installed themes |
| | | $menu_dir = ISPC_WEB_PATH.'/admin/lib/interface.d'; |
| | | |
| | | if (is_dir($menu_dir)) { |
| | | if ($dh = opendir($menu_dir)) { |
| | | //** Go through all files in the menu dir |
| | | while (($file = readdir($dh)) !== false) { |
| | | if ($file != '.' && $file != '..' && substr($file, -9, 9) == '.menu.php') { |
| | | include_once($menu_dir . '/' . $file); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | $module['nav'][] = array( 'title' => 'Interface', |
| | | 'open' => "1", |
| | | 'items' => $items); |
| | |
| | | //* Load module configuration into the session. |
| | | if(is_file($mod."/lib/module.conf.php")) { |
| | | include_once($mod."/lib/module.conf.php"); |
| | | $_SESSION["s"]["module"] = $module; |
| | | |
| | | $menu_dir = ISPC_WEB_PATH.'/' . $mod . '/lib/menu.d'; |
| | | |
| | | if (is_dir($menu_dir)) { |
| | | if ($dh = opendir($menu_dir)) { |
| | | //** Go through all files in the menu dir |
| | | while (($file = readdir($dh)) !== false) { |
| | | if ($file != '.' && $file != '..' && substr($file, -9, 9) == '.menu.php' && $file != 'dns_resync.menu.php') { |
| | | include_once($menu_dir . '/' . $file); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | $_SESSION["s"]["module"] = $module; |
| | | session_write_close(); |
| | | if($redirect == ''){ |
| | | echo "HEADER_REDIRECT:".$_SESSION["s"]["module"]["startpage"]; |
| | |
| | | |
| | | if(is_file($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php')) { |
| | | include_once($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php'); |
| | | $menu_dir = ISPC_WEB_PATH.'/' . $_SESSION['s']['user']['startmodule'] . '/lib/menu.d'; |
| | | |
| | | if (is_dir($menu_dir)) { |
| | | if ($dh = opendir($menu_dir)) { |
| | | //** Go through all files in the menu dir |
| | | while (($file = readdir($dh)) !== false) { |
| | | if ($file != '.' && $file != '..' && substr($file, -9, 9) == '.menu.php' && $file != 'dns_resync.menu.php') { |
| | | include_once($menu_dir . '/' . $file); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | $_SESSION['s']['module'] = $module; |
| | | } |
| | | |
| | |
| | | <tmpl_loop name="items"> |
| | | <li <tmpl_if name="html_id"> id='<tmpl_var name="html_id">' </tmpl_if>> |
| | | <tmpl_if name="link"> |
| | | <tmpl_if name="target" op="==" value="_blank"> |
| | | <a href="<tmpl_var name='link'>" target="_blank"> |
| | | <tmpl_else> |
| | | <a href="#" onclick="loadContent('<tmpl_var name='link'>')"> |
| | | </tmpl_if> |
| | | </tmpl_if> |
| | | <tmpl_var name="title"> |
| | | <tmpl_if name="link"> |
| | |
| | | |
| | | unset($items); |
| | | |
| | | //**** Load additional menu items |
| | | $menu_dir = ISPC_WEB_PATH.'/tools/lib/menu.d'; |
| | | |
| | | if (is_dir($menu_dir)) { |
| | | if ($dh = opendir($menu_dir)) { |
| | | //** Go through all files in the menu dir |
| | | while (($file = readdir($dh)) !== false) { |
| | | if ($file != '.' && $file != '..' && substr($file, -9, 9) == '.menu.php' && $file != 'dns_resync.menu.php') { |
| | | include_once($menu_dir . '/' . $file); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | ?> |