source: temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mymenu.php @ 405

Revision 405, 2.3 KB checked in by root, 20 years ago (diff)
Line 
1<?php
2
3if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
4
5if( ! defined( 'XOOPS_ORETEKI' ) ) {
6    // Skip for ORETEKI XOOPS
7
8    if( ! isset( $module ) || ! is_object( $module ) ) $module = $xoopsModule ;
9    else if( ! is_object( $xoopsModule ) ) die( '$xoopsModule is not set' )  ;
10
11    if( file_exists("../language/".$xoopsConfig['language']."/modinfo.php") ) {
12        include_once("../language/".$xoopsConfig['language']."/modinfo.php");
13    } else {
14        include_once("../language/english/modinfo.php");
15    }
16
17    include( './menu.php' ) ;
18
19//  array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => '../system/admin.php?fct=preferences&op=showmod&mod=' . $module->getvar('mid') ) ) ;
20    $menuitem_dirname = $module->getvar('dirname') ;
21    if( $module->getvar('hasconfig') ) array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => 'admin/admin.php?fct=preferences&op=showmod&mod=' . $module->getvar('mid') ) ) ;
22
23    $menuitem_count = 0 ;
24    $mymenu_uri = empty( $mymenu_fake_uri ) ? $_SERVER['REQUEST_URI'] : $mymenu_fake_uri ;
25    $mymenu_link = substr( strstr( $mymenu_uri , '/admin/' ) , 1 ) ;
26
27    // hilight
28    foreach( array_keys( $adminmenu ) as $i ) {
29        if( $mymenu_link == $adminmenu[$i]['link'] ) {
30            $adminmenu[$i]['color'] = '#FFCCCC' ;
31            $adminmenu_hilighted = true ;
32        } else {
33            $adminmenu[$i]['color'] = '#DDDDDD' ;
34        }
35    }
36    if( empty( $adminmenu_hilighted ) ) {
37        foreach( array_keys( $adminmenu ) as $i ) {
38            if( stristr( $mymenu_uri , $adminmenu[$i]['link'] ) ) {
39                $adminmenu[$i]['color'] = '#FFCCCC' ;
40            }
41        }
42    }
43
44
45
46/*  // display
47    foreach( $adminmenu as $menuitem ) {
48        echo "<a href='".XOOPS_URL."/modules/$menuitem_dirname/{$menuitem['link']}' style='background-color:{$menuitem['color']};font:normal normal bold 9pt/12pt;'>{$menuitem['title']}</a> &nbsp; \n" ;
49
50        if( ++ $menuitem_count >= 4 ) {
51            echo "</div>\n<div width='95%' align='center'>\n" ;
52            $menuitem_count = 0 ;
53        }
54    }
55    echo "</div>\n" ;
56*/
57    // display
58    echo "<div style='text-align:left;width:98%;'>" ;
59    foreach( $adminmenu as $menuitem ) {
60        echo "<div style='float:left;height:1.5em;'><nobr><a href='".XOOPS_URL."/modules/$menuitem_dirname/{$menuitem['link']}' style='background-color:{$menuitem['color']};font:normal normal bold 9pt/12pt;'>{$menuitem['title']}</a> | </nobr></div>\n" ;
61    }
62    echo "</div>\n<hr style='clear:left;display:block;' />\n" ;
63
64}
65
66?>
Note: See TracBrowser for help on using the repository browser.