$content = "<div class='x2-note confirmMsg'>" . NO_INSTALLED_EXTENSION . "</div>";
    }
    //Reset module lists in cache folder
    $xoops->cache()->delete('system/modules');
    $xoops->setActiveModules();
} else {
    if (!$xoops->getConfig('locale')) {
        $xoops->setConfig('locale', $_COOKIE['xo_install_lang']);
    }
    $xoops->loadLocale('system');
    include_once XOOPS_ROOT_PATH . "/modules/system/class/module.php";
    include_once XOOPS_ROOT_PATH . "/modules/system/class/extension.php";
    include_once XOOPS_ROOT_PATH . "/modules/system/class/system.php";
    $system = System::getInstance();
    // Get installed modules
    $system_module = new SystemExtension();
    $dirlist = $system_module->getInstalledExtensions();
    $toinstal = 0;
    $javascript = "";
    $content = "<ul class='log'><li style='background: none;'>";
    $content .= "<table class='module'>\n";
    /* @var $ext XoopsModule */
    foreach ($dirlist as $ext) {
        clearstatcache();
        $value = 0;
        $style = "";
        if (in_array($ext->getInfo('dirname'), $wizard->configs['ext'])) {
            $value = 1;
            $style = " style='background-color:#E6EFC2;'";
        }
        $form = new Xoops\Form\ThemeForm('', 'modules', 'index.php', 'post');
Пример #2
0
 function header()
 {
     $xoops = Xoops::getInstance();
     $xoops->loadLocale('system');
     $xoops->theme()->addBaseStylesheetAssets('@jqueryuicss');
     $xoops->theme()->addStylesheet('media/xoops/css/moduladmin.css');
     $xoops->theme()->addStylesheet(\XoopsBaseConfig::get('adminthemes-url') . '/default/css/style.css');
     $xoops->theme()->addBaseScriptAssets('@jquery');
     // bootstrap has to come before jquery.ui or dialog close buttons are blank
     $xoops->theme()->addBaseScriptAssets('@bootstrap');
     $xoops->theme()->addBaseScriptAssets('@jqueryui');
     $xoops->theme()->addBaseScriptAssets('@jgrowl');
     // ddsmoothmenu
     $xoops->theme()->addScript(\XoopsBaseConfig::get('adminthemes-url') . '/default/js/ddsmoothmenu.js');
     $xoops->theme()->addScript(\XoopsBaseConfig::get('adminthemes-url') . '/default/js/tooltip.js');
     $quick = array();
     $quick[] = array('title' => SystemLocale::CONTROL_PANEL, 'link' => \XoopsBaseConfig::get('url') . '/admin.php');
     $quick[] = array('title' => XoopsLocale::HOME_PAGE, 'link' => \XoopsBaseConfig::get('url'));
     $quick[] = array('title' => DefaultThemeLocale::XOOPS_NEWS, 'link' => \XoopsBaseConfig::get('url') . '/admin.php?xoopsorgnews=1');
     $quick[] = array('title' => 'separator');
     $quick[] = array('title' => XoopsLocale::A_LOGOUT, 'link' => \XoopsBaseConfig::get('url') . '/user.php?op=logout');
     $xoops->tpl()->assign('quick_menu', $quick);
     XoopsLoad::load('module', 'system');
     XoopsLoad::load('extension', 'system');
     $system_module = new SystemModule();
     $system_extension = new SystemExtension();
     $adminmenu = null;
     include __DIR__ . '/menu.php';
     if (!$xoops->isModule() || 'system' == $xoops->module->getVar('dirname', 'n')) {
         $modpath = \XoopsBaseConfig::get('url') . '/admin.php';
         $modname = DefaultThemeLocale::SYSTEM_OPTIONS;
         $modid = 1;
         $moddir = 'system';
         $mod_options = $adminmenu;
         foreach (array_keys($mod_options) as $item) {
             $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? \XoopsBaseConfig::get('url') . '/modules/' . $moddir . '/' . $mod_options[$item]['link'] : $mod_options[$item]['link'];
             $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : \XoopsBaseConfig::get('adminthemes-url') . '/default/' . $mod_options[$item]['icon'];
             unset($mod_options[$item]['icon_small']);
         }
     } else {
         $moddir = $xoops->module->getVar('dirname', 'n');
         $modpath = \XoopsBaseConfig::get('url') . '/modules/' . $moddir;
         $modname = $xoops->module->getVar('name');
         $modid = $xoops->module->getVar('mid');
         $mod_options = $xoops->module->getAdminMenu();
         foreach (array_keys($mod_options) as $item) {
             $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? \XoopsBaseConfig::get('url') . "/modules/{$moddir}/" . $mod_options[$item]['link'] : $mod_options[$item]['link'];
             if (XoopsLoad::fileExists($xoops->path("/media/xoops/images/icons/32/" . $mod_options[$item]['icon']))) {
                 $mod_options[$item]['icon'] = $xoops->url("/media/xoops/images/icons/32/" . $mod_options[$item]['icon']);
             } else {
                 $mod_options[$item]['icon'] = $xoops->url("/modules/" . $xoops->module->dirname() . "/icons/32/" . $mod_options[$item]['icon']);
             }
         }
     }
     $xoops->tpl()->assign('mod_options', $mod_options);
     $xoops->tpl()->assign('modpath', $modpath);
     $xoops->tpl()->assign('modname', $modname);
     $xoops->tpl()->assign('modid', $modid);
     $xoops->tpl()->assign('moddir', $moddir);
     // Modules list
     $module_list = $system_module->getModuleList();
     $xoops->tpl()->assign('module_menu', $module_list);
     unset($module_list);
     // Extensions list
     $extension_list = $system_extension->getExtensionList();
     $xoops->tpl()->assign('extension_menu', $extension_list);
     unset($extension_list);
     $extension_mod = $system_extension->getExtension($moddir);
     $xoops->tpl()->assign('extension_mod', $extension_mod);
     // add preferences menu
     $menu = array();
     $OPT = array();
     $menu[] = array('link' => \XoopsBaseConfig::get('url') . '/modules/system/admin.php?fct=preferences', 'title' => XoopsLocale::PREFERENCES, 'absolute' => 1, 'url' => \XoopsBaseConfig::get('url') . '/modules/system/', 'options' => $OPT);
     $menu[] = array('title' => 'separator');
     // Module adminmenu
     if ($xoops->isModule() && $xoops->module->getVar('dirname') != 'system') {
         if ($xoops->module->getInfo('system_menu')) {
             //$xoops->theme()->addStylesheet('modules/system/css/menu.css');
             $xoops->module->loadAdminMenu();
             // Get menu tab handler
             /* @var $menu_handler SystemMenuHandler */
             $menu_handler = $xoops->getModuleHandler('menu', 'system');
             // Define top navigation
             $menu_handler->addMenuTop(\XoopsBaseConfig::get('url') . "/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=" . $xoops->module->getVar('mid', 'e'), XoopsLocale::PREFERENCES);
             if ($xoops->module->getInfo('extension')) {
                 $menu_handler->addMenuTop(\XoopsBaseConfig::get('url') . "/modules/system/admin.php?fct=extensions&amp;op=update&amp;module=" . $xoops->module->getVar('dirname', 'e'), XoopsLocale::A_UPDATE);
             } else {
                 $menu_handler->addMenuTop(\XoopsBaseConfig::get('url') . "/modules/system/admin.php?fct=modulesadmin&amp;op=update&amp;module=" . $xoops->module->getVar('dirname', 'e'), XoopsLocale::A_UPDATE);
             }
             if ($xoops->module->getInfo('blocks')) {
                 $menu_handler->addMenuTop(\XoopsBaseConfig::get('url') . "/modules/system/admin.php?fct=blocksadmin&amp;op=list&amp;filter=1&amp;selgen=" . $xoops->module->getVar('mid', 'e') . "&amp;selmod=-2&amp;selgrp=-1&amp;selvis=-1", XoopsLocale::BLOCKS);
             }
             if ($xoops->module->getInfo('hasMain')) {
                 $menu_handler->addMenuTop(\XoopsBaseConfig::get('url') . "/modules/" . $xoops->module->getVar('dirname', 'e') . "/", SystemLocale::GO_TO_MODULE);
             }
             // Define main tab navigation
             $i = 0;
             $current = $i;
             foreach ($xoops->module->adminmenu as $menu) {
                 if (stripos($_SERVER['REQUEST_URI'], $menu['link']) !== false) {
                     $current = $i;
                 }
                 $menu_handler->addMenuTabs($xoops->url('modules/' . $xoops->module->getVar('dirname') . '/' . $menu['link']), $menu['title']);
                 ++$i;
             }
             if ($xoops->module->getInfo('help')) {
                 if (stripos($_SERVER['REQUEST_URI'], 'admin/' . $xoops->module->getInfo('help')) !== false) {
                     $current = $i;
                 }
                 $menu_handler->addMenuTabs('../../system/help.php?mid=' . $xoops->module->getVar('mid', 's') . '&amp;' . $xoops->module->getInfo('help'), XoopsLocale::HELP);
             }
             // Display navigation tabs
             $xoops->tpl()->assign('xo_system_menu', $menu_handler->render($current, false));
         }
     }
 }
Пример #3
0
 $mid = $system->cleanVars($_POST, 'mid', 0, 'int');
 $module_handler = $xoops->getHandlerModule();
 $block_handler = $xoops->getHandlerBlock();
 $module = $module_handler->getById($mid);
 // Call Header
 $xoops->header('admin:system/system_modules_logger.tpl');
 // Define Stylesheet
 $xoops->theme()->addStylesheet('modules/system/css/admin.css');
 // Define Breadcrumb and tips
 $admin_page = new \Xoops\Module\Admin();
 $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true);
 $admin_page->addBreadcrumbLink(SystemLocale::EXTENSIONS_ADMINISTRATION, $system->adminVersion('extensions', 'adminpath'));
 $admin_page->addBreadcrumbLink(XoopsLocale::A_UPDATE);
 $admin_page->renderBreadcrumb();
 $ret = array();
 $system_extension = new SystemExtension();
 $ret = $system_extension->update($module->getVar('dirname'));
 $xoops->tpl()->assign('module', $ret);
 if ($ret) {
     $xoops->tpl()->assign('install', 1);
     $xoops->tpl()->assign('from_title', SystemLocale::EXTENSIONS_ADMINISTRATION);
     $xoops->tpl()->assign('from_link', $system->adminVersion('extensions', 'adminpath'));
     $xoops->tpl()->assign('title', XoopsLocale::A_UPDATE);
     $xoops->tpl()->assign('log', $system_extension->trace);
 }
 $folder = array(1, 2, 3);
 $system->cleanCache($folder);
 //Set active modules in cache folder
 $xoops->setActiveModules();
 // Call Footer
 $xoops->footer();