本文整理匯總了PHP中Concrete\Core\Multilingual\Page\Section\Section::getCurrentSection方法的典型用法代碼示例。如果您正苦於以下問題:PHP Section::getCurrentSection方法的具體用法?PHP Section::getCurrentSection怎麽用?PHP Section::getCurrentSection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Concrete\Core\Multilingual\Page\Section\Section
的用法示例。
在下文中一共展示了Section::getCurrentSection方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getNewsPage
public static function getNewsPage()
{
$currentSection = Section::getCurrentSection();
if ($currentSection) {
$localeID = $currentSection->getCollectionID();
} else {
return false;
}
return self::getChildPage($localeID, "news");
}
示例2: canAccess
protected function canAccess()
{
$app = \Core::make("app");
$dashboard = $app->make('helper/concrete/dashboard');
if ($app->make('multilingual/detector')->isEnabled() && is_object(Section::getCurrentSection()) && !$dashboard->inDashboard($this->page) && $this->permissions->canEditPageMultilingualSettings()) {
return true;
}
if (!$dashboard->inDashboard($this->page) && count($this->page->getPageRelations()) > 0) {
return true;
}
return false;
}
示例3: view
public function view()
{
$this->requireAsset('core/sitemap');
$mlist = Section::getList();
$ml = array();
$currentSection = Section::getCurrentSection();
foreach ($mlist as $m) {
if ($m->getCollectionID() != $currentSection->getCollectionID()) {
$ml[] = $m;
}
}
$this->set('list', $ml);
$this->set('currentSection', $currentSection);
$this->set('ih', Core::make('multilingual/interface/flag'));
$multilingualController = Core::make('\\Concrete\\Controller\\Backend\\Page\\Multilingual');
$multilingualController->setPageObject($this->page);
$this->set('multilingualController', $multilingualController);
}
示例4: load
protected function load()
{
parent::load();
$this->set('stIDNeutral', null);
$stack = Stack::getByID($this->stID);
if ($stack && $stack->isNeutralStack()) {
$detector = isset($this->app) ? $this->app->make('multilingual/detector') : \Core::make('multilingual/detector');
/* @var \Concrete\Core\Multilingual\Service\Detector $detector */
if ($detector->isEnabled()) {
$section = Section::getCurrentSection();
if ($section) {
$localized = $stack->getLocalizedStack($section);
if ($localized) {
$this->stIDNeutral = $this->stID;
$this->stID = $localized->getCollectionID();
$this->set('stIDNeutral', $this->stIDNeutral);
$this->set('stID', $this->stID);
}
}
}
}
}
示例5: t
title="<?php
echo t('Add Pages and Navigate Your Site');
?>
"
data-launch-panel="sitemap">
<i class="fa fa-files-o"></i>
<span class="ccm-toolbar-accessibility-title ccm-toolbar-accessibility-title-add-page">
<?php
echo tc('toolbar', 'Pages');
?>
</span>
</a>
</li>
<?php
if ($cp->canEditPageMultilingualSettings() && \Core::make('multilingual/detector')->isEnabled()) {
$section = \Concrete\Core\Multilingual\Page\Section\Section::getCurrentSection();
$ch = Core::make('multilingual/interface/flag');
if (is_object($section)) {
?>
<li class="pull-right hidden-xs">
<a href="#" data-panel-url="<?php
echo URL::to('/ccm/system/panels/multilingual');
?>
"
title="<?php
echo t('Navigate this page in other languages');
?>
"
data-launch-panel="multilingual">
<?php
print $ch->getFlagIcon($section->getIcon());