本文整理汇总了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);
}
示例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);
}
示例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);
}
示例4: __construct
public function __construct()
{
$this->initialize();
if (Manager::hasNextPathItem()) {
$this->sFilePath = Manager::peekNextPathItem();
}
}