Beispiel #1
0
 /**
  * @param \Zend\Mvc\MvcEvent $event
  * @return void
  */
 public function preDispatch(MvcEvent $event)
 {
     parent::preDispatch($event);
     $this->translator->addTranslationFilePattern('gettext', __DIR__ . '/../../../language', 'note-%s.mo');
     $this->getServiceLocator()->get('viewhelpermanager')->get('headScript')->prependFile($this->getRequest()->getBaseUrl() . '/js/note.js', 'text/javascript')->prependFile($this->getRequest()->getBaseUrl() . '/js/vendor/epiceditor/js/epiceditor.min.js', 'text/javascript');
     $userKeyCheck = $this->identity->getKey();
     if (empty($userKeyCheck)) {
         return $this->redirect()->toRoute('secretary/default', array('controller' => 'key'));
     }
 }
Beispiel #2
0
 /**
  * @param \Zend\Mvc\MvcEvent $event
  * @return void
  */
 public function preDispatch(MvcEvent $event)
 {
     parent::preDispatch($event);
     $action = $event->getRouteMatch()->getParam('action');
     if ($action != 'index' && $action != 'add') {
         $this->groupId = $event->getRouteMatch()->getParam('id');
         if (empty($this->groupId) || !is_numeric($this->groupId)) {
             return $this->redirect()->toRoute('secretary/group');
         }
         $this->groupRecord = $this->groupService->fetchGroup($this->groupId);
         if (empty($this->groupRecord)) {
             return $this->redirect()->toRoute('secretary/group');
         }
     }
     if ($action == 'index' || $action == 'members' || $action == 'edit') {
         $this->msg = false;
         $messages = $this->flashMessenger()->getCurrentErrorMessages();
         if (!empty($messages)) {
             $this->msg = array('error', $messages[0]);
         } else {
             $messages = $this->flashMessenger()->getCurrentSuccessMessages();
             $this->msg = false;
             if (!empty($messages)) {
                 $this->msg = array('success', $messages[0]);
             }
         }
         $this->flashMessenger()->clearMessages();
     }
     $this->translator->addTranslationFilePattern('gettext', __DIR__ . '/../../../language', 'group-%s.mo');
 }
Beispiel #3
0
 /**
  * @param \Zend\Mvc\MvcEvent $event
  * @return void
  */
 public function preDispatch(MvcEvent $event)
 {
     parent::preDispatch($event);
     $this->translator->addTranslationFilePattern('gettext', __DIR__ . '/../../../language', 'user-%s.mo');
 }