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


PHP Manager::hasNextPathItem方法代码示例

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


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

示例1: renderFile

 public function renderFile()
 {
     //Send Content-Type
     $sCharset = Settings::getSetting('encoding', 'browser', 'utf-8');
     if ($this->sType === ResourceIncluder::RESOURCE_TYPE_CSS) {
         header("Content-Type: text/css;charset={$sCharset}");
     } else {
         if ($this->sType === ResourceIncluder::RESOURCE_TYPE_JS) {
             header("Content-Type: text/javascript;charset={$sCharset}");
         }
     }
     //Find consolidated resources
     $aKeys = array();
     while (Manager::hasNextPathItem()) {
         $aKeys[] = Manager::usePath();
     }
     $sKey = 'consolidated-output-' . $this->sType . '-' . implode('|', $aKeys);
     $oCachingStrategy = clone CachingStrategy::fromConfig('file');
     $oCache = new Cache($sKey, 'resource', $oCachingStrategy);
     $oItemCachingStrategy = clone $oCachingStrategy;
     $oItemCachingStrategy->init(array('key_encode' => null));
     $oCache->sendCacheControlHeaders();
     if (!$oCache->entryExists(false)) {
         foreach ($aKeys as $sItemKey) {
             $oItemCache = new Cache($sItemKey, DIRNAME_PRELOAD, $oItemCachingStrategy);
             if (!$oItemCache->entryExists(false)) {
                 throw new Exception("Consolidated resource {$sItemKey} does not exist.");
             }
             $oCache->setContents($oItemCache->getContentsAsString() . "\n", false, true);
         }
     }
     $oCache->sendCacheControlHeaders();
     $oCache->passContents(true);
 }
开发者ID:rapila,项目名称:cms-base,代码行数:34,代码来源:ConsolidatedResourceFileModule.php

示例2: redirectToLanguage

 public static function redirectToLanguage($sLanguageId = null)
 {
     if ($sLanguageId == null) {
         $sLanguageId = Session::language();
     }
     $oLanguage = LanguageQuery::language($sLanguageId)->findOne();
     $sLanguageInPathId = null;
     if (Manager::hasNextPathItem()) {
         $oLanguageInPath = LanguageQuery::language(Manager::peekNextPathItem(), true)->findOne();
         if ($oLanguageInPath && $oLanguageInPath->getIsActive()) {
             Manager::usePath();
             $sLanguageInPathId = $oLanguageInPath->getId();
         }
     }
     $sManager = Manager::getManagerClassNormalized(null);
     if ($sManager::shouldIncludeLanguageInLink()) {
         if ($sLanguageInPathId === $sLanguageId) {
             return;
         }
     } else {
         if ($sLanguageInPathId === null) {
             //Did not include language in link and should not
             return;
         }
     }
     self::redirectToManager(Manager::getRequestPath(), $sManager, array(), $oLanguage);
 }
开发者ID:rapila,项目名称:cms-base,代码行数:27,代码来源:LinkUtil.php

示例3: __construct

 public function __construct()
 {
     try {
         $this->oRootPage = PagePeer::getRootPage();
     } catch (Exception $e) {
         $this->oRootPage = self::initializeRootPage();
     }
     $this->oTreeWidget = new TreeWidgetModule();
     $this->oTreeWidget->setDelegate($this);
     $this->oTreeWidget->setSetting('init_dnd', true);
     $oInitialPage = null;
     if (Manager::hasNextPathItem()) {
         $oInitialPage = PageQuery::create()->findPk(Manager::usePath());
         if ($oInitialPage !== null) {
             Session::getSession()->setAttribute('persistent_page_id', $oInitialPage->getId());
         }
     } else {
         if (Session::getSession()->hasAttribute('persistent_page_id')) {
             $oInitialPage = PageQuery::create()->findPk(Session::getSession()->getAttribute('persistent_page_id'));
         }
     }
     if ($oInitialPage === null) {
         $oInitialPage = $this->oRootPage;
     }
     $this->addResourceParameter(ResourceIncluder::RESOURCE_TYPE_JS, 'tree_session', $this->oTreeWidget->getSessionKey());
     $this->addResourceParameter(ResourceIncluder::RESOURCE_TYPE_JS, 'initial_page_id', $oInitialPage->getId());
     $this->addResourceParameter(ResourceIncluder::RESOURCE_TYPE_JS, 'initial_page_tree_left', $oInitialPage->getTreeLeft());
     $oResourceIncluder = ResourceIncluder::defaultIncluder();
     $oResourceIncluder->addResource('admin/template.css', null, null, array(), ResourceIncluder::PRIORITY_NORMAL, null, true);
 }
开发者ID:rapila,项目名称:cms-base,代码行数:30,代码来源:PagesAdminModule.php

示例4: __construct

 public function __construct()
 {
     $this->initialize();
     if (Manager::hasNextPathItem()) {
         $this->sFilePath = Manager::peekNextPathItem();
     }
 }
开发者ID:rapila,项目名称:plugin-webdav,代码行数:7,代码来源:WebdavBackendModule.php


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