Esempio n. 1
0
 public function postDispatch(Zend_Controller_Request_Abstract $request)
 {
     $this->_view = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('view');
     $response = $this->getResponse();
     $body = $response->getBody();
     $messages = new Agana_View_Helper_FlashMessages();
     $messages = $messages->flashMessages();
     $response->setBody($messages);
     $response->appendBody($body);
     parent::postDispatch($request);
 }
 public function postDispatch(\Zend_Controller_Request_Abstract $request)
 {
     parent::postDispatch($request);
     $layout = \Zend_Layout::getMvcInstance();
     if ($layout && $layout->isEnabled() !== FALSE) {
         \Pimcore::getEventManager()->attach('toolbox.addAsset', function (\Zend_EventManager_Event $e) {
             $assetHandler = $e->getTarget();
             $assetHandler->appendScript('toolbox-wysiwyg', '/plugins/Toolbox/static/js/wysiwyg.js', array(), array('showInFrontEnd' => false));
             $assetHandler->appendScript('toolbox-parallax', '/plugins/Toolbox/static/js/frontend/jquery.parallax-scroll.min.js', array(), array('showInFrontEnd' => true));
             $assetHandler->appendScript('vimeo-api', '/plugins/Toolbox/static/js/frontend/vimeo-api.min.js', array(), array('showInFrontEnd' => true));
             $assetHandler->appendScript('toolbox-frontend', '/plugins/Toolbox/static/js/frontend/toolbox.js', array(), array('showInFrontEnd' => true));
         });
     }
 }
Esempio n. 3
0
 public function postDispatch(Zend_Controller_Request_Abstract $request)
 {
     parent::postDispatch($request);
     if ($this->_active) {
         // get the front controller plugin and the zend error handler
         $front = Zend_Controller_Front::getInstance();
         $error = $front->getPlugin('Daiquiri_Controller_Plugin_ErrorHandler');
         // check if an exception is present
         if (!$error->getResponse()->isException()) {
             // destroy the session
             Zend_Session::destroy();
         }
     }
 }
Esempio n. 4
0
 public function postDispatch(\Zend_Controller_Request_Abstract $request)
 {
     $allowRequestLog = true;
     if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
         if (in_array($_SERVER['HTTP_X_FORWARDED_FOR'], $this->restrictedIP)) {
             $allowRequestLog = false;
         }
     }
     if ($allowRequestLog) {
         parent::postDispatch($request);
         try {
             $cm = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('Requestlogger');
             $logger = $cm->getLogObject();
             $logger->setEventItem('start_at', date("c", $_SERVER['REQUEST_TIME']));
             $logger->setEventItem('end_at', date("c", microtime(true)));
             $logger->setEventItem('execute_time', microtime(true) - $_SERVER['REQUEST_TIME']);
             $logger->log('Zakonczono wykonanie akcji', Zend_Log::INFO);
         } catch (Exception $e) {
             throw $e;
         }
     }
 }
 public function __postDispatch(Zend_Controller_Request_Abstract $request)
 {
     $front = Zend_Controller_Front::getInstance();
     $bootstrap = $front->getParam("bootstrap");
     $moduleName = $request->getModuleName();
     // if the actual module is the default module returns without change
     // the configuration of the layout and view
     //        if ($moduleName == $front->getDefaultModule()) {
     //            return;
     //        }
     $layout = Zend_Layout::getMvcInstance();
     $view = $layout->getView();
     $pathModule = $view->theme_path . '/' . $moduleName;
     $scriptsPath = $view->getScriptPaths();
     $firstPath = array_shift($scriptsPath);
     //        $view->setScriptPath($firstPath);
     //
     //        Zend_Debug::dump($view->getScriptPaths(), 'AFTER');
     //        $q = count($scriptsPath);
     //         for ($i=0;$i<$q;$i++){
     //            $view->addBasePath($scriptsPath[$i]);
     //            Zend_Debug::dump($view->getScriptPaths());
     //        }
     //        $view->addBasePath($pathModule);
     //        $view->setScriptPath($pathModule);
     Zend_Debug::dump($view->getScriptPaths());
     parent::postDispatch($request);
 }