[170] | 1 | <?php |
---|
[737] | 2 | if ( preg_match ( "/^XOOPS Cube/" , XOOPS_VERSION ) ) |
---|
| 3 | { $modversion['image'] = "files/wakulogoxc.png"; } |
---|
| 4 | else if ( preg_match ( "/^ImpressCMS/" , XOOPS_VERSION ) ) |
---|
| 5 | { $modversion['image'] = "files/wakulogoic.png"; } |
---|
| 6 | else |
---|
| 7 | { $modversion['image'] = "files/wakulogo.png"; } |
---|
[170] | 8 | |
---|
| 9 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ; |
---|
| 10 | |
---|
| 11 | if( empty( $mydirname ) ) $mydirname = basename(dirname(dirname(__FILE__))) ; |
---|
| 12 | |
---|
[737] | 13 | // Detect Altsys |
---|
| 14 | // Not Active ALTSYS => $active_altsys = false; |
---|
| 15 | // Active ALTSYS => $active_altsys = true; |
---|
| 16 | $module_handler =& xoops_gethandler('module'); |
---|
| 17 | $criteria = new CriteriaCompo(); |
---|
| 18 | $criteria->add(new Criteria('dirname','altsys')); |
---|
| 19 | $criteria->add(new Criteria('isactive', 1)); |
---|
| 20 | $altsys_mod = $module_handler->getObjects($criteria); |
---|
| 21 | if(empty($altsys_mod)) $active_altsys = false; else $active_altsys = true; |
---|
| 22 | |
---|
| 23 | |
---|
[170] | 24 | if( ! defined( 'XOOPS_ORETEKI' ) ) { |
---|
| 25 | // Skip for ORETEKI XOOPS |
---|
| 26 | |
---|
| 27 | if( ! isset( $module ) || ! is_object( $module ) ) $module = $xoopsModule ; |
---|
| 28 | else if( ! is_object( $xoopsModule ) ) die( '$xoopsModule is not set' ) ; |
---|
| 29 | |
---|
| 30 | // load modinfo.php if necessary (judged by a specific constant is defined) |
---|
| 31 | if( ! defined( '_MYMENU_CONSTANT_IN_MODINFO' ) || ! defined( _MYMENU_CONSTANT_IN_MODINFO ) ) { |
---|
| 32 | if( file_exists("../language/".$xoopsConfig['language']."/modinfo.php") ) { |
---|
| 33 | include_once("../language/".$xoopsConfig['language']."/modinfo.php"); |
---|
| 34 | } else { |
---|
| 35 | include_once("../language/english/modinfo.php"); |
---|
| 36 | } |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | include( './menu.php' ) ; |
---|
| 40 | |
---|
| 41 | $menuitem_dirname = $module->getvar('dirname') ; |
---|
| 42 | |
---|
[737] | 43 | // mytplsadmin (TODO check if this module has tplfile) |
---|
| 44 | if( $active_altsys ) { |
---|
| 45 | $title = defined( '_MD_A_MYMENU_MYTPLSADMIN' ) ? _MD_A_MYMENU_MYTPLSADMIN : 'tplsadmin' ; |
---|
| 46 | array_push( $adminmenu , array( 'title' => $title , 'link' => 'admin/index.php?mode=admin&lib=altsys&page=mytplsadmin' ) ) ; |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | // myblocksadmin |
---|
| 50 | $title = defined( '_MD_A_MYMENU_MYBLOCKSADMIN' ) ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin' ; |
---|
| 51 | if( $active_altsys ){ |
---|
| 52 | // mypreferences |
---|
| 53 | array_push( $adminmenu , array( 'title' => $title , 'link' => 'admin/index.php?mode=admin&lib=altsys&page=myblocksadmin' ) ) ; |
---|
[170] | 54 | } else if( defined( 'XOOPS_CUBE_LEGACY' ) ) { |
---|
| 55 | // Cube Legacy without altsys |
---|
[737] | 56 | array_push( $adminmenu , array( 'title' => $title , 'link' => XOOPS_URL.'/modules/legacy/admin/index.php?action=BlockList') ) ; |
---|
| 57 | } else if ( preg_match ( "/^ImpressCMS/" , XOOPS_VERSION ) ){ |
---|
| 58 | // ImpressCMS |
---|
| 59 | array_push( $adminmenu , array( 'title' => $title , 'link' => XOOPS_URL.'/modules/system/admin.php?fct=blocksadmin&filtersel=mid&filtersel2='.$module->getvar('mid') ) ) ; |
---|
[170] | 60 | } else { |
---|
[737] | 61 | array_push( $adminmenu , array( 'title' => $title , 'link' => XOOPS_URL.'/modules/system/admin.php?fct=blocksadmin&op=list&filter=1&selgen='.$module->getvar('mid').'&selmod=-2&selgrp=-1&selvis=-1' ) ) ; |
---|
[170] | 62 | } |
---|
[737] | 63 | |
---|
| 64 | // mylangadmin |
---|
| 65 | if( $active_altsys ){ |
---|
| 66 | $title = defined( '_MD_A_MYMENU_MYLANGADMIN' ) ? _MD_A_MYMENU_MYLANGADMIN : 'langadmin' ; |
---|
| 67 | array_push( $adminmenu , array( 'title' => $title , 'link' => 'admin/index.php?mode=admin&lib=altsys&page=mylangadmin' ) ) ; |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | // preferences |
---|
| 71 | if( $module->getvar('hasconfig') ){ |
---|
| 72 | if( $active_altsys ){ |
---|
| 73 | // mypreferences |
---|
| 74 | $title = defined( '_MD_A_MYMENU_MYPREFERENCES' ) ? _MD_A_MYMENU_MYPREFERENCES : _PREFERENCES ; |
---|
| 75 | array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => 'admin/index.php?mode=admin&lib=altsys&page=mypreferences' ) ) ; |
---|
| 76 | } else if( defined( 'XOOPS_CUBE_LEGACY' ) ) { |
---|
| 77 | // Cube Legacy without altsys |
---|
| 78 | array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => XOOPS_URL.'/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $module->getvar('mid') ) ) ; |
---|
| 79 | } else { |
---|
| 80 | // system->preferences |
---|
| 81 | array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$module->mid() ) ) ; |
---|
| 82 | } |
---|
| 83 | } |
---|
| 84 | |
---|
| 85 | // hilight |
---|
[170] | 86 | $mymenu_uri = empty( $mymenu_fake_uri ) ? $_SERVER['REQUEST_URI'] : $mymenu_fake_uri ; |
---|
| 87 | $mymenu_link = substr( strstr( $mymenu_uri , '/admin/' ) , 1 ) ; |
---|
| 88 | |
---|
| 89 | foreach( array_keys( $adminmenu ) as $i ) { |
---|
| 90 | if( $mymenu_link == $adminmenu[$i]['link'] ) { |
---|
| 91 | $adminmenu[$i]['color'] = '#FFCCCC' ; |
---|
| 92 | $adminmenu_hilighted = true ; |
---|
| 93 | $GLOBALS['altsysAdminPageTitle'] = $adminmenu[$i]['title'] ; |
---|
| 94 | } else { |
---|
| 95 | $adminmenu[$i]['color'] = '#DDDDDD' ; |
---|
| 96 | } |
---|
| 97 | } |
---|
| 98 | if( empty( $adminmenu_hilighted ) ) { |
---|
| 99 | foreach( array_keys( $adminmenu ) as $i ) { |
---|
| 100 | if( stristr( $mymenu_uri , $adminmenu[$i]['link'] ) ) { |
---|
| 101 | $adminmenu[$i]['color'] = '#FFCCCC' ; |
---|
| 102 | $GLOBALS['altsysAdminPageTitle'] = $adminmenu[$i]['title'] ; |
---|
| 103 | break ; |
---|
| 104 | } |
---|
| 105 | } |
---|
| 106 | } |
---|
| 107 | |
---|
| 108 | // link conversion from relative to absolute |
---|
| 109 | foreach( array_keys( $adminmenu ) as $i ) { |
---|
| 110 | if( stristr( $adminmenu[$i]['link'] , XOOPS_URL ) === false ) { |
---|
| 111 | $adminmenu[$i]['link'] = XOOPS_URL."/modules/$mydirname/" . $adminmenu[$i]['link'] ; |
---|
| 112 | } |
---|
| 113 | } |
---|
| 114 | |
---|
| 115 | // display |
---|
| 116 | echo "<div style='text-align:left;width:98%;'>" ; |
---|
| 117 | foreach( $adminmenu as $menuitem ) { |
---|
| 118 | 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" ; |
---|
| 119 | } |
---|
| 120 | echo "</div>\n<hr style='clear:left;display:block;' />\n" ; |
---|
| 121 | |
---|
| 122 | } |
---|
| 123 | |
---|
| 124 | ?> |
---|