protected function saveSiteFunction() { $form = Form::load('pilot.views.SiteFunctionMain'); $site_function = new SiteFunction(); if ($site_function_id = Application::param('site_function_id')) { $site_function->clauseSafe('site_function_id', $site_function_id); } $this->saveObject($form, $site_function, $this->siteFunctionTitle()); SiteNavigation::init(Application::current()->user()->getHandlerTree()); if (!Application::current()->user()->authorise($this->getClass())) { throw new AccessDeniedException('You cannot access this function'); } }
/** * Return the current SiteNavigation object for this site * @param supress_error - default 'false', set true if no error * should be generated if a SiteNavigation * object cannot be found * @access public * @throws Exception - in the case that no site navigation is registered */ function getSiteNavigation() { if (!($ret = SiteNavigation::current())) { throw new Exception('Unable to find registered SiteNavigation object in getNavigation, display.class.inc'); } return $ret; }
/** * Initialise the {@link SiteNavigation} object * * The {@link SiteNavigation} object implements a Singleton pattern, and controls * the access to navigation items, as well as the process of printing them to the * output. * @param force_reload - reload the navigation item even if one is already registered */ public function siteNavigationInit($force_reload = false) { if (!SiteNavigation::ready() || $force_reload) { $ret = SiteNavigation::init($this->user->getHandlerTree()); } else { $ret = SiteNavigation::current(); } return $ret; }
public function endImpersonation() { $not_impersonated = Session::getRegistered('not_impersonated_user'); Application::setUser($not_impersonated); SiteNavigation::init($not_impersonated->getHandlerTree()); Session::unRegister('not_impersonated_user'); }