public function before() { $page = strtolower(substr(get_class($this), 11)); Model_Navigation::init(Kohana::$config->load('sitemap')->as_array()); parent::before(); $navigation = Model_Navigation::get(); $this->page = Model_Navigation::$current; if ($this->auto_render !== TRUE) { return; } $this->template->set_global(array('page_body_id' => $this->get_path(), 'page_name' => $page, 'page' => $this->page)); if ($this->request->is_iframe()) { $navigation = NULL; $this->template->footer = NULL; $this->template->breadcrumbs = NULL; Config::set('site', 'profiling', 'no'); $this->query_params = array('type' => 'iframe'); } else { $this->template->breadcrumbs = Config::get('site', 'breadcrumbs') == Config::YES ? $this->breadcrumbs : NULL; $this->template->footer = View::factory('system/blocks/footer'); } $this->template->theme = 'theme-' . Model_User_Meta::get('admin_theme', Config::get('global', 'default_theme')); $this->template->bind_global('navigation', $navigation); Observer::notify('controller_before_' . $this->get_path()); }
public function action_settings() { $this->set_title(__('Settings')); Assets::package('ace'); $site_pages = array(); foreach (Model_Navigation::get()->sections() as $section) { foreach ($section->get_pages() as $item) { $url = trim(str_replace(ADMIN_DIR_NAME, '', $item->url()), '/'); $site_pages[$section->name()][$url] = $item->name(); } } $this->template->content = View::factory('system/settings', array('filters' => Arr::merge(array('--none--'), WYSIWYG::findAll()), 'dates' => Date::formats(), 'site_pages' => $site_pages, 'default_status_id' => array(Model_Page::STATUS_DRAFT => __('Draft'), Model_Page::STATUS_PUBLISHED => __('Published')))); }