當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Legacy_Utils::checkSystemModules方法代碼示例

本文整理匯總了PHP中Legacy_Utils::checkSystemModules方法的典型用法代碼示例。如果您正苦於以下問題:PHP Legacy_Utils::checkSystemModules方法的具體用法?PHP Legacy_Utils::checkSystemModules怎麽用?PHP Legacy_Utils::checkSystemModules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Legacy_Utils的用法示例。


在下文中一共展示了Legacy_Utils::checkSystemModules方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: callbackSetupUser

 /**
  * Checks whether the site is closed now, and whether all of must modules
  * have been installed. This function is called through delegates.
  * @var XoopsUser &$xoopsUser
  * @see preBlockFilter()
  */
 function callbackSetupUser(&$principal, &$controller, &$context)
 {
     $retArray = Legacy_Utils::checkSystemModules();
     $accessAllowFlag = false;
     $xoopsConfig = $controller->mRoot->mContext->getXoopsConfig();
     if (!empty($_POST['xoops_login'])) {
         define('XOOPS_CPFUNC_LOADED', 1);
         $controller->checkLogin();
         return;
     } elseif (is_object($context->mXoopsUser)) {
         if (in_array(XOOPS_GROUP_ADMIN, $context->mXoopsUser->getGroups())) {
             $accessAllowFlag = true;
         }
     }
     // @todo Devide following lines to another preload file
     if ($accessAllowFlag) {
         $GLOBALS['xoopsUser'] = $context->mXoopsUser;
         if (!empty($_POST['cube_module_install'])) {
             //@todo use Ticket
             require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleInstaller.class.php";
             require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleInstallUtils.class.php";
             if (isset($_POST['uninstalled_modules']) && is_array($_POST['uninstalled_modules'])) {
                 foreach ($_POST['uninstalled_modules'] as $module) {
                     $module = basename($module);
                     if (in_array($module, $retArray['uninstalled'])) {
                         $controller->mRoot->mLanguageManager->loadModuleAdminMessageCatalog('legacy');
                         $handler =& xoops_gethandler('module');
                         $xoopsModule =& $handler->create();
                         $xoopsModule->set('weight', 1);
                         $xoopsModule->loadInfoAsVar($module);
                         $installer =& Legacy_ModuleInstallUtils::createInstaller($xoopsModule->get('dirname'));
                         $installer->setForceMode(true);
                         $installer->setCurrentXoopsModule($xoopsModule);
                         $installer->executeInstall();
                     }
                 }
             }
             if (isset($_POST['disabled_modules']) && is_array($_POST['disabled_modules'])) {
                 $moduleHandler =& xoops_gethandler('module');
                 foreach ($_POST['disabled_modules'] as $module) {
                     $module = basename($module);
                     if (in_array($module, $retArray['disabled'])) {
                         if ($moduleObject =& $moduleHandler->getByDirname($module)) {
                             $moduleObject->setVar('isactive', 1);
                             $moduleHandler->insert($moduleObject);
                             $blockHandler =& xoops_gethandler('block');
                             $blockHandler->syncIsActive($moduleObject->get('mid'), $moduleObject->get('isactive'));
                         }
                     }
                 }
             }
             if (isset($_POST['option_modules']) && is_array($_POST['option_modules'])) {
                 $handler =& xoops_getmodulehandler('non_installation_module', 'legacy');
                 $objects = $handler->getObjects();
                 $optionModules = array();
                 foreach ($objects as $module) {
                     if (!in_array($module->get('dirname'), $retArray['uninstalled'])) {
                         $optionModules[] = $module->get('dirname');
                     }
                 }
                 foreach ($_POST['option_modules'] as $module) {
                     $module = basename($module);
                     if (in_array($module, $optionModules)) {
                         $controller->mRoot->mLanguageManager->loadModuleAdminMessageCatalog('legacy');
                         $handler =& xoops_gethandler('module');
                         $xoopsModule =& $handler->create();
                         $xoopsModule->set('weight', 1);
                         $xoopsModule->loadInfoAsVar($module);
                         $installer =& Legacy_ModuleInstallUtils::createInstaller($xoopsModule->get('dirname'));
                         $installer->setForceMode(true);
                         $installer->setCurrentXoopsModule($xoopsModule);
                         $installer->executeInstall();
                     }
                 }
             }
             $controller->executeRedirect(XOOPS_URL . '/', 1);
         } elseif (!empty($_GET['cube_module_uninstall'])) {
             require_once XOOPS_ROOT_PATH . '/class/template.php';
             $xoopsTpl = new XoopsTpl();
             $xoopsTpl->assign('cube_module_uninstall', htmlspecialchars($_GET['cube_module_uninstall'], ENT_QUOTES));
             $xoopsTpl->assign(array('xoops_sitename' => htmlspecialchars($xoopsConfig['sitename']), 'xoops_themecss' => xoops_getcss(), 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/'));
             ///< @todo filebase template with absolute file path
             $xoopsTpl->compile_check = true;
             $xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/legacy/templates/legacy_uninstall_modules.html');
             exit;
         } elseif (!empty($_POST['cube_module_uninstallok'])) {
             //@todo use Ticket
             require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleUninstaller.class.php";
             require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleInstallUtils.class.php";
             $module = basename($_POST['cube_module_uninstallok']);
             if (in_array($module, $retArray['disabled'])) {
                 $controller->mRoot->mLanguageManager->loadModuleAdminMessageCatalog('legacy');
                 $handler =& xoops_gethandler('module');
                 $xoopsModule =& $handler->getByDirname($module);
//.........這裏部分代碼省略.........
開發者ID:nouphet,項目名稱:rata,代碼行數:101,代碼來源:SystemModuleInstall.class.php


注:本文中的Legacy_Utils::checkSystemModules方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。