コード例 #1
0
 public function buildAdminNav()
 {
     if ($this->_nav !== null) {
         return $this->_nav;
     }
     $adminNavResult = Zym_Message_Dispatcher::get()->post('buildAdminNav')->getResult('buildAdminNav');
     $navigation = new Zend_Navigation();
     $missionControlModules = array('missionControl', 'dashboard', 'admin', 'settings', 'system', 'tools');
     $updateService = new FFR_Service_Update();
     if ($updateService->currentSchemaVersion('missionControl') >= 2) {
         $settingService = new Settings_Service_Setting();
         $missionControl = $settingService->fetchSetting('mission_control')->setting_value;
     } else {
         $missionControl = false;
     }
     if ($missionControl == true) {
         foreach ($adminNavResult as $modulePages) {
             if (in_array($modulePages[0]->getModule(), $missionControlModules)) {
                 $navigation->addPages($modulePages);
             }
         }
     } else {
         foreach ($adminNavResult as $modulePages) {
             $navigation->addPages($modulePages);
         }
     }
     $this->_nav = $navigation;
     return $this->_nav;
 }
コード例 #2
0
 public function indexAction()
 {
     $this->view->formGateway = new Forms_Model_FormGateway();
     $this->view->formList = Zend_Paginator::factory($this->view->formGateway->fetchForms());
     $settingService = new Settings_Service_Setting();
     $this->view->formList->setItemCountPerPage($settingService->fetchScreenSetting('forms_per_page')->screen_setting_value);
     $this->view->formList->setCurrentPageNumber($this->_getParam('page'));
 }
コード例 #3
0
 public function indexAction()
 {
     $this->view->layoutGateway = new Layouts_Model_LayoutGateway();
     $this->view->layouts = Zend_Paginator::factory($this->view->layoutGateway->fetchLayouts('layouts', true));
     $settingService = new Settings_Service_Setting();
     $this->view->layouts->setItemCountPerPage($settingService->fetchScreenSetting('layouts_per_page')->screen_setting_value);
     $this->view->layouts->setCurrentPageNumber($this->_getParam('page'));
 }
コード例 #4
0
 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $updateService = new FFR_Service_Update();
     if ($updateService->currentSchemaVersion('missionControl') < 2) {
         return;
     }
     $settingService = new Settings_Service_Setting();
     $missionControl = $settingService->fetchSetting('mission_control')->setting_value;
     if ($missionControl == true) {
     }
     return;
 }
コード例 #5
0
 public function preDispatch()
 {
     // Make sure all requests don't end with a /
     $uri = $this->_request->getRequestUri();
     if ($uri != '/' && substr($uri, -1) === '/') {
         $this->_redirect(rtrim($this->_request->getRequestUri(), '/'));
         exit;
     }
     /**
      * Make sure all requests are routed to the right hostname
      * @todo Add ability to handle HTTPS requests
      */
     $settingsService = new Settings_Service_Setting();
     $this->_siteUrl = $settingsService->fetchSetting('site_url');
     if ('http://' . $_SERVER['HTTP_HOST'] != $this->_siteUrl) {
         $this->_redirect($this->_siteUrl . $this->_request->getRequestUri());
         exit;
     }
     if (!$this->_helper->acl('Public')) {
         throw new FFR_Acl_Exception('Access Denied');
     }
 }