/** * Get content of real module * * @param string $module module name * @param string $mid module id * @param string $skin skin name * @param string $skinType PC(P) or mobile(M) * @return string content of real module */ private function procRealModule($module, $mid, $skin, $skinType) { // if form site design and preview module, find target module if ($module && !$mid) { $args = new stdClass(); $args->module = $module; $output = executeQuery('layout.getOneModuleInstanceByModuleName', $args); if (!$output->toBool()) { throw new Exception($output->getMessage()); } // if there is no module instance, error... if (!$output->data) { throw new Exception(Context::getLang('msg_unabled_preview')); } $mid = current($output->data)->mid; } elseif (!$module && !$mid) { $oModuleModel = getModel('module'); $columnList = array('modules.mid', 'sites.index_module_srl'); $startModuleInfo = $oModuleModel->getSiteInfo(0, $columnList); $mid = $startModuleInfo->mid; } $oModuleHandler = new ModuleHandler('', '', $mid, '', ''); // Adhoc... $oModuleHandler->act = ''; $oModuleHandler->init(); // Adhoc... $oModuleHandler->module_info->use_mobile = 'Y'; $oModuleHandler->module_info->is_skin_fix = 'Y'; $oModuleHandler->module_info->is_mskin_fix = 'Y'; if ($skinType == 'M') { Mobile::setMobile(TRUE); $oModuleHandler->module_info->mskin = $skin; } else { Mobile::setMobile(FALSE); $oModuleHandler->module_info->skin = $skin; } // Proc module $oModule = $oModuleHandler->procModule(); if (!$oModule->toBool()) { throw new Exception(Context::getLang('not_support_layout_preview')); } // get module html require_once _XE_PATH_ . "classes/display/HTMLDisplayHandler.php"; $handler = new HTMLDisplayHandler(); return $handler->toDoc($oModule); }
* @brief Declare constants for generic use and for checking to avoid a direct call from the Web **/ define('__XE__', TRUE); /** * @brief Include the necessary configuration files **/ require dirname(__FILE__) . '/config/config.inc.php'; /** * @brief Initialize by creating Context object * Set all Request Argument/Environment variables **/ $oContext = Context::getInstance(); $oContext->init(); /** * @brief If default_url is set and it is different from the current url, attempt to redirect for SSO authentication and then process the module **/ if ($oContext->checkSSO()) { $oModuleHandler = new ModuleHandler(); try { if ($oModuleHandler->init()) { $oModuleHandler->displayContent($oModuleHandler->procModule()); } } catch (Exception $e) { htmlHeader(); echo Context::getLang($e->getMessage()); htmlFooter(); } } $oContext->close(); /* End of file index.php */ /* Location: ./index.php */
* **/ /** * @brief Declare constants for generic use and for checking to avoid a direct call from the Web **/ define('__XE__', TRUE); define('__ZBXE__', TRUE); // deprecated : __ZBXE__ will be removed. Use __XE__ instead. /** * @brief Include the necessary configuration files **/ require dirname(__FILE__) . '/config/config.inc.php'; /** * @brief Initialize by creating Context object * Set all Request Argument/Environment variables **/ $oContext =& Context::getInstance(); $oContext->init(); /** * @brief If default_url is set and it is different from the current url, attempt to redirect for SSO authentication and then process the module **/ if ($oContext->checkSSO()) { $oModuleHandler = new ModuleHandler(); if ($oModuleHandler->init()) { $oModule =& $oModuleHandler->procModule(); $oModuleHandler->displayContent($oModule); } } $oContext->close(); /* End of file index.php */ /* Location: ./index.php */