Ejemplo n.º 1
0
 public function preDispatch()
 {
     parent::postDispatch();
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         echo "não tem acesso";
         $this->redirect('/auth');
     }
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function postDispatch()
 {
     parent::postDispatch();
     // Render view if it was not rendered before
     if (!$this->view->isRendered()) {
         $actionName = $this->getRequest()->getActionName();
         $this->render($actionName);
     }
 }
 /**
  * post dispatch method
  *
  * @author          Eddie Jaoude
  * @param           void
  * @return           void
  *
  */
 public function postDispatch()
 {
     parent::postDispatch();
     if (empty($this->view->alert)) {
         $this->view->alert = $this->_flashMessenger->getMessages();
     } else {
         if (!is_array($this->view->alert)) {
             throw new Exception('Alert string $this->view->alert must be an array');
         }
     }
 }
Ejemplo n.º 4
0
 /**
  * Reescreve o método postDispatch() que é responsável 
  * por executar uma ação após a execução de um método
  * @access public
  * @param void
  * @return void
  */
 public function postDispatch()
 {
     if ($this->_msg->hasMessages()) {
         $this->view->message = implode("<br />", $this->_msg->getMessages());
     }
     if ($this->_type->hasMessages()) {
         $this->view->message_type = implode("<br />", $this->_type->getMessages());
     }
     parent::postDispatch();
     // chama o método pai
 }
Ejemplo n.º 5
0
 public function preDispatch()
 {
     parent::postDispatch();
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         session_start();
         $_SESSION['acess'] = '0';
     } else {
         $_SESSION['acess'] = '1';
     }
 }
Ejemplo n.º 6
0
 /**
  * Post-dispatch routines
  * Asignar variables de entorno
  *
  * @return void
  */
 public function postDispatch()
 {
     parent::postDispatch();
     $this->view->messages = $this->_helper->flashMessenger->getMessages();
     $this->view->yosonVars = $this->_yosonVars;
     //        if (APPLICATION_ENV != 'production') {
     //            $sep = sprintf('[%s]', strtoupper(substr(APPLICATION_ENV, 0, 3)));
     //            $titleStack = $this->view->headTitle()->getContainer()->getValue();
     //            if (!is_array($titleStack) || (is_array($titleStack) && isset($titleStack[0]) && $titleStack[0] != $sep) ){
     //                $this->view->headTitle()->prepend($sep);
     //            }
     //        }
 }
Ejemplo n.º 7
0
 /**
  * Erstellt die komplette Ausgabe der Actions als JSON
  */
 public function postDispatch()
 {
     switch ($this->responseType) {
         // use zend view
         case self::RESPONSE_TYPE_HTML_VIEW:
             $this->setContentTypeValue('text/html');
             break;
             // return as javascript variable
         // return as javascript variable
         case self::RESPONSE_TYPE_JS_VAR:
             $responseString = sprintf("var %s = %s;", isset($this->responseTypeParams['name']) ? $this->responseTypeParams['name'] : 'CMSDATA', \Zend_Json::encode($this->responseData));
             $this->buildResponse($responseString, 'application/javascript; charset=utf-8');
             break;
             // return as json
         // return as json
         case self::RESPONSE_TYPE_JSON:
         default:
             $json = \Zend_Json::encode($this->responseData);
             $this->buildResponse($json, $this->contentTypeValue);
             break;
     }
     parent::postDispatch();
 }
Ejemplo n.º 8
0
 public function postDispatch()
 {
     if (!$this->getLayout()->isLoaded() and $this->getRequest()->isDispatched()) {
         $this->_forward('noroute');
     }
     parent::postDispatch();
 }
Ejemplo n.º 9
0
 /**
  * Post-dispatch routines.
  *
  * Common usages for postDispatch() include rendering content in a site wide
  * template, link url correction, setting headers, etc.
  */
 public function postDispatch()
 {
     parent::postDispatch();
     $this->view->addHelperPath(BASE_PATH . '/core/views/helpers', 'Zend_View_Helper_');
 }
Ejemplo n.º 10
0
 /**
  * Setzt alle Daten des Layouts der Session
  */
 public function postDispatch()
 {
     parent::postDispatch();
     $this->view->messages = $this->_helper->FlashMessenger->getMessages();
 }
Ejemplo n.º 11
0
 /**
  * Post-dispatch routines
  * Asignar variables de entorno
  *
  * @return void
  */
 public function postDispatch()
 {
     parent::postDispatch();
     //$this->view->messages = $this->_helper->flashMessenger->getMessages();
     $this->view->yosonVars = $this->_yosonVars;
 }
Ejemplo n.º 12
0
 public function postDispatch()
 {
     parent::postDispatch();
     Centurion_Signal::factory('post_dispatch')->send($this);
 }
Ejemplo n.º 13
0
 /**
  * 	postDispatch
  *
  *	executes once a controller action has completed, prior to the view
  *	renderer displaying the view.
  */
 public function postDispatch()
 {
     $this->setMessages();
     parent::postDispatch();
     $this->_flashMessenger->addMessage("");
 }
Ejemplo n.º 14
0
 /**
  * postDispatch
  * @author Thomas Schedler <*****@*****.**>
  * @version 1.0
  */
 public function postDispatch()
 {
     if ($this->blnPostDispatch == true) {
         // trigger client specific dispatch helper
         if ($this->core->sysConfig->helpers->client->dispatcher === 'enabled') {
             ClientHelper::get('Dispatcher')->postDispatch($this);
         }
         if (function_exists('tidy_parse_string') && $this->blnCachingOutput == false && $this->getResponse()->getBody() != '') {
             /**
              * Tidy is a binding for the Tidy HTML clean and repair utility which allows 
              * you to not only clean and otherwise manipulate HTML documents, 
              * but also traverse the document tree. 
              */
             $arrConfig = array('indent' => TRUE, 'output-xhtml' => TRUE, 'wrap' => 200);
             $objTidy = tidy_parse_string($this->getResponse()->getBody(), $arrConfig, $this->core->sysConfig->encoding->db);
             $objTidy->cleanRepair();
             $this->getResponse()->setBody($objTidy);
         }
         if (isset($this->objCache) && $this->objCache instanceof Zend_Cache_Frontend_Output) {
             if ($this->blnCachingStart === true) {
                 $response = $this->getResponse()->getBody();
                 $this->getResponse()->setBody(str_replace("<head>", "<head>\r\n      <!-- This is a ZOOLU cached page (" . date('d.m.Y H:i:s') . ") -->", $response));
                 $this->getResponse()->outputBody();
                 $arrTags = array();
                 if ($this->objPage->getIsStartElement(false) == true) {
                     $arrTags[] = 'Start' . ucfirst($this->objPage->getType());
                 }
                 $arrTags[] = ucfirst($this->objPage->getType()) . 'Type_' . $this->objPage->getTypeId();
                 $arrTags[] = ucfirst($this->objPage->getType()) . 'Id_' . $this->objPage->getPageId() . '_' . $this->objPage->getLanguageId();
                 $this->core->logger->debug(var_export($arrTags, true));
                 $this->objCache->end($arrTags);
                 $this->core->logger->debug('... end caching!');
                 exit;
             }
         }
         parent::postDispatch();
     }
 }
Ejemplo n.º 15
0
 public function addAction()
 {
     parent::postDispatch();
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         $this->redirect('/auth');
     }
     $adapter = new Zend_File_Transfer_Adapter_Http();
     $dbTable = new Application_Model_DbTable_Block();
     $lastText = $dbTable->getTextById($_GET['id']);
     $this->view->block = $lastText;
 }
Ejemplo n.º 16
0
 function postDispatch()
 {
     parent::postDispatch();
     $js = $this->view->render('partials/notifications.phtml');
     #d($js);
     if ($js) {
         $this->addPageResource(array('jquery.notifications', 'inline' => $js), 'HeadScript');
         $this->addPageResource(array('jquery.notifications'), 'HeadLink');
         #$this->view->pageHeadScript[] = array('jquery.notifications', 'inline' => $js); // for HeadScript view helper
         #$this->view->pageHeadLink[] = array('jquery.notifications'); // for HeadLink view helper
     }
 }
Ejemplo n.º 17
0
 public function postDispatch()
 {
     parent::postDispatch();
     // if(APPLICATION_ENV=="development")
     //   $this->view->headTitle(" Layout --> ".$this->view->layout()->getLayout()." <-- Layout ");
 }
Ejemplo n.º 18
0
 public function postDispatch()
 {
     $db = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('multidb')->getDb('log');
     $data = array();
     $registry = Zend_Registry::getInstance();
     //jeśli separacja danych do kilku tabel
     if ($registry->isRegistered('log_number')) {
         $number = $registry->get('log_number');
         $i = 0;
         while ($i < $number) {
             if ($registry->isRegistered('log_data' . $i)) {
                 $data = $registry->get('log_data' . $i);
             }
             $cm = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('logger');
             foreach ($data as $log) {
                 if (!(isset($log['columns_changed']) && $log['columns_changed'])) {
                     $write = new Zend_Log_Writer_Db($db, 'log.application', $cm->getColumnMapping());
                     $cm->setWriter($write);
                 }
                 if (isset($log['internal']['logger']) && isset($log['internal']['logger']['writer'])) {
                     if (!isset($log['columns'])) {
                         $log['columns'] = array();
                     }
                     if (is_array($log['internal']['logger']['writer'])) {
                         $write = array();
                         foreach ($log['internal']['logger']['writer'] as $key => $writer) {
                             $write[$key] = new Zend_Log_Writer_Db($db, 'log.' . $writer, $log['columns']);
                         }
                         $cm->addWriter($write);
                     } else {
                         $write = new Zend_Log_Writer_Db($db, 'log.' . $log['internal']['logger']['writer'], $log['columns']);
                         $cm->addWriter($write);
                     }
                 }
                 $logger = $cm->getLogObject();
                 foreach ($log['logger']['setEventItem'] as $eventItem => $eventValue) {
                     $logger->setEventItem($eventItem, $eventValue);
                 }
                 if (isset($log['internal']['logger']['changes']) && $log['internal']['logger']['changes'] == false || (!isset($log['internal']['logger']['changes']) || $log['internal']['logger']['changes'] != false) && $log['changed']) {
                     $logger->log($log['message'], Zend_Log::INFO);
                 }
             }
             $registry->offsetUnset('log_data' . $i);
             $i++;
         }
         $registry->offsetUnset('log_number');
         // Jesli jest tylko jeden writer i nie ma separacji
     } else {
         if (Zend_Registry::isRegistered('log_data')) {
             $data = Zend_Registry::get('log_data');
         }
         $cm = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('logger');
         foreach ($data as $log) {
             if (!(isset($log['columns_changed']) && $log['columns_changed'])) {
                 $write = new Zend_Log_Writer_Db($db, 'log.application', $cm->getColumnMapping());
                 $cm->setWriter($write);
             }
             if (isset($log['internal']['logger']) && isset($log['internal']['logger']['writer'])) {
                 if (!isset($log['columns'])) {
                     $log['columns'] = array();
                 }
                 $write = new Zend_Log_Writer_Db($db, 'log.' . $log['internal']['logger']['writer'], $log['columns']);
                 $cm->addWriter($write);
             }
             $logger = $cm->getLogObject();
             foreach ($log['logger']['setEventItem'] as $eventItem => $eventValue) {
                 $logger->setEventItem($eventItem, $eventValue);
             }
             if (isset($log['internal']['logger']['changes']) && $log['internal']['logger']['changes'] == false || (!isset($log['internal']['logger']['changes']) || $log['internal']['logger']['changes'] != false) && $log['changed']) {
                 $logger->log($log['message'], Zend_Log::INFO);
             }
         }
         Zend_Registry::set('log_data', array());
     }
     parent::postDispatch();
 }
Ejemplo n.º 19
0
 /**
  * (non-PHPdoc)
  * @see Zend_Controller_Action::postDispatch()
  */
 public function postDispatch()
 {
     parent::postDispatch();
     $this->getResponse()->setHeader("Cache-Control", "no-cache, must-revalidate");
     $this->view->baseUrl = $this->baseUrl;
     $this->view->actionName = $this->getRequest()->getActionName();
     $this->view->controllerName = $this->getRequest()->getControllerName();
 }
Ejemplo n.º 20
0
 /**
  * postDispatch
  * @author Thomas Schedler <*****@*****.**>
  * @version 1.0
  */
 public function postDispatch()
 {
     if (isset($this->objCache) && $this->objCache instanceof Zend_Cache_Frontend_Output) {
         if ($this->blnCachingStart === true) {
             $response = $this->getResponse()->getBody();
             $this->getResponse()->setBody(str_replace("<head>", "<head>\r\n  <!-- This is a ZOOLU cached page (" . date('d.m.Y H:i:s') . ") -->", $response));
             $this->getResponse()->outputBody();
             $arrTags = array();
             if ($this->objPage->getIsStartElement(false) == true) {
                 $arrTags[] = 'StartPage';
             }
             $arrTags[] = 'PageType' . $this->objPage->getPageTypeId();
             $this->core->logger->debug($arrTags);
             $this->objCache->end($arrTags);
             exit;
         }
     }
     parent::postDispatch();
 }
Ejemplo n.º 21
0
 /**
  * (non-PHPdoc)
  * @see Zend_Controller_Action::postDispatch()
  */
 public function postDispatch()
 {
     // 设置返回格式
     $format = $this->_request->getParam('responseformat');
     $format = $format ? $format : OpenApi_Response_Response::FORMAT_JSON;
     if ($this->view instanceof OpenApi_Response_Response) {
         $this->view->setResponseFormat($format);
         $contentType = $this->view->getContentType();
         $this->_response->setHeader('Content-Type', $contentType);
     }
     $this->view->category = $this->_request->getControllerName();
     $this->view->action = array_shift(explode('.', $this->_request->getActionName()));
     parent::postDispatch();
 }
 /**
  * initiates after any action is dispatched
  *
  * @param	void
  * @return	void
  */
 public function postDispatch()
 {
     parent::postDispatch();
 }
 /**
  * Registers calls to postDispatch().
  */
 public function postDispatch()
 {
     parent::postDispatch();
     $this->registerCall(__FUNCTION__);
 }