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()); }