Exemple #1
0
 public function getPageMenu(\AbstractView $view, Model_Page $page)
 {
     if ($view->template->hasTag('SubMenu') && ($siblings = $page->getSiblings())) {
         $menu = $view->add('Menu_Vertical', null, 'SubMenu');
         foreach ($siblings as $page) {
             $page->page_translation = $page->getTranslation(true);
             $url = $page['hash_url'] ?: $page['url_first_child'];
             $this->app->addMenuItem($menu, $page->page_translation['meta_title'], 'home-1', 'atk-swatch-beigeDarken', $url);
         }
     }
 }
Exemple #2
0
 private function showLangButtons(\AbstractView $view)
 {
     $langs = $this->app->getConfig('atk4-home-page/available_languages');
     $button_set = $view->add('ButtonSet')->addClass('atk-box-small');
     foreach ($langs as $key => $lang) {
         $button = $button_set->addButton($key);
         if ($key == $this->app->getCurrentLanguage()) {
             $button->setAttr('disabled', 'disabled')->addClass('atk-swatch-gray');
         }
         $button->js('click')->univ()->ajaxec($this->app->url(null, ['language' => $key]));
     }
 }
Exemple #3
0
 protected function _getBlock(Model_Block $model, \AbstractView $v, $app_type = 'frontend')
 {
     if (Config::getInstance($this->app)->isFrontendEditingMode() && $_GET['edit'] == 1) {
         $this->app->stickyGet('edit');
         $this->app->stickyGet('access_code');
         $app_type = 'admin';
     }
     if ($app_type == 'admin') {
         $view = $v->add('atk4\\atk4homepage\\View_DynamicBlock', ['app_type' => $app_type]);
     } else {
         $view = $this->add('atk4\\atk4homepage\\View_DynamicBlock', ['template_path' => $this->app->getConfig('atk4-home-page/block_types/' . $model['type'] . '/template')], $model['system_name']);
     }
     $view->setModel($model);
     $view->get();
 }