当前位置: 首页>>代码示例>>PHP>>正文


PHP eZModule::run方法代码示例

本文整理汇总了PHP中eZModule::run方法的典型用法代码示例。如果您正苦于以下问题:PHP eZModule::run方法的具体用法?PHP eZModule::run怎么用?PHP eZModule::run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZModule的用法示例。


在下文中一共展示了eZModule::run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: forward

 /**
  * Forwards the current execution to another module/view with the existing
  * parameters.
  *
  * @param eZModule $module The eZModule object the request will be forwarded to
  * @param string $functionName The function to run in that module
  * @param array $parameters
  *        An array of parameters that will be added to the request. These
  *        will be merged with the existing parameters
  * @return array The forwarded module/view result
  */
 function forward($module, $functionName, $parameters = false)
 {
     $Return = null;
     if ($module && $functionName) {
         $viewName = self::currentView();
         if ($parameters === false) {
             $parameters = array();
         }
         $parameters = array_merge($parameters, $this->OriginalViewParameters);
         $unorderedParameters = $this->OriginalUnorderedParameters;
         $userParameters = $this->UserParameters;
         $Return = $module->run($functionName, $parameters, $unorderedParameters, $userParameters);
         // override default navigation part
         if ($Return['is_default_navigation_part'] === true) {
             if ($this->singleFunction()) {
                 $function = $this->Module["function"];
             } else {
                 $function = $this->Functions[$functionName];
             }
             if (isset($function['default_navigation_part'])) {
                 $Return['navigation_part'] = $function['default_navigation_part'];
             }
         }
         $this->RedirectURI = $module->redirectURI();
         $this->setExitStatus($module->exitStatus());
     }
     return $Return;
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:39,代码来源:ezmodule.php

示例2: dispatchLoop

 /**
  * Runs the dispatch loop
  */
 protected function dispatchLoop()
 {
     $ini = eZINI::instance();
     // Start the module loop
     while ($this->siteBasics['module-run-required']) {
         $objectHasMovedError = false;
         $objectHasMovedURI = false;
         $this->actualRequestedURI = $this->uri->uriString();
         // Extract user specified parameters
         $userParameters = $this->uri->userParameters();
         // Generate a URI which also includes the user parameters
         $this->completeRequestedURI = $this->uri->originalURIString();
         // Check for URL translation
         if ($this->siteBasics['url-translator-allowed'] && eZURLAliasML::urlTranslationEnabledByUri($this->uri)) {
             $translateResult = eZURLAliasML::translate($this->uri);
             if (!is_string($translateResult) && $ini->variable('URLTranslator', 'WildcardTranslation') === 'enabled') {
                 $translateResult = eZURLWildcard::translate($this->uri);
             }
             // Check if the URL has moved
             if (is_string($translateResult)) {
                 $objectHasMovedURI = $translateResult;
                 foreach ($userParameters as $name => $value) {
                     $objectHasMovedURI .= '/(' . $name . ')/' . $value;
                 }
                 $objectHasMovedError = true;
             }
         }
         if ($this->uri->isEmpty()) {
             $tmp_uri = new eZURI($ini->variable("SiteSettings", "IndexPage"));
             $moduleCheck = eZModule::accessAllowed($tmp_uri);
         } else {
             $moduleCheck = eZModule::accessAllowed($this->uri);
         }
         if (!$moduleCheck['result']) {
             if ($ini->variable("SiteSettings", "ErrorHandler") == "defaultpage") {
                 $defaultPage = $ini->variable("SiteSettings", "DefaultPage");
                 $this->uri->setURIString($defaultPage);
                 $moduleCheck['result'] = true;
             }
         }
         $displayMissingModule = false;
         $this->oldURI = $this->uri;
         if ($this->uri->isEmpty()) {
             if (!fetchModule($tmp_uri, $this->check, $this->module, $moduleName, $functionName, $params)) {
                 $displayMissingModule = true;
             }
         } else {
             if (!fetchModule($this->uri, $this->check, $this->module, $moduleName, $functionName, $params)) {
                 if ($ini->variable("SiteSettings", "ErrorHandler") == "defaultpage") {
                     $tmp_uri = new eZURI($ini->variable("SiteSettings", "DefaultPage"));
                     if (!fetchModule($tmp_uri, $this->check, $this->module, $moduleName, $functionName, $params)) {
                         $displayMissingModule = true;
                     }
                 } else {
                     $displayMissingModule = true;
                 }
             }
         }
         if (!$displayMissingModule && $moduleCheck['result'] && $this->module instanceof eZModule) {
             // Run the module/function
             eZDebug::addTimingPoint("Module start '" . $this->module->attribute('name') . "'");
             $moduleAccessAllowed = true;
             $omitPolicyCheck = true;
             $runModuleView = true;
             $availableViewsInModule = $this->module->attribute('views');
             if (!isset($availableViewsInModule[$functionName]) && !$objectHasMovedError && !isset($this->module->Module['function']['script'])) {
                 $moduleResult = $this->module->handleError(eZError::KERNEL_MODULE_VIEW_NOT_FOUND, 'kernel', array("check" => $moduleCheck));
                 $runModuleView = false;
                 $this->siteBasics['policy-check-required'] = false;
                 $omitPolicyCheck = true;
             }
             if ($this->siteBasics['policy-check-required']) {
                 $omitPolicyCheck = false;
                 $moduleName = $this->module->attribute('name');
                 if (in_array($moduleName, $this->siteBasics['policy-check-omit-list'])) {
                     $omitPolicyCheck = true;
                 } else {
                     $policyCheckViewMap = $this->getPolicyCheckViewMap($this->siteBasics['policy-check-omit-list']);
                     if (isset($policyCheckViewMap[$moduleName][$functionName])) {
                         $omitPolicyCheck = true;
                     }
                 }
             }
             if (!$omitPolicyCheck) {
                 $currentUser = eZUser::currentUser();
                 $siteAccessResult = $currentUser->hasAccessTo('user', 'login');
                 $hasAccessToSite = false;
                 if ($siteAccessResult['accessWord'] === 'limited') {
                     $policyChecked = false;
                     foreach (array_keys($siteAccessResult['policies']) as $key) {
                         $policy = $siteAccessResult['policies'][$key];
                         if (isset($policy['SiteAccess'])) {
                             $policyChecked = true;
                             $crc32AccessName = eZSys::ezcrc32($this->access['name']);
                             eZDebugSetting::writeDebug('kernel-siteaccess', $policy['SiteAccess'], $crc32AccessName);
                             if (in_array($crc32AccessName, $policy['SiteAccess'])) {
                                 $hasAccessToSite = true;
//.........这里部分代码省略.........
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:101,代码来源:ezpkernelweb.php


注:本文中的eZModule::run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。