Overview

Namespaces

  • None
  • PHP

Classes

  • Eabi_DpdEE_Block_Adminhtml_Config_Form_Field_Country
  • Eabi_DpdEE_Block_Info_Payment
  • Eabi_DpdEE_Block_Invoice
  • Eabi_DpdEE_Block_Order_Courier
  • Eabi_DpdEE_Helper_Data
  • Eabi_DpdEE_Model_Api
  • Eabi_DpdEE_Model_Button_Courier
  • Eabi_DpdEE_Model_Config
  • Eabi_DpdEE_Model_Flat
  • Eabi_DpdEE_Model_Observer
  • Eabi_DpdEE_Model_Payment_Processor
  • Eabi_DpdEE_Model_Post
  • Eabi_DpdEE_Model_Source_Label_Position
  • Eabi_DpdEE_Model_Source_Service
  • Eabi_Livehandler_Adminhtml_LivehandlerController
  • Eabi_Livehandler_Adminhtml_RemoveController
  • Eabi_Livehandler_Block_Adminhtml_Config_Form_Field_Button
  • Eabi_Livehandler_Block_Adminhtml_Config_Form_Field_Remove
  • Eabi_Livehandler_Block_Email
  • Eabi_LiveHandler_Block_Footer
  • Eabi_Livehandler_Helper_Data
  • Eabi_Livehandler_Helper_Keypair
  • Eabi_Livehandler_IndexController
  • Eabi_Livehandler_Model_Abstract
  • Eabi_Livehandler_Model_Action_Abstract
  • Eabi_Livehandler_Model_Action_Postoffice_Print
  • Eabi_Livehandler_Model_Action_Postoffice_Send
  • Eabi_Livehandler_Model_Adminhtml_Gridmanager
  • Eabi_Livehandler_Model_Directory_Collection
  • Eabi_Livehandler_Model_Entry
  • Eabi_Livehandler_Model_File_Object
  • Eabi_Livehandler_Model_Mysql4_Entry
  • Eabi_Livehandler_Model_Mysql4_Entry_Collection
  • Eabi_Livehandler_Model_Ordergrid
  • Eabi_Livehandler_Model_System_Config_Backend_Button
  • Eabi_Postoffice_Adminhtml_PostofficeController
  • Eabi_Postoffice_Block_Adminhtml_Config_Form_Field_License
  • Eabi_Postoffice_Block_Adminhtml_Config_Form_Field_Remove
  • Eabi_Postoffice_Block_Config_Rebuildbutton
  • Eabi_Postoffice_Helper_Countrycode
  • Eabi_Postoffice_Helper_Data
  • Eabi_Postoffice_IndexController
  • Eabi_Postoffice_Model_Carrier_Abstract
  • Eabi_Postoffice_Model_Carrier_Result
  • Eabi_Postoffice_Model_Carriermodule
  • Eabi_Postoffice_Model_Mysql4_Carriermodule
  • Eabi_Postoffice_Model_Mysql4_Carriermodule_Collection
  • Eabi_Postoffice_Model_Mysql4_Office
  • Eabi_Postoffice_Model_Mysql4_Office_Collection
  • Eabi_Postoffice_Model_Observer
  • Eabi_Postoffice_Model_Office
  • Eabi_Postoffice_Model_Orderview
  • Eabi_Postoffice_Model_Source_Sendevent
  • Eabi_Postoffice_Model_Updater
  • Overview
  • Namespace
  • Class
  • Tree
  1: <?php
  2: /*
  3: 
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * or OpenGPL v3 license (GNU Public License V3.0)
  9:  * that is bundled with this package in the file LICENSE.txt.
 10:  * It is also available through the world-wide-web at this URL:
 11:  * http://opensource.org/licenses/osl-3.0.php
 12:  * or
 13:  * http://www.gnu.org/licenses/gpl-3.0.txt
 14:  * If you did not receive a copy of the license and are unable to
 15:  * obtain it through the world-wide-web, please send an email
 16:  * to info@e-abi.ee so we can send you a copy immediately.
 17:  *
 18:  * DISCLAIMER
 19:  *
 20:  * Do not edit or add to this file if you wish to upgrade this module to newer
 21:  * versions in the future.
 22:  *
 23:  * @category   Eabi
 24:  * @package    Eabi_Dpd
 25:  * @copyright  Copyright (c) 2014 Aktsiamaailm LLC (http://en.e-abi.ee/)
 26:  * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 27:  * @license    http://www.gnu.org/licenses/gpl-3.0.txt  GNU Public License V3.0
 28:  * @author     Matis Halmann
 29:  * 
 30:  
 31:  */
 32: 
 33: /**
 34:  * <p>Writes javascript before_body_end when request_var from eabi_livehandler table matches Magentos request full name.</p>
 35:  * <p>Sets up listener for corresponding Magento model, which comes from model_class field.</p>
 36:  * <p>Listener works only when matching javascript is rendered and user has not left the page.</p>
 37:  * <p>On other cases this class does nothing</p>
 38:  *
 39:  * @author matishalmann
 40:  */
 41: class Eabi_LiveHandler_Block_Footer extends Mage_Core_Block_Template {
 42:     //put your code here
 43:     
 44:     
 45:     protected function _toHtml() {
 46:         
 47:         $resultHtml = '';
 48:         
 49:         if (!$this->_getEabi()->getConfigData('eabi_livehandler/main/enabled')) {
 50:             Mage::getSingleton('core/session')->unsetData('eabi_livehandler_entries');
 51:             return $resultHtml;
 52:         }
 53:         
 54:         $isAdmin = false;
 55:         $urlKey = 'eabi_livehandler/index/process';
 56:         if (Mage::app()->getStore()->isAdmin()) {
 57:             $isAdmin = true;
 58:             $urlKey = 'eabi_livehandler/adminhtml_livehandler/process';
 59:         }
 60:         $path = '';
 61:         $website = Mage::app()->getStore()->getWebsiteId();
 62:         $store = Mage::app()->getStore()->getStoreId();
 63:         $request = Mage::app()->getRequest();
 64:         
 65:         Mage::getSingleton('core/session')->unsetData('eabi_livehandler_entries');
 66:         
 67:         if ($isAdmin) {
 68:             if ($request->getParam('store')) {
 69:                 $store = Mage::getModel('core/store')->load($request->getParam('store'))->getId();
 70:             }
 71:             if ($request->getParam('website')) {
 72:                 $website = Mage::getModel('core/website')->load($request->getParam('website'))->getId();
 73:             }
 74:             
 75:         }
 76:         
 77:         $routeName = $request->getRequestedRouteName();
 78:         $controllerName = $request->getRequestedControllerName();
 79:         $actionName = $request->getRequestedActionName();
 80:         $path = $routeName . '/' . $controllerName . '/' . $actionName;
 81: //        $resultHtml .= $path . '/' . $website . '/' . $store;
 82: 
 83: 
 84:         $actionsCollection = Mage::getModel('eabi_livehandler/entry')->getCollection()->setFilter($path, $isAdmin, $website, $store);
 85:         $lastRequestVar = null;
 86:         $allowedActions = array();
 87:         foreach ($actionsCollection as $id => $action) {
 88:             $suppliedParams = array();
 89:             $action->load($action->getId());
 90:             $targetUrl = '';
 91:             $css = '';
 92:             $js = '';
 93:             $html = '';
 94:             if ($action->getData('request_var') !== $lastRequestVar || true) {
 95:                 //if we do have same path and defined many actions, then only the first one in the path will be executed.
 96: 
 97:                 $js = trim($action->getJs());
 98:                 $css = trim($action->getCss());
 99:                 $html = trim($action->getHtml());
100: 
101:                 if ($action->getData('model_class') != '') {
102:                     $allowedActions[$action->getData('model_class')] = time();
103:                 }
104:                 $params['__path'] = base64_encode($action->getData('model_class'));
105: 
106:                 if ($isAdmin) {
107:                     $targetUrl = Mage::helper('adminhtml')->getUrl($urlKey, $params);
108:                 } else {
109:                     $targetUrl = $this->getUrl($urlKey, $params);
110:                 }
111: 
112:                 $lastRequestVar = $action->getData('request_var');
113: 
114:                 if ($html != '') {
115:                     $resultHtml .= $html;
116:                 }
117:                 if ($css != '') {
118:                     $resultHtml .= <<<EOT
119:     <style type="text/css">
120:                 {$css}
121:     </style>
122: EOT;
123:                 }
124:                 if ($js != '') {
125:                     $urlString = '';
126:                     if ($targetUrl != '') {
127:                         
128:                         $urlString = <<<EOT
129:    var action_url = '{$targetUrl}';
130: EOT;
131:                     }
132:                     $resultHtml .= <<<EOT
133:     <script type="text/javascript">
134:                 //<![CDATA[
135:                 (function() {
136:                     {$urlString}
137: 
138:                     {$js}
139:                 })();
140:                 //]]>
141:     </script>
142: EOT;
143:                 }
144:             }
145:             
146:             //execute each action and supply parameters
147:             
148:             //execute makes the following
149:             /*
150:              * echo the target URL for the proper action handler
151:              * echo action handlers CSS
152:              * echo action handlers JS
153:              * echo action handler HTML
154:              * 
155:              * action url would have to execute the correct action
156:              * 
157:              * 
158:              * 
159:              */
160:         }
161:         Mage::getSingleton('core/session')->setData('eabi_livehandler_entries', $allowedActions);
162:         return $resultHtml;
163:     }
164:     
165:     
166:     /**
167:      * 
168:      * @return Eabi_Livehandler_Helper_Data
169:      */
170:     protected function _getEabi() {
171:         return Mage::helper('eabi');
172:     }
173: }
174: 
175: 
DPD Eesti - Pakivedu.ee Shipping module for Magento API documentation generated by ApiGen 2.8.0