[170] | 1 | <?php |
---|
| 2 | |
---|
| 3 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ; |
---|
| 4 | |
---|
| 5 | if( empty( $mydirname ) ) $mydirname = basename(dirname(dirname(__FILE__))) ; |
---|
| 6 | |
---|
| 7 | if( ! defined( 'XOOPS_ORETEKI' ) ) { |
---|
| 8 | // Skip for ORETEKI XOOPS |
---|
| 9 | |
---|
| 10 | if( ! isset( $module ) || ! is_object( $module ) ) $module = $xoopsModule ; |
---|
| 11 | else if( ! is_object( $xoopsModule ) ) die( '$xoopsModule is not set' ) ; |
---|
| 12 | |
---|
| 13 | // load modinfo.php if necessary (judged by a specific constant is defined) |
---|
| 14 | if( ! defined( '_MYMENU_CONSTANT_IN_MODINFO' ) || ! defined( _MYMENU_CONSTANT_IN_MODINFO ) ) { |
---|
| 15 | if( file_exists("../language/".$xoopsConfig['language']."/modinfo.php") ) { |
---|
| 16 | include_once("../language/".$xoopsConfig['language']."/modinfo.php"); |
---|
| 17 | } else { |
---|
| 18 | include_once("../language/english/modinfo.php"); |
---|
| 19 | } |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | include( './menu.php' ) ; |
---|
| 23 | |
---|
| 24 | // array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => '../system/admin.php?fct=preferences&op=showmod&mod=' . $module->getvar('mid') ) ) ; |
---|
| 25 | $menuitem_dirname = $module->getvar('dirname') ; |
---|
| 26 | |
---|
| 27 | if( defined( 'XOOPS_TRUST_PATH' ) ) { |
---|
| 28 | |
---|
| 29 | // with XOOPS_TRUST_PATH and altsys |
---|
| 30 | |
---|
| 31 | if( file_exists( XOOPS_TRUST_PATH.'/libs/altsys/mytplsadmin.php' ) ) { |
---|
| 32 | // mytplsadmin (TODO check if this module has tplfile) |
---|
| 33 | $title = defined( '_MD_A_MYMENU_MYTPLSADMIN' ) ? _MD_A_MYMENU_MYTPLSADMIN : 'tplsadmin' ; |
---|
| 34 | array_push( $adminmenu , array( 'title' => $title , 'link' => 'admin/index.php?mode=admin&lib=altsys&page=mytplsadmin' ) ) ; |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | if( file_exists( XOOPS_TRUST_PATH.'/libs/altsys/myblocksadmin.php' ) ) { |
---|
| 38 | // myblocksadmin |
---|
| 39 | $title = defined( '_MD_A_MYMENU_MYBLOCKSADMIN' ) ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin' ; |
---|
| 40 | array_push( $adminmenu , array( 'title' => $title , 'link' => 'admin/index.php?mode=admin&lib=altsys&page=myblocksadmin' ) ) ; |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | if( file_exists( XOOPS_TRUST_PATH.'/libs/altsys/mylangadmin.php' ) ) { |
---|
| 44 | // mylangadmin |
---|
| 45 | $title = defined( '_MD_A_MYMENU_MYLANGADMIN' ) ? _MD_A_MYMENU_MYLANGADMIN : 'langadmin' ; |
---|
| 46 | array_push( $adminmenu , array( 'title' => $title , 'link' => 'admin/index.php?mode=admin&lib=altsys&page=mylangadmin' ) ) ; |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | // preferences |
---|
| 50 | $config_handler =& xoops_gethandler('config'); |
---|
| 51 | if( count( $config_handler->getConfigs( new Criteria( 'conf_modid' , $module->mid() ) ) ) > 0 ) { |
---|
| 52 | if( file_exists( XOOPS_TRUST_PATH.'/libs/altsys/mypreferences.php' ) ) { |
---|
| 53 | // mypreferences |
---|
| 54 | $title = defined( '_MD_A_MYMENU_MYPREFERENCES' ) ? _MD_A_MYMENU_MYPREFERENCES : _PREFERENCES ; |
---|
| 55 | array_push( $adminmenu , array( 'title' => $title , 'link' => 'admin/index.php?mode=admin&lib=altsys&page=mypreferences' ) ) ; |
---|
| 56 | } else if( defined( 'XOOPS_CUBE_LEGACY' ) ) { |
---|
| 57 | // Cube Legacy without altsys |
---|
| 58 | array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => XOOPS_URL.'/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $module->getvar('mid') ) ) ; |
---|
| 59 | } else { |
---|
| 60 | // system->preferences |
---|
| 61 | array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$module->mid() ) ) ; |
---|
| 62 | } |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | } else if( defined( 'XOOPS_CUBE_LEGACY' ) ) { |
---|
| 66 | // Cube Legacy without altsys |
---|
| 67 | if( $module->getvar('hasconfig') ) array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => XOOPS_URL.'/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $module->getvar('mid') ) ) ; |
---|
| 68 | } else { |
---|
| 69 | // conventinal X2 |
---|
| 70 | if( $module->getvar('hasconfig') ) array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $module->getvar('mid') ) ) ; |
---|
| 71 | } |
---|
| 72 | |
---|
| 73 | $mymenu_uri = empty( $mymenu_fake_uri ) ? $_SERVER['REQUEST_URI'] : $mymenu_fake_uri ; |
---|
| 74 | $mymenu_link = substr( strstr( $mymenu_uri , '/admin/' ) , 1 ) ; |
---|
| 75 | |
---|
| 76 | // hilight |
---|
| 77 | foreach( array_keys( $adminmenu ) as $i ) { |
---|
| 78 | if( $mymenu_link == $adminmenu[$i]['link'] ) { |
---|
| 79 | $adminmenu[$i]['color'] = '#FFCCCC' ; |
---|
| 80 | $adminmenu_hilighted = true ; |
---|
| 81 | $GLOBALS['altsysAdminPageTitle'] = $adminmenu[$i]['title'] ; |
---|
| 82 | } else { |
---|
| 83 | $adminmenu[$i]['color'] = '#DDDDDD' ; |
---|
| 84 | } |
---|
| 85 | } |
---|
| 86 | if( empty( $adminmenu_hilighted ) ) { |
---|
| 87 | foreach( array_keys( $adminmenu ) as $i ) { |
---|
| 88 | if( stristr( $mymenu_uri , $adminmenu[$i]['link'] ) ) { |
---|
| 89 | $adminmenu[$i]['color'] = '#FFCCCC' ; |
---|
| 90 | $GLOBALS['altsysAdminPageTitle'] = $adminmenu[$i]['title'] ; |
---|
| 91 | break ; |
---|
| 92 | } |
---|
| 93 | } |
---|
| 94 | } |
---|
| 95 | |
---|
| 96 | // link conversion from relative to absolute |
---|
| 97 | foreach( array_keys( $adminmenu ) as $i ) { |
---|
| 98 | if( stristr( $adminmenu[$i]['link'] , XOOPS_URL ) === false ) { |
---|
| 99 | $adminmenu[$i]['link'] = XOOPS_URL."/modules/$mydirname/" . $adminmenu[$i]['link'] ; |
---|
| 100 | } |
---|
| 101 | } |
---|
| 102 | |
---|
| 103 | // display |
---|
| 104 | echo "<div style='text-align:left;width:98%;'>" ; |
---|
| 105 | foreach( $adminmenu as $menuitem ) { |
---|
| 106 | echo "<div style='float:left;height:1.5em;'><nobr><a href='".htmlspecialchars($menuitem['link'],ENT_QUOTES)."' style='background-color:{$menuitem['color']};font:normal normal bold 9pt/12pt;'>".htmlspecialchars($menuitem['title'],ENT_QUOTES)."</a> | </nobr></div>\n" ; |
---|
| 107 | } |
---|
| 108 | echo "</div>\n<hr style='clear:left;display:block;' />\n" ; |
---|
| 109 | |
---|
| 110 | } |
---|
| 111 | |
---|
| 112 | ?> |
---|