public static function getNewsPage()
 {
     $currentSection = Section::getCurrentSection();
     if ($currentSection) {
         $localeID = $currentSection->getCollectionID();
     } else {
         return false;
     }
     return self::getChildPage($localeID, "news");
 }
 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;
 }
Example #3
0
 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);
 }
Example #4
0
 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);
                 }
             }
         }
     }
 }
                                            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());