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>Renders button, which allows to delete old instance of Eabi_Postoffice from app/code/local folder in Magento admin &gt; System &gt; Configuration &gt; Shipping Methods &gt; DPD - pakivedu.ee configuration menu, if such old instance exists</p>
 35:  *
 36:  * @author Matis
 37:  */
 38: class Eabi_Postoffice_Block_Adminhtml_Config_Form_Field_Remove extends Mage_Adminhtml_Block_System_Config_Form_Field {
 39: 
 40:     protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
 41:         $divId = $element->getId();
 42:         $helper = Mage::helper('eabi_livehandler');
 43:         $res = '';
 44:         $dirName = Mage::getBaseDir('code') . '/local/Eabi/Postoffice';
 45:         if (is_dir($dirName) && file_exists($dirName.'/etc/config.xml')) {
 46:                 $res .= <<<HTML
 47:    <button class="scalable" id="{$divId}_button" type="button" onclick="{$divId}make_request(); return false;">{$this->_getOfficeHelper()->__('Delete instance of this module from %s folder', 'app/code/local')}</button>
 48:                 
 49: HTML;
 50:             $res .= <<<HTML
 51: <script type="text/javascript">
 52: //<![CDATA[
 53: 
 54: function {$divId}make_request(actionName) {
 55:     var confirmR = confirm({$this->_toJson($helper->__('Most probably you have older version of this module in the system. Do you want to remove the instance of this module from %s folder?', $dirName))});
 56:     
 57:     if (confirmR) {
 58:         new Ajax.Request(
 59:             '{$this->getUrl('eabi_postoffice/adminhtml_postoffice/remove', array())}',
 60:             {
 61:                 method: 'post',
 62:                 asynchronous: true,
 63:                 parameters: {"remove": "true"},
 64:                 onSuccess: function(transport) {
 65:                         var json = transport.responseText.evalJSON(true);
 66:                         if (json['status'] && json['status'] == 'success') {
 67:                             alert({$this->_toJson($this->_getOfficeHelper()->__('Folder %s deleted!', $dirName))});
 68:                             \$({$this->_toJson($divId . '_button')}).hide();
 69:                         } else {
 70:                             alert({$this->_toJson($this->_getOfficeHelper()->__('Folder %s delete failed!', $dirName))});
 71:                         }
 72:                 },
 73:                 onFailure: function(transport) {
 74:                     alert(transport.responseText);
 75:                 }
 76:         });
 77:     }
 78: 
 79: }
 80: //]]>
 81: </script>
 82: 
 83: HTML;
 84:             
 85:         }
 86:         return $res;
 87:     }
 88:     
 89:     private function _toJson($input) {
 90:         return json_encode($input);
 91:     }
 92:     
 93:     /**
 94:      * 
 95:      * @return Eabi_Postoffice_Helper_Data
 96:      */
 97:     protected function _getOfficeHelper() {
 98:         return Mage::helper('eabi_postoffice');
 99:     }
100:     
101:     
102: 
103: }
104: 
105: 
DPD Eesti - Pakivedu.ee Shipping module for Magento API documentation generated by ApiGen 2.8.0