Пример #1
0
 public function header()
 {
     global $xoopsConfig, $xoopsUser, $xoopsModule, $xoTheme, $xoopsTpl;
     parent::header();
     if ($xoopsModule && !$xoopsModule->getInfo('rmnative')) {
         RMTemplate::get()->add_script(XOOPS_URL . '/include/xoops.js');
     }
 }
Пример #2
0
 function header()
 {
     parent::header();
     if (!file_exists(XOOPS_CACHE_PATH . '/adminmenu.php')) {
         $this->generateMenu();
     }
     xoops_legacy_cp_header();
     return true;
 }
Пример #3
0
 function header()
 {
     parent::header();
     global $xoopsConfig, $xoopsUser, $xoopsModule, $xoTheme, $xoopsTpl;
     $tpl =& $this->template;
     $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
     $xoTheme->addStylesheet('modules/system/class/gui/oxygen/css/style.css');
     $tpl->assign('lang_php_vesion', PHP_VERSION);
     $tpl->assign('lang_mysql_version', mysql_get_server_info());
     $tpl->assign('lang_server_api', PHP_SAPI);
     $tpl->assign('lang_os_name', PHP_OS);
     $tpl->assign('safe_mode', ini_get('safe_mode') ? 'On' : 'Off');
     $tpl->assign('register_globals', ini_get('register_globals') ? 'On' : 'Off');
     $tpl->assign('magic_quotes_gpc', ini_get('magic_quotes_gpc') ? 'On' : 'Off');
     $tpl->assign('allow_url_fopen', ini_get('allow_url_fopen') ? 'On' : 'Off');
     $tpl->assign('fsockopen', function_exists('fsockopen') ? 'On' : 'Off');
     $tpl->assign('allow_call_time_pass_reference', ini_get('allow_call_time_pass_reference') ? 'On' : 'Off');
     $tpl->assign('post_max_size', ini_get('post_max_size'));
     $tpl->assign('max_input_time', ini_get('max_input_time'));
     $tpl->assign('output_buffering', ini_get('output_buffering'));
     $tpl->assign('max_execution_time', ini_get('max_execution_time'));
     $tpl->assign('memory_limit', ini_get('memory_limit'));
     $tpl->assign('file_uploads', ini_get('file_uploads') ? 'On' : 'Off');
     $tpl->assign('upload_max_filesize', ini_get('upload_max_filesize'));
     $tpl->assign('xoops_sitename', $xoopsConfig['sitename']);
     // ADD MENU *****************************************
     //Add  CONTROL PANEL  Menu  items
     $menu = array();
     $menu[0]['link'] = XOOPS_URL;
     $menu[0]['title'] = _YOURHOME;
     $menu[0]['absolute'] = 1;
     $menu[1]['link'] = XOOPS_URL . '/admin.php?xoopsorgnews=1';
     $menu[1]['title'] = _XOOPS_NEWS;
     $menu[1]['absolute'] = 1;
     $menu[1]['icon'] = XOOPS_ADMINTHEME_URL . '/oxygen/images/xoops.png';
     $menu[2]['link'] = XOOPS_URL . '/user.php?op=logout';
     $menu[2]['title'] = _LOGOUT;
     $menu[2]['absolute'] = 1;
     $menu[2]['icon'] = XOOPS_ADMINTHEME_URL . '/oxygen/images/logout.png';
     $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => _CPHOME, 'menu' => $menu));
     //add SYSTEM  Menu items
     include dirname(__FILE__) . '/menu.php';
     if (empty($xoopsModule) || 'system' == $xoopsModule->getVar('dirname', 'n')) {
         $modpath = XOOPS_URL . '/admin.php';
         $modname = _AD_SYSOPTIONS;
         $modid = 1;
         $moddir = 'system';
         $mod_options = $adminmenu;
         foreach (array_keys($mod_options) as $item) {
             $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . '/modules/' . $moddir . '/' . $mod_options[$item]['link'] : $mod_options[$item]['link'];
             $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_ADMINTHEME_URL . '/oxygen/' . $mod_options[$item]['icon'];
             unset($mod_options[$item]['icon_small']);
         }
     } else {
         $moddir = $xoopsModule->getVar('dirname', 'n');
         $modpath = XOOPS_URL . '/modules/' . $moddir;
         $modname = $xoopsModule->getVar('name');
         $modid = $xoopsModule->getVar('mid');
         $mod_options = $xoopsModule->getAdminMenu();
         foreach (array_keys($mod_options) as $item) {
             $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['link'] : $mod_options[$item]['link'];
             $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['icon'];
         }
     }
     $tpl->assign('mod_options', $mod_options);
     $tpl->assign('modpath', $modpath);
     $tpl->assign('modname', $modname);
     $tpl->assign('modid', $modid);
     $tpl->assign('moddir', $moddir);
     // add MODULES  Menu items
     $module_handler =& xoops_gethandler('module');
     $criteria = new CriteriaCompo();
     $criteria->add(new Criteria('hasadmin', 1));
     $criteria->add(new Criteria('isactive', 1));
     $criteria->setSort('mid');
     $mods = $module_handler->getObjects($criteria);
     $menu = array();
     $moduleperm_handler =& xoops_gethandler('groupperm');
     foreach ($mods as $mod) {
         $rtn = array();
         $modOptions = array();
         //add for sub menus
         $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
         if ($sadmin) {
             $info = $mod->getInfo();
             if (!empty($info['adminindex'])) {
                 $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
             } else {
                 $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid');
             }
             $rtn['title'] = $mod->name();
             $rtn['absolute'] = 1;
             $rtn['url'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/';
             //add for sub menus
             $modOptions = $mod->getAdminMenu();
             //add for sub menus
             $rtn['options'] = $modOptions;
             //add for sub menus
             if (isset($info['icon']) && $info['icon'] != '') {
                 $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon'];
             }
         }
         $menu[] = $rtn;
     }
     $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin', 'text' => _MD_AM_MDAD, 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu));
     // add preferences menu
     $menu = array();
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=show&confcat_id=1', 'title' => _MD_OXYGEN_GENERAL, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/oxygen/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=show&confcat_id=2', 'title' => _MD_OXYGEN_USERSETTINGS, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/oxygen/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=show&confcat_id=3', 'title' => _MD_OXYGEN_METAFOOTER, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/oxygen/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=show&confcat_id=4', 'title' => _MD_OXYGEN_CENSOR, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/oxygen/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=show&confcat_id=5', 'title' => _MD_OXYGEN_SEARCH, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/oxygen/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=show&confcat_id=6', 'title' => _MD_OXYGEN_MAILER, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/oxygen/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=show&confcat_id=7', 'title' => _MD_OXYGEN_AUTHENTICATION, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/oxygen/icons/prefs_small.png');
     foreach ($mods as $mod) {
         $rtn = array();
         $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
         if ($sadmin && ($mod->getVar('hasnotification') || is_array($mod->getInfo('config')) || is_array($mod->getInfo('comments')))) {
             $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid');
             $rtn['title'] = $mod->name();
             $rtn['absolute'] = 1;
             $rtn['icon'] = XOOPS_ADMINTHEME_URL . '/gui/oxygen/icons/prefs_small.png';
             $menu[] = $rtn;
         }
     }
     $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences', 'text' => _MD_OXYGEN_SITEPREF, 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu));
     //add OPTIONS/Links Menu Items
     $menu = array();
     $menu[] = array('link' => 'http://www.xoops.org', 'title' => _XOOPS_WEBSITE, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/oxygen/images/xoops.png');
     $menu[] = array('link' => 'http://www.xoops.org/modules/extgallery/', 'title' => _AD_XOOPSTHEMES, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/oxygen/images/tweb.png');
     $menu[] = array('link' => 'http://www.xoops.org/modules/repository/', 'title' => _AD_XOOPSMODULES, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/oxygen/images/xoops.png');
     $menu[] = array('link' => 'http://sourceforge.net/projects/xoops/', 'title' => _SOURCEFORGE, 'absolute' => 1);
     $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => _AD_INTERESTSITES, 'menu' => $menu));
     //add OPTIONS/links for local support
     if (file_exists($file = XOOPS_ADMINTHEME_PATH . '/oxygen/language/' . $xoopsConfig['language'] . '/localsupport.php')) {
         $links = (include XOOPS_ADMINTHEME_PATH . '/oxygen/language/' . $xoopsConfig['language'] . '/localsupport.php');
         if (count($links) > 0) {
             $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => _AD_LOCALSUPPORT, 'menu' => $links));
         }
     }
     if (is_object($xoopsModule) || !empty($_GET['xoopsorgnews'])) {
         if (is_object($xoopsModule) && file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/' . $xoopsModule->getInfo('adminmenu'))) {
             include $file;
         }
         return;
     }
     foreach ($mods as $mod) {
         $rtn = array();
         $moduleperm_handler =& xoops_gethandler('groupperm');
         $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
         if ($sadmin) {
             $info = $mod->getInfo();
             if (!empty($info['adminindex'])) {
                 $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
             } else {
                 $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid');
             }
             $rtn['title'] = $mod->getVar('name');
             $rtn['absolute'] = 1;
             if (isset($info['icon_big'])) {
                 $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon_big'];
             } elseif (isset($info['image'])) {
                 $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['image'];
             }
         }
         $tpl->append('modules', $rtn);
     }
 }
Пример #4
0
    function header()
    {
        parent::header();
        global $xoopsConfig, $xoopsUser, $xoopsModule, $xoTheme, $xoopsTpl;
        $xoTheme->addStylesheet(XOOPS_URL . '/modules/system/class/gui/default/css/style.css');
        $xoTheme->addScript('', '', '
        function xoopsVariableDefined(variable) {
            try { var isDefined = (eval(variable) != "undefined") }
            catch(e) { var isDefined = false }
            return isDefined;
        }

        function xoopsToggleDisplay(id) {
            if (!xoopsVariableDefined("xoopsToggleLabel")) {
                var toggle_innerHTML = new Array("»", "«");
            } else {
                var toggle_innerHTML = xoopsToggleLabel;
            }
            var elestyle = xoopsGetElementById(id).style;
            var label = xoopsGetElementById(id+"-label");
            if (elestyle.display == "none") {
                elestyle.display = "block";
                label.innerHTML = toggle_innerHTML[1];
            } else {
                elestyle.display = "none";
                label.innerHTML = toggle_innerHTML[0];
            }
        }
        ');
        $moduleperm_handler =& xoops_gethandler('groupperm');
        $admin_mids = $moduleperm_handler->getItemIds('module_admin', $xoopsUser->getGroups());
        $xoops_admin_menu = $this->loadMenu();
        echo "\n        <body>\n          <table border='0' width='100%' cellspacing='0' cellpadding='0'>\n            <tr>\n              <td bgcolor='#2a75c5' background='" . XOOPS_URL . "/modules/system/class/gui/default/images/xo-banner_bg.png'><a href='http://xoops.sourceforge.net/' rel='external'><img src='" . XOOPS_URL . "/modules/system/class/gui/default/images/xoops-logo.png' alt='" . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES) . "' /></a></td>\n              <td height='80' align='right' bgcolor='#9F009F' background='" . XOOPS_URL . "/modules/system/class/gui/default/images/xo-banner_bg.png' colspan='2'></td>\n            </tr>\n            <tr>\n              <td align='left' colspan='3' class='bg5'>\n                <table border='0' width='100%' cellspacing='0' cellpadding='0'>\n                  <tr>\n                    <td width='1%'><img src='" . XOOPS_URL . "/modules/system/class/gui/default/images/hbar_left.gif' width='16' height='23' /></td>\n                    <td class='hbar_middle'>\n                      &nbsp;&laquo; <a href='" . XOOPS_URL . "/'>" . _YOURHOME . "</a>\n                      &nbsp;|&nbsp;<a href='" . XOOPS_URL . "/admin.php'>" . _CPHOME . "</a>\n                      &nbsp;|&nbsp;<strong>XOOPS &raquo;</strong>\n                      &nbsp;<a href='" . XOOPS_URL . "/admin.php?xoopsorgnews=1' title='" . _MD_CPANEL_NEWS_DESC . "'>" . _MD_CPANEL_NEWS . "</a>\n                      &nbsp;&sdot;&nbsp;<a href='http://sourceforge.net/projects/xoops/' rel='external' title='" . _MD_CPANEL_PROJECT_DESC . "'>" . _MD_CPANEL_PROJECT . "</a>\n                      &nbsp;&sdot;&nbsp;<a href='http://xoops.sourceforge.net/' rel='external' title='" . _MD_CPANEL_COMMUNITY_DESC . "'>" . _MD_CPANEL_COMMUNITY . "</a>\n                      &nbsp;&sdot;&nbsp;<a href='http://www.xoops.org/modules/xoopspartners/' rel='external' title='" . _MD_CPANEL_LOCAL_DESC . "'>" . _MD_CPANEL_LOCAL . "</a>\n                    </td>\n                    <td class='hbar_middle' align='right'><a href='" . XOOPS_URL . "/user.php?op=logout'>" . _LOGOUT . "</a>&nbsp;</td>\n                    <td width='1%'><img src='" . XOOPS_URL . "/modules/system/class/gui/default/images/hbar_right.gif' width='10' height='23' /></td>\n                  </tr>\n                </table>\n              </td>\n            </tr>\n          </table>\n          <table border='0' cellpadding='0' cellspacing='0' width='100%'>\n            <tr>\n              <td width='2%' valign='top' class='bg5 bg_menu' align='center'></td>\n              <td width='15%' valign='top' class='bg5' align='left'><img src='" . XOOPS_URL . "/modules/system/class/gui/default/images/menu.gif' /><br />\n                <table border='0' cellpadding='4' cellspacing='0' width='100%'><tr><td>";
        $current_mid = isset($GLOBALS["xoopsModule"]) && $GLOBALS["xoopsModule"] ? $GLOBALS["xoopsModule"]->getVar("mid") : 0;
        foreach (array_keys($xoops_admin_menu) as $mid) {
            if (!in_array($mid, $admin_mids)) {
                continue;
            }
            echo "<h5>" . "<a href='javascript: xoopsToggleDisplay(\"mb-{$mid}\")' title='dirname: " . $xoops_admin_menu[$mid]["dirname"] . "'>" . "<span id='mb-{$mid}-label' style='padding-right: 5px;'>" . ($mid == $current_mid ? "&laquo;" : "&raquo;") . "</span>" . $xoops_admin_menu[$mid]["name"] . "</a></h5>";
            echo "<div id='mb-{$mid}'" . ($mid == $current_mid ? "" : " style='display: none;'") . ">" . $xoops_admin_menu[$mid]["content"] . "</div>";
        }
        echo "\n        </td></tr></table>\n        <br />\n        </td>\n        <td align='left' valign='top' width='82%'>\n        <div class='content'><br />\n";
    }
Пример #5
0
    function header()
    {
        parent::header();
        global $xoopsConfig, $xoopsUser, $xoopsModule, $xoTheme;
        $tpl =& $this->template;
        $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
        $xoTheme->addScript('', '', '
        startList = function() {
/* currentStyle restricts the Javascript to IE only */
	if (document.all &&
 document.getElementById(nav).currentStyle) {  
        var navroot = document.getElementById(nav);
        /* Get all the list items within the menu */
        var lis=navroot.getElementsByTagName("li");  
        for (i=0; i<lis.length; i++) {
           /* If the li has another menu level */
            if(lis[i].lastChild.tagName=="ul"){
                /* assign the function to the li */
             	lis[i].onmouseover=function() {	
                   /* display the inner menu */
                   this.lastChild.style.display="block";
                }
                lis[i].onmouseout=function() {   
                   this.lastChild.style.display="none";
                }
            }
        }
    }
}
window.onload= function(){
    /* pass the function the id of the top level il */
    /* remove one, when only using one menu */
    activateMenu("nav"); 
    /*activateMenu("vertnav"); */
}
	xoopsOnloadEvent(startList);');
        $tpl->assign('lang_cp', _CPHOME);
        $tpl->assign('system_options', _AD_SYSOPTIONS);
        $tpl->assign('lang_banners', _AM_SYSTEM_BANS);
        $tpl->assign('lang_blocks', _AM_SYSTEM_BLOCKS);
        $tpl->assign('lang_groups', _AM_SYSTEM_ADGS);
        $tpl->assign('lang_images', _AM_SYSTEM_IMAGES);
        $tpl->assign('lang_modules', _AM_SYSTEM_MODULES);
        $tpl->assign('lang_preferences', _AM_SYSTEM_PREF);
        $tpl->assign('lang_smilies', _AM_SYSTEM_SMLS);
        $tpl->assign('lang_ranks', _AM_SYSTEM_RANK);
        $tpl->assign('lang_edituser', _AM_SYSTEM_USER);
        $tpl->assign('lang_mailuser', _AM_SYSTEM_MLUS);
        $tpl->assign('lang_avatars', _AM_SYSTEM_AVATARS);
        $tpl->assign('lang_tpls', _AM_SYSTEM_TPLSETS);
        $tpl->assign('lang_comments', _AM_SYSTEM_COMMENTS);
        $tpl->assign('lang_insmodules', _AD_INSTALLEDMODULES);
        $tpl->assign('xoops_sitename', $xoopsConfig['sitename']);
        //for system overview
        $tpl->assign('lang_overview', _MD_CPANEL_OVERVIEW);
        $tpl->assign('lang_phpextensions', _MD_CPANEL_PHPEXTENSIONS);
        $tpl->assign('lang_about_xoops', _MD_ABOUT);
        $tpl->assign('lang_about_xoops_text', _MD_ABOUT_TEXT);
        $tpl->assign('lang_version', _MD_VERSION);
        $tpl->assign('lang_version_xoops', _MD_VERSION_XOOPS);
        $tpl->assign('lang_version_php', _MD_VERSION_PHP);
        $tpl->assign('lang_version_mysql', _MD_VERSION_MYSQL);
        $tpl->assign('lang_server_api_name', _MD_Server_API);
        $tpl->assign('lang_os', _MD_OS);
        $tpl->assign('lang_xoops_links', _MD_XOOPS_LINKS);
        //start system overview
        $tpl->assign('lang_xoops_version', XOOPS_VERSION);
        $tpl->assign('lang_php_vesion', PHP_VERSION);
        $tpl->assign('lang_mysql_version', mysql_get_server_info());
        $tpl->assign('lang_server_api', PHP_SAPI);
        $tpl->assign('lang_os_name', PHP_OS);
        $tpl->assign('safe_mode', ini_get('safe_mode') ? 'On' : 'Off');
        $tpl->assign('register_globals', ini_get('register_globals') ? 'On' : 'Off');
        $tpl->assign('magic_quotes_gpc', ini_get('magic_quotes_gpc') ? 'On' : 'Off');
        $tpl->assign('allow_url_fopen', ini_get('allow_url_fopen') ? 'On' : 'Off');
        $tpl->assign('fsockopen', function_exists('fsockopen') ? 'On' : 'Off');
        $tpl->assign('allow_call_time_pass_reference', ini_get('allow_call_time_pass_reference') ? 'On' : 'Off');
        $tpl->assign('post_max_size', ini_get('post_max_size'));
        $tpl->assign('max_input_time', ini_get('max_input_time'));
        $tpl->assign('output_buffering', ini_get('output_buffering'));
        $tpl->assign('max_execution_time', ini_get('max_execution_time'));
        $tpl->assign('memory_limit', ini_get('memory_limit'));
        $tpl->assign('file_uploads', ini_get('file_uploads') ? 'On' : 'Off');
        $tpl->assign('upload_max_filesize', ini_get('upload_max_filesize'));
        $tpl->assign('xoops_sitename', $xoopsConfig['sitename']);
        //for xoops links
        $tpl->assign('lang_xoops_xoopsproject', _MD_XOOPSPROJECT);
        $tpl->assign('lang_xoops_localsupport', _MD_LOCALSUPPORT);
        $tpl->assign('lang_xoops_xoopscore', _MD_XOOPSCORE);
        $tpl->assign('lang_xoops_xoopsthems', _MD_XOOPSTHEME);
        $tpl->assign('lang_xoops_xoopswiki', _MD_XOOPSWIKI);
        $tpl->assign('lang_xoops_codesvn', _MD_CODESVN);
        $tpl->assign('lang_xoops_reportbug', _MD_REPORTBUG);
        $tpl->assign('lang_xoops_movetoblue', _MD_MOVETOBLUE);
        $tpl->assign('lang_xoops_movetobluelink', _MD_MOVETOBLUE_LINK);
        // ADD MENU *****************************************
        //Add  CONTROL PANEL  Menu  items
        $menu = array();
        $menu[0]['link'] = XOOPS_URL;
        $menu[0]['title'] = _YOURHOME;
        $menu[0]['absolute'] = 1;
        $menu[1]['link'] = XOOPS_URL . '/admin.php?xoopsorgnews=1';
        $menu[1]['title'] = 'XOOPS News';
        $menu[1]['absolute'] = 1;
        $menu[1]['icon'] = XOOPS_ADMINTHEME_URL . '/zetadigme/img/xoops.png';
        $menu[2]['link'] = XOOPS_URL . '/user.php?op=logout';
        $menu[2]['title'] = _LOGOUT;
        $menu[2]['absolute'] = 1;
        $menu[2]['icon'] = XOOPS_ADMINTHEME_URL . '/zetadigme/img/logout.png';
        $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => _CPHOME, 'menu' => $menu));
        //add SYSTEM  Menu items
        include dirname(__FILE__) . '/menu.php';
        $system_options = $adminmenu;
        foreach (array_keys($adminmenu) as $item) {
            $system_options[$item]['link'] = empty($adminmenu[$item]['absolute']) ? XOOPS_URL . '/modules/system/' . $adminmenu[$item]['link'] : $adminmenu[$item]['link'];
            $system_options[$item]['icon'] = empty($adminmenu[$item]['icon_small']) ? '' : XOOPS_ADMINTHEME_URL . '/zetadigme/' . $adminmenu[$item]['icon_small'];
            unset($system_options[$item]['icon_small']);
        }
        $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php', 'text' => _AD_SYSOPTIONS, 'menu' => $system_options));
        if (empty($xoopsModule) || 'system' == $xoopsModule->getVar('dirname', 'n')) {
            $modpath = XOOPS_URL . '/admin.php';
            $modname = _AD_SYSOPTIONS;
            $modid = 1;
            $moddir = 'system';
            $mod_options = $adminmenu;
            foreach (array_keys($mod_options) as $item) {
                $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . '/modules/' . $moddir . '/' . $mod_options[$item]['link'] : $mod_options[$item]['link'];
                $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_ADMINTHEME_URL . '/zetadigme/' . $mod_options[$item]['icon'];
                unset($mod_options[$item]['icon_small']);
            }
        } else {
            $moddir = $xoopsModule->getVar('dirname', 'n');
            $modpath = XOOPS_URL . '/modules/' . $moddir;
            $modname = $xoopsModule->getVar('name');
            $modid = $xoopsModule->getVar('mid');
            $mod_options = $xoopsModule->getAdminMenu();
            foreach (array_keys($mod_options) as $item) {
                $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['link'] : $mod_options[$item]['link'];
                $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['icon'];
            }
        }
        $tpl->assign('mod_options', $mod_options);
        $tpl->assign('modpath', $modpath);
        $tpl->assign('modname', $modname);
        $tpl->assign('modid', $modid);
        $tpl->assign('moddir', $moddir);
        // add MODULES  Menu items
        $module_handler =& xoops_gethandler('module');
        $criteria = new CriteriaCompo();
        $criteria->add(new Criteria('hasadmin', 1));
        $criteria->add(new Criteria('isactive', 1));
        $criteria->setSort('mid');
        $mods = $module_handler->getObjects($criteria);
        $menu = array();
        $moduleperm_handler =& xoops_gethandler('groupperm');
        foreach ($mods as $mod) {
            $rtn = array();
            $modOptions = array();
            //add for sub menus
            $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
            if ($sadmin) {
                $info = $mod->getInfo();
                if (!empty($info['adminindex'])) {
                    $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
                } else {
                    $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->getVar('mid');
                }
                $rtn['title'] = $mod->name();
                $rtn['absolute'] = 1;
                $rtn['url'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/';
                //add for sub menus
                $modOptions = $mod->getAdminMenu();
                //add for sub menus
                $rtn['options'] = $modOptions;
                //add for sub menus
                if (isset($info['icon']) && $info['icon'] != '') {
                    $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon'];
                }
                $menu[] = $rtn;
            }
        }
        $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin', 'text' => _AM_SYSTEM_MODULES, 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu));
        // add preferences menu
        $menu = array();
        $OPT = array();
        $OPT[] = array('link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=1', 'title' => _THEME_GENERAL, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
        $OPT[] = array('link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=2', 'title' => _THEME_USERSETTINGS, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
        $OPT[] = array('link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=3', 'title' => _THEME_METAFOOTER, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
        $OPT[] = array('link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=4', 'title' => _THEME_CENSOR, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
        $OPT[] = array('link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=5', 'title' => _THEME_SEARCH, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
        $OPT[] = array('link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=6', 'title' => _THEME_MAILER, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
        $OPT[] = array('link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=7', 'title' => _THEME_AUTHENTICATION, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
        $OPT[] = array('link' => 'admin.php?fct=preferences&amp;op=showmod&amp;mod=1', 'title' => _THEME_MODULESETTINGS, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
        $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences', 'title' => _AD_SYSOPTIONS, 'absolute' => 1, 'url' => XOOPS_URL . '/modules/system/', 'options' => $OPT);
        foreach ($mods as $mod) {
            $rtn = array();
            $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
            if ($sadmin && ($mod->getVar('hasnotification') || is_array($mod->getInfo('config')) || is_array($mod->getInfo('comments')))) {
                $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->getVar('mid');
                $rtn['title'] = $mod->name();
                $rtn['absolute'] = 1;
                $menu[] = $rtn;
            }
            //$menu[] = $rtn;
        }
        $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin', 'text' => _THEME_SITEPREF, 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu));
        //add OPTIONS/Links Menu Items
        $menu = array();
        $menu[] = array('link' => 'http://www.xoops.org', 'title' => 'XOOPS', 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/xoops.png');
        $menu[] = array('link' => 'http://www.xoops.org/modules/library/', 'title' => _AD_XOOPSTHEMES, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/tweb.png');
        $menu[] = array('link' => 'http://www.xoops.org/modules/repository/', 'title' => _AD_XOOPSMODULES, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/xoops.png');
        $menu[] = array('link' => 'http://sourceforge.net/projects/xoops/', 'title' => 'Sourceforge', 'absolute' => 1);
        $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => _AD_INTERESTSITES, 'menu' => $menu));
        //add OPTIONS/links for local support
        if (file_exists($file = XOOPS_ADMINTHEME_PATH . '/zetadigme/language/' . $xoopsConfig['language'] . '/localsupport.php')) {
            $links = (include XOOPS_ADMINTHEME_PATH . '/zetadigme/language/' . $xoopsConfig['language'] . '/localsupport.php');
            if (count($links) > 0) {
                $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => _AD_LOCALSUPPORT, 'menu' => $links));
            }
        }
        if (is_object($xoopsModule) || !empty($_GET['xoopsorgnews'])) {
            return;
        }
        foreach ($mods as $mod) {
            $rtn = array();
            $moduleperm_handler =& xoops_gethandler('groupperm');
            $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
            if ($sadmin) {
                $info = $mod->getInfo();
                if (!empty($info['adminindex'])) {
                    $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
                } else {
                    $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->getVar('mid');
                }
                $rtn['title'] = $mod->getVar('name');
                $rtn['description'] = $mod->getInfo('description');
                $rtn['absolute'] = 1;
                if (isset($info['icon_big'])) {
                    $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon_big'];
                } elseif (isset($info['image'])) {
                    $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['image'];
                }
            }
            $tpl->append('modules', $rtn);
        }
    }
Пример #6
0
 function header()
 {
     parent::header();
     global $xoopsConfig, $xoopsUser, $xoopsModule, $xoTheme, $xoopsTpl;
     $tpl =& $this->template;
     $xoTheme =& $this->xoTheme;
     $xoTheme->addScript('Frameworks/jquery/jquery.js');
     $tpl->assign('lang_cp', _CPHOME);
     //for system options
     $tpl->assign('system_options', _AD_SYSOPTIONS);
     $tpl->assign('lang_banners', _MD_AM_BANS);
     $tpl->assign('lang_blocks', _MD_AM_BKAD);
     $tpl->assign('lang_groups', _MD_AM_ADGS);
     $tpl->assign('lang_images', _MD_AM_IMAGES);
     $tpl->assign('lang_modules', _MD_AM_MDAD);
     $tpl->assign('lang_preferences', _MD_AM_PREF);
     $tpl->assign('lang_smilies', _MD_AM_SMLS);
     $tpl->assign('lang_ranks', _MD_AM_RANK);
     $tpl->assign('lang_edituser', _MD_AM_USER);
     $tpl->assign('lang_finduser', _MD_AM_FINDUSER);
     $tpl->assign('lang_mailuser', _MD_AM_MLUS);
     $tpl->assign('lang_avatars', _MD_AM_AVATARS);
     $tpl->assign('lang_tpls', _MD_AM_TPLSETS);
     $tpl->assign('lang_comments', _MD_AM_COMMENTS);
     $tpl->assign('lang_insmodules', _AD_INSTALLEDMODULES);
     $tpl->assign('lang_tools', _MD_AM_TOOLS);
     //for toolpit help texts
     $tpl->assign('lang_banners_help', _MD_AM_BANS_HELP);
     $tpl->assign('lang_blocks_help', _MD_AM_BKAD_HELP);
     $tpl->assign('lang_groups_help', _MD_AM_ADGS_HELP);
     $tpl->assign('lang_images_help', _MD_AM_IMAGES_HELP);
     $tpl->assign('lang_modules_help', _MD_AM_MDAD_HELP);
     $tpl->assign('lang_preferences_help', _MD_AM_PREF_HELP);
     $tpl->assign('lang_smilies_help', _MD_AM_SMLS_HELP);
     $tpl->assign('lang_ranks_help', _MD_AM_RANK_HELP);
     $tpl->assign('lang_edituser_help', _MD_AM_USER_HELP);
     $tpl->assign('lang_finduser_help', _MD_AM_FINDUSER_HELP);
     $tpl->assign('lang_mailuser_help', _MD_AM_MLUS_HELP);
     $tpl->assign('lang_avatars_help', _MD_AM_AVATARS_HELP);
     $tpl->assign('lang_tpls_help', _MD_AM_TPLSETS_HELP);
     $tpl->assign('lang_comments_help', _MD_AM_COMMENTS_HELP);
     $tpl->assign('lang_tools_help', _MD_AM_TOOLS_HELP);
     //for system overview
     $tpl->assign('lang_overview', _MD_CPANEL_OVERVIEW);
     $tpl->assign('lang_phpextensions', _MD_CPANEL_PHPEXTENSIONS);
     $tpl->assign('lang_about_xoops', _MD_OXYGEN_ABOUT);
     $tpl->assign('lang_about_xoops_text', _MD_OXYGEN_ABOUT_TEXT);
     $tpl->assign('lang_version', _MD_OXYGEN_VERSION);
     $tpl->assign('lang_version_xoops', _MD_OXYGEN_VERSION_XOOPS);
     $tpl->assign('lang_version_php', _MD_OXYGEN_VERSION_PHP);
     $tpl->assign('lang_version_mysql', _MD_OXYGEN_VERSION_MYSQL);
     $tpl->assign('lang_server_api_name', _MD_OXYGEN_Server_API);
     $tpl->assign('lang_os', _MD_OXYGEN_OS);
     $tpl->assign('lang_xoops_links', _MD_OXYGEN_XOOPS_LINKS);
     //for xoops links
     $tpl->assign('lang_xoops_xoopsproject', _MD_OXYGEN_XOOPSPROJECT);
     $tpl->assign('lang_xoops_localsupport', _MD_OXYGEN_LOCALSUPPORT);
     $tpl->assign('lang_xoops_xoopscore', _MD_OXYGEN_XOOPSCORE);
     $tpl->assign('lang_xoops_xoopsthems', _MD_OXYGEN_XOOPSTHEME);
     $tpl->assign('lang_xoops_xoopswiki', _MD_OXYGEN_XOOPSWIKI);
     $tpl->assign('lang_xoops_xoopsbooks', _MD_OXYGEN_XOOPSBOOKS);
     $tpl->assign('lang_xgiftshop', _MD_OXYGEN_XGIFTSHOP);
     $tpl->assign('lang_xdonations', _MD_OXYGEN_XDONATIONS);
     $tpl->assign('lang_xdonations_text', _MD_OXYGEN_XDONATIONS_TEXT);
     $tpl->assign('lang_xoops_newmodule', _MD_OXYGEN_NEWMODULE);
     $tpl->assign('lang_xoops_xoopsfaq', _MD_OXYGEN_XOOPSFAQ);
     $tpl->assign('lang_xoops_codesvn', _MD_OXYGEN_CODESVN);
     $tpl->assign('lang_xoops_reportbug', _MD_OXYGEN_REPORTBUG);
     //add for styles name
     $tpl->assign('lang_silver', _MD_LANG_SILVER);
     $tpl->assign('lang_dark', _MD_LANG_DARK);
     $tpl->assign('lang_orange', _MD_LANG_ORANGE);
     //start system overview
     $tpl->assign('lang_xoops_version', XOOPS_VERSION);
     $tpl->assign('lang_php_vesion', PHP_VERSION);
     $tpl->assign('lang_mysql_version', mysql_get_server_info());
     $tpl->assign('lang_server_api', PHP_SAPI);
     $tpl->assign('lang_os_name', PHP_OS);
     $tpl->assign('safe_mode', ini_get('safe_mode') ? 'On' : 'Off');
     $tpl->assign('register_globals', ini_get('register_globals') ? 'On' : 'Off');
     $tpl->assign('magic_quotes_gpc', ini_get('magic_quotes_gpc') ? 'On' : 'Off');
     $tpl->assign('allow_url_fopen', ini_get('allow_url_fopen') ? 'On' : 'Off');
     $tpl->assign('fsockopen', function_exists('fsockopen') ? 'On' : 'Off');
     $tpl->assign('allow_call_time_pass_reference', ini_get('allow_call_time_pass_reference') ? 'On' : 'Off');
     $tpl->assign('post_max_size', ini_get('post_max_size'));
     $tpl->assign('max_input_time', ini_get('max_input_time'));
     $tpl->assign('output_buffering', ini_get('output_buffering'));
     $tpl->assign('max_execution_time', ini_get('max_execution_time'));
     $tpl->assign('memory_limit', ini_get('memory_limit'));
     $tpl->assign('file_uploads', ini_get('file_uploads') ? 'On' : 'Off');
     $tpl->assign('upload_max_filesize', ini_get('upload_max_filesize'));
     $tpl->assign('xoops_sitename', $xoopsConfig['sitename']);
     // ADD MENU *****************************************
     define('XOOPS_ADMINTHEME_URL', XOOPS_URL . '/modules/system/class/gui');
     // add by kris
     define('XOOPS_ADMINTHEME_PATH', XOOPS_ROOT_PATH . '/modules/system/class/gui');
     // add by kris
     //Add  CONTROL PANEL  Menu  items
     $menu = array();
     $menu[0]['link'] = XOOPS_URL;
     $menu[0]['title'] = _YOURHOME;
     $menu[0]['absolute'] = 1;
     $menu[1]['link'] = XOOPS_URL . '/admin.php?xoopsorgnews=1';
     $menu[1]['title'] = _XOOPS_NEWS;
     $menu[1]['absolute'] = 1;
     $menu[1]['icon'] = XOOPS_ADMINTHEME_URL . '/nova/images/xoops.png';
     $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => _CPHOME, 'menu' => $menu));
     //add SYSTEM  Menu items
     include dirname(__FILE__) . '/menu.php';
     if ($xoopsModule) {
         if ('system' == $xoopsModule->getVar('dirname', 'n')) {
             $modpath = XOOPS_URL . '/admin.php';
             $modname = _AD_SYSOPTIONS;
             $modid = 1;
             $moddir = 'system';
             /**/
             $mod_options = $adminmenu;
             foreach (array_keys($mod_options) as $item) {
                 $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . '/modules/' . $moddir . '/' . $mod_options[$item]['link'] : $mod_options[$item]['link'];
                 $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_ADMINTHEME_URL . '/nova/' . $mod_options[$item]['icon'];
                 unset($mod_options[$item]['icon_small']);
             }
         } else {
             $moddir = $xoopsModule->getVar('dirname', 'n');
             $modpath = XOOPS_URL . '/modules/' . $moddir;
             $modname = $xoopsModule->getVar('name');
             $modid = $xoopsModule->getVar('mid');
             $modImage = '../' . $xoopsModule->getInfo('image');
             $mod_options = $xoopsModule->getAdminMenu();
             foreach (array_keys($mod_options) as $item) {
                 $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['link'] : $mod_options[$item]['link'];
                 $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['icon'];
             }
             $tpl->assign('modImage', $modImage);
         }
         $tpl->assign('mod_options', $mod_options);
         $tpl->assign('modpath', $modpath);
         $tpl->assign('modname', $modname);
         $tpl->assign('modid', $modid);
         $tpl->assign('moddir', $moddir);
     }
     // add preferences menu
     $menu = array();
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=show&amp;confcat_id=1', 'title' => "基本参数设置", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=show&amp;confcat_id=2', 'title' => "会员管理设置 ", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=show&amp;confcat_id=3', 'title' => "Meta 及页脚", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=show&amp;confcat_id=4', 'title' => "敏感词语检查", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=show&amp;confcat_id=5', 'title' => "搜索选项", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=show&amp;confcat_id=6', 'title' => "邮件设置", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=show&amp;confcat_id=7', 'title' => "认证方式管理", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences', 'text' => "站点", 'dir' => "", 'menu' => $menu));
     // xianshi
     $menu = array();
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin', 'title' => "区块管理", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=tplsets', 'title' => "模板管理", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $tpl->append('navitems', array('link' => '###', 'text' => "显示/外观", 'dir' => "", 'menu' => $menu));
     // manage tools
     $menu = array();
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=avatars', 'title' => "头像管理", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=banners', 'title' => "广告管理", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=comments', 'title' => "评论管理", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=findusers', 'title' => "查找用户", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=users', 'title' => "编辑用户", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=groups', 'title' => "群组管理", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=images', 'title' => "图片管理", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=mailusers', 'title' => "邮件群发", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=smilies', 'title' => "表情管理", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=userrank', 'title' => "等级管理", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin', 'title' => "模块管理", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/prefs_small.png');
     $menu[] = array('link' => XOOPS_URL . '/modules/system/admin.php?fct=tools', 'title' => "维护工具", 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/nova/icons/tools_small.png');
     $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences', 'text' => "管理工具", 'dir' => "", 'menu' => $menu));
     // add MODULES  Menu items
     $module_handler =& xoops_gethandler('module');
     $criteria = new CriteriaCompo();
     $criteria->add(new Criteria('hasadmin', 1));
     $criteria->add(new Criteria('isactive', 1));
     $criteria->setSort('mid');
     $mods = $module_handler->getObjects($criteria);
     unset($mods[0]);
     $menu = array();
     $moduleperm_handler =& xoops_gethandler('groupperm');
     foreach ($mods as $mod) {
         $rtn = array();
         $modOptions = array();
         //add for sub menus
         $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
         if ($sadmin) {
             $info = $mod->getInfo();
             if (!empty($info['adminindex'])) {
                 $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
             } else {
                 $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->getVar('mid');
             }
             $rtn['title'] = $mod->name();
             $rtn['absolute'] = 1;
             $rtn['url'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/';
             //add for sub menus
             if (isset($info['icon']) && $info['icon'] != '') {
                 $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon'];
             }
         }
         $menu[] = $rtn;
     }
     $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin', 'text' => "应用程序", 'dir' => "", 'menu' => $menu));
     /*add OPTIONS/Links Menu Items
             $menu = array();
             $menu[] = array(
                 'link'      => 'http://www.xoops.org',
                 'title'     => _XOOPS_WEBSITE,
                 'absolute'  => 1,
                 'icon'     => XOOPS_ADMINTHEME_URL . '/nova/images/xoops.png');
             $menu[] = array(
                 'link'      => 'http://www.xoops.org/modules/extgallery/',
                 'title'     => _AD_XOOPSTHEMES,
                 'absolute'  => 1,
                 'icon'     => XOOPS_ADMINTHEME_URL . '/nova/images/tweb.png');
             $menu[] = array(
                 'link'      => 'http://www.xoops.org/modules/repository/',
                 'title'     => _AD_XOOPSMODULES,
                 'absolute'  => 1,
                 'icon'     => XOOPS_ADMINTHEME_URL . '/nova/images/xoops.png');
             $menu[] = array(
                 'link'      => 'http://sourceforge.net/projects/xoops/',
                 'title'     => _SOURCEFORGE,
                 'absolute'  => 1);
     
             $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php','text' => _AD_INTERESTSITES, 'menu' => $menu));
             
             //add OPTIONS/links for local support
             if (file_exists($file = XOOPS_ADMINTHEME_PATH . '/nova/language/' . $xoopsConfig['language'] . '/localsupport.php' )) {
                 $links = include XOOPS_ADMINTHEME_PATH . '/nova/language/' . $xoopsConfig['language'] . '/localsupport.php';
                 if ( count($links) > 0 ) {
                     $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php','text' => _AD_LOCALSUPPORT, 'menu' => $links));
                 }
             }
             */
     if (is_object($xoopsModule) || !empty($_GET['xoopsorgnews'])) {
         return;
     }
     foreach ($mods as $mod) {
         $rtn = array();
         $moduleperm_handler =& xoops_gethandler('groupperm');
         $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
         if ($sadmin) {
             $info = $mod->getInfo();
             if (!empty($info['adminindex'])) {
                 $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
             } else {
                 $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->getVar('mid');
             }
             $rtn['title'] = $mod->getVar('name');
             $rtn['absolute'] = 1;
             if (isset($info['icon_big'])) {
                 $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon_big'];
             } elseif (isset($info['image'])) {
                 $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['image'];
             }
         }
         $tpl->append('modules', $rtn);
     }
     if (empty($mods)) {
         $tpl->assign('cpanel', true);
     }
     // ###### Output warn messages for security ######
     if (is_dir(XOOPS_ROOT_PATH . "/install/")) {
         $tpl->assign('warninginstall', sprintf(_AD_WARNINGINSTALL, XOOPS_ROOT_PATH . '/install/'));
     }
     if (is_writable(XOOPS_ROOT_PATH . "/mainfile.php")) {
         $tpl->assign('warningwriteable_mainfile', sprintf(_AD_WARNINGWRITEABLE, XOOPS_ROOT_PATH . '/mainfile.php'));
     }
     // ###### Output warn messages for correct functionality  ######
     if (!is_writable(XOOPS_CACHE_PATH)) {
         $tpl->assign('warningwriteable_cache', sprintf(_AD_WARNINGNOTWRITEABLE, XOOPS_CACHE_PATH));
     }
     if (!is_writable(XOOPS_UPLOAD_PATH)) {
         $tpl->assign('warningwriteable_upload', sprintf(_AD_WARNINGNOTWRITEABLE, XOOPSS_UPLOAD_PATH));
     }
     if (!is_writable(XOOPS_COMPILE_PATH)) {
         $tpl->assign('warningwriteable_compile', sprintf(_AD_WARNINGNOTWRITEABLE, XOOPS_COMPILE_PATH));
     }
     if (strpos(XOOPS_PATH, XOOPS_ROOT_PATH) !== false || strpos(XOOPS_PATH, $_SERVER['DOCUMENT_ROOT']) !== false) {
         $tpl->assign('warningxoopslibinside_path', sprintf(_AD_WARNINGXOOPSLIBINSIDE, XOOPS_PATH));
     }
     if (strpos(XOOPS_VAR_PATH, XOOPS_ROOT_PATH) !== false || strpos(XOOPS_VAR_PATH, $_SERVER['DOCUMENT_ROOT']) !== false) {
         $tpl->assign('warningxoopslibinside_var', sprintf(_AD_WARNINGXOOPSLIBINSIDE, XOOPS_VAR_PATH));
     }
 }
Пример #7
0
 function header()
 {
     parent::header();
     global $xoopsConfig, $xoopsUser, $xoopsModule, $xoTheme;
     $tpl =& $this->template;
     $xoTheme->addScript('', '', '
     startList = function() {
         if (document.all&&document.getElementById) {
             navRoot = document.getElementById("nav");
             for (i=0; i<navRoot.childNodes.length; i++) {
                 node = navRoot.childNodes[i];
                 if (node.nodeName=="li") {
                     node.onmouseover=function() {
                         this.className+=" over";
                     }
                     node.onmouseout=function() {
                         this.className=this.className.replace(" over", "");
                     }
                 }
             }
         }
     }
     xoopsOnloadEvent(startList);');
     $tpl->assign('lang_cp', _CPHOME);
     $tpl->assign('system_options', _AD_SYSOPTIONS);
     $tpl->assign('lang_banners', _MD_AM_BANS);
     $tpl->assign('lang_blocks', _MD_AM_BKAD);
     $tpl->assign('lang_groups', _MD_AM_ADGS);
     $tpl->assign('lang_images', _MD_AM_IMAGES);
     $tpl->assign('lang_modules', _MD_AM_MDAD);
     $tpl->assign('lang_preferences', _MD_AM_PREF);
     $tpl->assign('lang_smilies', _MD_AM_SMLS);
     $tpl->assign('lang_ranks', _MD_AM_RANK);
     $tpl->assign('lang_edituser', _MD_AM_USER);
     $tpl->assign('lang_finduser', _MD_AM_FINDUSER);
     $tpl->assign('lang_mailuser', _MD_AM_MLUS);
     $tpl->assign('lang_avatars', _MD_AM_AVATARS);
     $tpl->assign('lang_tpls', _MD_AM_TPLSETS);
     $tpl->assign('lang_comments', _MD_AM_COMMENTS);
     $tpl->assign('lang_insmodules', _AD_INSTALLEDMODULES);
     $tpl->assign('xoops_sitename', $xoopsConfig['sitename']);
     // ADD MENU *****************************************
     //Add  CONTROL PANEL  Menu  items
     $menu = array();
     $menu[0]['link'] = XOOPS_URL;
     $menu[0]['title'] = _YOURHOME;
     $menu[0]['absolute'] = 1;
     $menu[1]['link'] = XOOPS_URL . '/admin.php?xoopsorgnews=1';
     $menu[1]['title'] = 'XOOPS News';
     $menu[1]['absolute'] = 1;
     $menu[1]['icon'] = XOOPS_ADMINTHEME_URL . '/exm/img/xoops.png';
     $menu[2]['link'] = XOOPS_URL . '/user.php?op=logout';
     $menu[2]['title'] = _LOGOUT;
     $menu[2]['absolute'] = 1;
     $menu[2]['icon'] = XOOPS_ADMINTHEME_URL . '/exm/img/logout.png';
     $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => _CPHOME, 'menu' => $menu));
     //add SYSTEM  Menu items
     include dirname(__FILE__) . '/menu.php';
     $system_options = $adminmenu;
     foreach (array_keys($adminmenu) as $item) {
         $system_options[$item]['link'] = empty($adminmenu[$item]['absolute']) ? XOOPS_URL . '/modules/system/' . $adminmenu[$item]['link'] : $adminmenu[$item]['link'];
         $system_options[$item]['icon'] = empty($adminmenu[$item]['icon_small']) ? '' : XOOPS_ADMINTHEME_URL . '/exm/' . $adminmenu[$item]['icon_small'];
         unset($system_options[$item]['icon_small']);
     }
     $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php', 'text' => _AD_SYSOPTIONS, 'menu' => $system_options));
     if (empty($xoopsModule) || 'system' == $xoopsModule->getVar('dirname', 'n')) {
         $modpath = XOOPS_URL . '/admin.php';
         $modname = _AD_SYSOPTIONS;
         $modid = 1;
         $moddir = 'system';
         $mod_options = $adminmenu;
         foreach (array_keys($mod_options) as $item) {
             $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . '/modules/system/' . $mod_options[$item]['link'] : $mod_options[$item]['link'];
             $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_ADMINTHEME_URL . '/exm/' . $mod_options[$item]['icon'];
             unset($mod_options[$item]['icon_small']);
         }
     } else {
         $moddir = $xoopsModule->getVar('dirname', 'n');
         $modpath = XOOPS_URL . '/modules/' . $moddir;
         $modname = $xoopsModule->getVar('name');
         $modid = $xoopsModule->getVar('mid');
         $mod_options = $xoopsModule->getAdminMenu();
         foreach (array_keys($mod_options) as $item) {
             $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . '/modules/' . $moddir . '/' . $mod_options[$item]['link'] : $mod_options[$item]['link'];
             $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_URL . '/modules/' . $moddir . '/' . $mod_options[$item]['icon'];
         }
     }
     $tpl->assign('mod_options', $mod_options);
     $tpl->assign('modpath', $modpath);
     $tpl->assign('modname', $modname);
     $tpl->assign('modid', $modid);
     $tpl->assign('moddir', $moddir);
     // add MODULES  Menu items
     $module_handler =& xoops_gethandler('module');
     $criteria = new CriteriaCompo();
     $criteria->add(new Criteria('hasadmin', 1));
     $criteria->add(new Criteria('isactive', 1));
     $criteria->setSort('mid');
     $mods = $module_handler->getObjects($criteria);
     $menu = array();
     $moduleperm_handler =& xoops_gethandler('groupperm');
     foreach ($mods as $mod) {
         $rtn = array();
         $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
         if ($sadmin) {
             $info = $mod->getInfo();
             if (!empty($info['adminindex'])) {
                 $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
             } else {
                 $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->getVar('mid');
             }
             $rtn['title'] = $mod->name();
             $rtn['absolute'] = 1;
             if (isset($info['icon']) && $info['icon'] != '') {
                 $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon'];
             }
             $menu[] = $rtn;
         }
     }
     $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin', 'text' => _MD_AM_MDAD, 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu));
     //add OPTIONS/Links Menu Items
     $menu = array();
     $menu[] = array('link' => 'http://www.xoops.org', 'title' => 'XOOPS', 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/exm/icons/xoops.png');
     $menu[] = array('link' => 'http://www.xoops.org/modules/library/', 'title' => _AD_XOOPSTHEMES, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/exm/icons/tweb.png');
     $menu[] = array('link' => 'http://www.xoops.org/modules/repository/', 'title' => _MD_AM_MDAD, 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/exm/icons/xoops.png');
     $menu[] = array('link' => 'http://sourceforge.net/projects/xoops/', 'title' => 'Sourceforge', 'absolute' => 1);
     $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => _AD_INTERESTSITES, 'menu' => $menu));
     if (is_object($xoopsModule) || !empty($_GET['xoopsorgnews'])) {
         return;
     }
     foreach ($mods as $mod) {
         $rtn = array();
         $moduleperm_handler =& xoops_gethandler('groupperm');
         $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
         if ($sadmin) {
             $info = $mod->getInfo();
             if (!empty($info['adminindex'])) {
                 $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
             } else {
                 $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->getVar('mid');
             }
             $rtn['title'] = $mod->getVar('name');
             $rtn['absolute'] = 1;
             if (isset($info['icon_big'])) {
                 $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon_big'];
             } elseif (isset($info['image'])) {
                 $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['image'];
             }
             $tpl->append('modules', $rtn);
         }
     }
 }