Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Paypal_Adminhtml_Paypal_ReportsController
  • Mage_Paypal_Block_Adminhtml_Settlement_Details
  • Mage_Paypal_Block_Adminhtml_Settlement_Details_Form
  • Mage_Paypal_Block_Adminhtml_Settlement_Report
  • Mage_Paypal_Block_Adminhtml_Settlement_Report_Grid
  • Mage_Paypal_Block_Adminhtml_System_Config_ApiWizard
  • Mage_Paypal_Block_Adminhtml_System_Config_Field_Country
  • Mage_Paypal_Block_Adminhtml_System_Config_Field_Hidden
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Expanded
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Group
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Hint
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Location
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Payment
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Store
  • Mage_Paypal_Block_Adminhtml_System_Config_Payflowlink_Advanced
  • Mage_Paypal_Block_Adminhtml_System_Config_Payflowlink_Info
  • Mage_Paypal_Block_Express_Form
  • Mage_Paypal_Block_Express_Review
  • Mage_Paypal_Block_Express_Review_Billing
  • Mage_Paypal_Block_Express_Review_Details
  • Mage_Paypal_Block_Express_Review_Shipping
  • Mage_Paypal_Block_Express_Shortcut
  • Mage_Paypal_Block_Hosted_Pro_Form
  • Mage_Paypal_Block_Hosted_Pro_Iframe
  • Mage_Paypal_Block_Hosted_Pro_Info
  • Mage_Paypal_Block_Iframe
  • Mage_Paypal_Block_Logo
  • Mage_Paypal_Block_Payflow_Advanced_Form
  • Mage_Paypal_Block_Payflow_Advanced_Iframe
  • Mage_Paypal_Block_Payflow_Advanced_Info
  • Mage_Paypal_Block_Payflow_Link_Form
  • Mage_Paypal_Block_Payflow_Link_Iframe
  • Mage_Paypal_Block_Payflow_Link_Info
  • Mage_Paypal_Block_Payment_Info
  • Mage_Paypal_Block_Standard_Form
  • Mage_Paypal_Block_Standard_Redirect
  • Mage_Paypal_Controller_Express_Abstract
  • Mage_Paypal_ExpressController
  • Mage_Paypal_Helper_Data
  • Mage_Paypal_Helper_Hss
  • Mage_Paypal_HostedproController
  • Mage_Paypal_IpnController
  • Mage_Paypal_Model_Api_Abstract
  • Mage_Paypal_Model_Api_Nvp
  • Mage_Paypal_Model_Api_Standard
  • Mage_Paypal_Model_Cart
  • Mage_Paypal_Model_Cert
  • Mage_Paypal_Model_Config
  • Mage_Paypal_Model_Direct
  • Mage_Paypal_Model_Express
  • Mage_Paypal_Model_Express_Checkout
  • Mage_Paypal_Model_Hostedpro
  • Mage_Paypal_Model_Hostedpro_Request
  • Mage_Paypal_Model_Info
  • Mage_Paypal_Model_Ipn
  • Mage_Paypal_Model_Method_Agreement
  • Mage_Paypal_Model_Mysql4_Cert
  • Mage_Paypal_Model_Mysql4_Report_Settlement
  • Mage_Paypal_Model_Mysql4_Report_Settlement_Row
  • Mage_Paypal_Model_Mysql4_Report_Settlement_Row_Collection
  • Mage_Paypal_Model_Mysql4_Setup
  • Mage_Paypal_Model_Observer
  • Mage_Paypal_Model_Payflow_Request
  • Mage_Paypal_Model_Payflowadvanced
  • Mage_Paypal_Model_Payflowlink
  • Mage_Paypal_Model_Payflowpro
  • Mage_Paypal_Model_Payment_Transaction
  • Mage_Paypal_Model_Pro
  • Mage_Paypal_Model_Report_Settlement
  • Mage_Paypal_Model_Report_Settlement_Row
  • Mage_Paypal_Model_Resource_Cert
  • Mage_Paypal_Model_Resource_Report_Settlement
  • Mage_Paypal_Model_Resource_Report_Settlement_Row
  • Mage_Paypal_Model_Resource_Report_Settlement_Row_Collection
  • Mage_Paypal_Model_Resource_Setup
  • Mage_Paypal_Model_Session
  • Mage_Paypal_Model_Standard
  • Mage_Paypal_Model_System_Config_Backend_Cert
  • Mage_Paypal_Model_System_Config_Backend_Cron
  • Mage_Paypal_Model_System_Config_Backend_MerchantCountry
  • Mage_Paypal_Model_System_Config_Source_BuyerCountry
  • Mage_Paypal_Model_System_Config_Source_FetchingSchedule
  • Mage_Paypal_Model_System_Config_Source_Logo
  • Mage_Paypal_Model_System_Config_Source_MerchantCountry
  • Mage_Paypal_Model_System_Config_Source_PaymentActions
  • Mage_Paypal_Model_System_Config_Source_PaymentActions_Express
  • Mage_Paypal_Model_System_Config_Source_RequireBillingAddress
  • Mage_Paypal_Model_System_Config_Source_UrlMethod
  • Mage_Paypal_PayflowadvancedController
  • Mage_Paypal_PayflowController
  • Mage_Paypal_StandardController

Exceptions

  • Mage_Paypal_Exception
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Paypal
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: /**
 28:  * Field renderer for PayPal merchant country selector
 29:  *
 30:  * @category   Mage
 31:  * @package    Mage_Paypal
 32:  * @author     Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_Paypal_Block_Adminhtml_System_Config_Field_Country
 35:     extends Mage_Adminhtml_Block_System_Config_Form_Field
 36: {
 37:     /**#@+
 38:      *
 39:      * Request parameters names
 40:      */
 41:     const REQUEST_PARAM_COUNTRY = 'country';
 42:     const REQUEST_PARAM_DEFAULT = 'default_country';
 43:     /**#@-*/
 44: 
 45:     /**
 46:      * Country of default scope
 47:      *
 48:      * @var string
 49:      */
 50:     protected $_defaultCountry;
 51: 
 52:     /**
 53:      * Render country field considering request parameter
 54:      *
 55:      * @param Varien_Data_Form_Element_Abstract $element
 56:      * @return string
 57:      */
 58:     public function render(Varien_Data_Form_Element_Abstract $element)
 59:     {
 60:         $country = $this->getRequest()->getParam(self::REQUEST_PARAM_COUNTRY);
 61:         if ($country) {
 62:             $element->setValue($country);
 63:         }
 64: 
 65:         if ($element->getCanUseDefaultValue()) {
 66:             $defaultConfigNode = Mage::getConfig()->getNode(null, 'default');
 67:             if ($defaultConfigNode) {
 68:                 $this->_defaultCountry = (string)$defaultConfigNode->descend('paypal/general/merchant_country');
 69:             }
 70:             if (!$this->_defaultCountry) {
 71:                 $this->_defaultCountry = Mage::helper('core')->getDefaultCountry();
 72:             }
 73:             if ($country) {
 74:                 $shouldInherit = $country == $this->_defaultCountry
 75:                     && $this->getRequest()->getParam(self::REQUEST_PARAM_DEFAULT);
 76:                 $element->setInherit($shouldInherit);
 77:             }
 78:             if ($element->getInherit()) {
 79:                 $this->_defaultCountry = null;
 80:             }
 81:         }
 82: 
 83:         return parent::render($element);
 84:     }
 85: 
 86:     /**
 87:      * Get country selector html
 88:      *
 89:      * @param Varien_Data_Form_Element_Abstract $element
 90:      * @return string
 91:      */
 92:     protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 93:     {
 94:         $configDataModel = Mage::getSingleton('adminhtml/config_data');
 95:         $urlParams = array(
 96:             'section' => $configDataModel->getSection(),
 97:             'website' => $configDataModel->getWebsite(),
 98:             'store' => $configDataModel->getStore(),
 99:             self::REQUEST_PARAM_COUNTRY => '__country__',
100:         );
101:         $urlString = $this->helper('core')
102:             ->jsQuoteEscape(Mage::getModel('adminhtml/url')->getUrl('*/*/*', $urlParams));
103:         $jsString = '
104:             $("' . $element->getHtmlId() . '").observe("change", function () {
105:                 location.href = \'' . $urlString . '\'.replace("__country__", this.value);
106:             });
107:         ';
108: 
109:         if ($this->_defaultCountry) {
110:             $urlParams[self::REQUEST_PARAM_DEFAULT] = '__default__';
111:             $urlString = $this->helper('core')
112:                 ->jsQuoteEscape(Mage::getModel('adminhtml/url')->getUrl('*/*/*', $urlParams));
113:             $jsParentCountry = $this->helper('core')->jsQuoteEscape($this->_defaultCountry);
114:             $jsString .= '
115:                 $("' . $element->getHtmlId() . '_inherit").observe("click", function () {
116:                     if (this.checked) {
117:                         location.href = \'' . $urlString . '\'.replace("__country__", \'' . $jsParentCountry . '\')
118:                             .replace("__default__", "1");
119:                     }
120:                 });
121:             ';
122:         }
123: 
124:         return parent::_getElementHtml($element) . $this->helper('adminhtml/js')
125:             ->getScript('document.observe("dom:loaded", function() {' . $jsString . '});');
126:     }
127: }
128: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0