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


PHP eZModule::uiContextName方法代码示例

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


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

示例1: array

    $currentURI = $completeRequestedURI;
    if (strlen($currentURI) > 0 and $currentURI[0] != '/') {
        $currentURI = '/' . $currentURI;
    }
    $lastAccessedURI = "";
    $lastAccessedViewURI = "";
    $http = eZHTTPTool::instance();
    // Fetched stored session variables
    if ($http->hasSessionVariable("LastAccessesURI")) {
        $lastAccessedViewURI = $http->sessionVariable("LastAccessesURI");
    }
    if ($http->hasSessionVariable("LastAccessedModifyingURI")) {
        $lastAccessedURI = $http->sessionVariable("LastAccessedModifyingURI");
    }
    // Update last accessed view page
    if ($currentURI != $lastAccessedViewURI and !in_array($module->uiContextName(), array('edit', 'administration', 'browse', 'authentication'))) {
        $http->setSessionVariable("LastAccessesURI", $currentURI);
    }
    // Update last accessed non-view page
    if ($currentURI != $lastAccessedURI) {
        $http->setSessionVariable("LastAccessedModifyingURI", $currentURI);
    }
}
eZDebug::addTimingPoint("Module end '" . $module->attribute('name') . "'");
if (!is_array($moduleResult)) {
    eZDebug::writeError('Module did not return proper result: ' . $module->attribute('name'), 'index.php');
    $moduleResult = array();
    $moduleResult['content'] = false;
}
if (!isset($moduleResult['ui_context'])) {
    $moduleResult['ui_context'] = $module->uiContextName();
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:index.php

示例2: run

 /**
  * Execution point for controller actions
  */
 public function run()
 {
     ob_start();
     $this->requestInit();
     // send header information
     foreach (eZHTTPHeader::headerOverrideArray($this->uri) + array('Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT', 'Last-Modified' => gmdate('D, d M Y H:i:s') . ' GMT', 'Cache-Control' => 'no-cache, must-revalidate', 'Pragma' => 'no-cache', 'X-Powered-By' => 'eZ Publish', 'Content-Type' => 'text/html; charset=' . $this->httpCharset, 'Served-by' => $_SERVER["SERVER_NAME"], 'Content-language' => $this->languageCode) as $key => $value) {
         header($key . ': ' . $value);
     }
     try {
         $moduleResult = $this->dispatchLoop();
     } catch (Exception $e) {
         $this->shutdown();
         throw $e;
     }
     $ini = eZINI::instance();
     /**
      * Ouput an is_logged_in cookie when users are logged in for use by http cache solutions.
      *
      * @deprecated As of 4.5, since 4.4 added lazy session support (init on use)
      */
     if ($ini->variable("SiteAccessSettings", "CheckValidity") !== 'true') {
         $currentUser = eZUser::currentUser();
         $wwwDir = eZSys::wwwDir();
         // On host based site accesses this can be empty, causing the cookie to be set for the current dir,
         // but we want it to be set for the whole eZ publish site
         $cookiePath = $wwwDir != '' ? $wwwDir : '/';
         if ($currentUser->isLoggedIn()) {
             // Only set the cookie if it doesnt exist. This way we are not constantly sending the set request in the headers.
             if (!isset($_COOKIE['is_logged_in']) || $_COOKIE['is_logged_in'] !== 'true') {
                 setcookie('is_logged_in', 'true', 0, $cookiePath);
             }
         } else {
             if (isset($_COOKIE['is_logged_in'])) {
                 setcookie('is_logged_in', false, 0, $cookiePath);
             }
         }
     }
     if ($this->module->exitStatus() == eZModule::STATUS_REDIRECT) {
         $this->redirect();
     }
     // Store the last URI for access history for login redirection
     // Only if user has session and only if there was no error or no redirects happen
     if (eZSession::hasStarted() && $this->module->exitStatus() == eZModule::STATUS_OK) {
         $currentURI = $this->completeRequestedURI;
         if (strlen($currentURI) > 0 && $currentURI[0] !== '/') {
             $currentURI = '/' . $currentURI;
         }
         $lastAccessedURI = "";
         $lastAccessedViewURI = "";
         $http = eZHTTPTool::instance();
         // Fetched stored session variables
         if ($http->hasSessionVariable("LastAccessesURI")) {
             $lastAccessedViewURI = $http->sessionVariable("LastAccessesURI");
         }
         if ($http->hasSessionVariable("LastAccessedModifyingURI")) {
             $lastAccessedURI = $http->sessionVariable("LastAccessedModifyingURI");
         }
         // Update last accessed view page
         if ($currentURI != $lastAccessedViewURI && !in_array($this->module->uiContextName(), array('edit', 'administration', 'browse', 'authentication'))) {
             $http->setSessionVariable("LastAccessesURI", $currentURI);
         }
         // Update last accessed non-view page
         if ($currentURI != $lastAccessedURI) {
             $http->setSessionVariable("LastAccessedModifyingURI", $currentURI);
         }
     }
     eZDebug::addTimingPoint("Module end '" . $this->module->attribute('name') . "'");
     if (!is_array($moduleResult)) {
         eZDebug::writeError('Module did not return proper result: ' . $this->module->attribute('name'), 'index.php');
         $moduleResult = array();
         $moduleResult['content'] = false;
     }
     if (!isset($moduleResult['ui_context'])) {
         $moduleResult['ui_context'] = $this->module->uiContextName();
     }
     $moduleResult['ui_component'] = $this->module->uiComponentName();
     $moduleResult['is_mobile_device'] = $this->mobileDeviceDetect->isMobileDevice();
     $moduleResult['mobile_device_alias'] = $this->mobileDeviceDetect->getUserAgentAlias();
     $templateResult = null;
     eZDebug::setUseExternalCSS($this->siteBasics['external-css']);
     if ($this->siteBasics['show-page-layout']) {
         $tpl = eZTemplate::factory();
         if ($tpl->hasVariable('node')) {
             $tpl->unsetVariable('node');
         }
         if (!isset($moduleResult['path'])) {
             $moduleResult['path'] = false;
         }
         $moduleResult['uri'] = eZSys::requestURI();
         $tpl->setVariable("module_result", $moduleResult);
         $meta = $ini->variable('SiteSettings', 'MetaDataArray');
         if (!isset($meta['description'])) {
             $metaDescription = "";
             if (isset($moduleResult['path']) && is_array($moduleResult['path'])) {
                 foreach ($moduleResult['path'] as $pathPart) {
                     if (isset($pathPart['text'])) {
                         $metaDescription .= $pathPart['text'] . " ";
//.........这里部分代码省略.........
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:101,代码来源:ezpkernelweb.php

示例3: array

    $http = eZHTTPTool::instance();

    // Fetched stored session variables
    if ( $http->hasSessionVariable( "LastAccessesURI" ) )
    {
        $lastAccessedViewURI = $http->sessionVariable( "LastAccessesURI" );
    }
    if ( $http->hasSessionVariable( "LastAccessedModifyingURI" ) )
    {
        $lastAccessedURI = $http->sessionVariable( "LastAccessedModifyingURI" );
    }

    // Update last accessed view page
    if ( $currentURI != $lastAccessedViewURI and
         !in_array( $module->uiContextName(), array( 'edit', 'administration', 'browse', 'authentication' ) ) )
    {
        $http->setSessionVariable( "LastAccessesURI", $currentURI );
    }

    // Update last accessed non-view page
    if ( $currentURI != $lastAccessedURI )
    {
        $http->setSessionVariable( "LastAccessedModifyingURI", $currentURI );
    }
}


eZDebug::addTimingPoint( "Module end '" . $module->attribute( 'name' ) . "'" );
if ( !is_array( $moduleResult ) )
{
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:30,代码来源:index.php


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