本文整理汇总了PHP中ModuleHandler::init方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleHandler::init方法的具体用法?PHP ModuleHandler::init怎么用?PHP ModuleHandler::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleHandler
的用法示例。
在下文中一共展示了ModuleHandler::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
* @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 */
示例2: procRealModule
/**
* 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);
}