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_XmlConnect_Adminhtml_MobileController
  • Mage_XmlConnect_Block_Adminhtml_History
  • Mage_XmlConnect_Block_Adminhtml_History_Grid
  • Mage_XmlConnect_Block_Adminhtml_Mobile
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Form
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Submission
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Cache
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Content
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Accordion
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Accordion_Images
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Accordion_Tabs
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Accordion_Themes
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Preview
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Themes
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Flurryanalytics
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_General
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Notification
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Payment
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Settings
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Social
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Submission_History
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tabs
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Addrow
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Color
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Country
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Datetime
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Font
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Image
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Page
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Tabs
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Theme
  • Mage_Xmlconnect_Block_Adminhtml_Mobile_Grid
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Grid_Renderer_Bool
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Grid_Renderer_Type
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Content
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Tabitems
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Form
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Renderer_Country_Androidmarket
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Renderer_Country_Istore
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Tab_Container
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Tab_Container_Submission
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Tabs
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form
  • Mage_XmlConnect_Block_Adminhtml_Queue
  • Mage_XmlConnect_Block_Adminhtml_Queue_Edit
  • Mage_XmlConnect_Block_Adminhtml_Queue_Edit_Form
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Action
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Application
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Id
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Msgtitle
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Pushtitle
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Status
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Template
  • Mage_XmlConnect_Block_Adminhtml_Template
  • Mage_XmlConnect_Block_Adminhtml_Template_Edit
  • Mage_XmlConnect_Block_Adminhtml_Template_Edit_Form
  • Mage_XmlConnect_Block_Adminhtml_Template_Grid
  • Mage_XmlConnect_Block_Adminhtml_Template_Grid_Renderer_Application
  • Mage_XmlConnect_Block_Adminhtml_Template_Grid_Renderer_Name
  • Mage_XmlConnect_Block_Adminhtml_Template_Preview
  • Mage_XmlConnect_Block_Adminhtml_Template_Preview_Form
  • Mage_XmlConnect_Block_Cart
  • Mage_XmlConnect_Block_Cart_Crosssell
  • Mage_XmlConnect_Block_Cart_Info
  • Mage_XmlConnect_Block_Cart_Item_Renderer
  • Mage_XmlConnect_Block_Cart_Item_Renderer_Configurable
  • Mage_XmlConnect_Block_Cart_Item_Renderer_Grouped
  • Mage_XmlConnect_Block_Cart_Paypal_Mecl_Details
  • Mage_XmlConnect_Block_Cart_Paypal_Mecl_Review
  • Mage_XmlConnect_Block_Cart_Paypal_Mecl_Shippingmethods
  • Mage_XmlConnect_Block_Cart_Paypal_Mep_Totals
  • Mage_XmlConnect_Block_Cart_Totals
  • Mage_XmlConnect_Block_Catalog
  • Mage_XmlConnect_Block_Catalog_Category
  • Mage_XmlConnect_Block_Catalog_Category_Info
  • Mage_XmlConnect_Block_Catalog_Filters
  • Mage_XmlConnect_Block_Catalog_Product
  • Mage_XmlConnect_Block_Catalog_Product_Attributes
  • Mage_XmlConnect_Block_Catalog_Product_Gallery
  • Mage_XmlConnect_Block_Catalog_Product_List
  • Mage_XmlConnect_Block_Catalog_Product_Options
  • Mage_XmlConnect_Block_Catalog_Product_Options_Bundle
  • Mage_XmlConnect_Block_Catalog_Product_Options_Configurable
  • Mage_XmlConnect_Block_Catalog_Product_Options_Giftcard
  • Mage_XmlConnect_Block_Catalog_Product_Options_Grouped
  • Mage_XmlConnect_Block_Catalog_Product_Options_Simple
  • Mage_XmlConnect_Block_Catalog_Product_Options_Virtual
  • Mage_XmlConnect_Block_Catalog_Product_Price
  • Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
  • Mage_XmlConnect_Block_Catalog_Product_Price_Default
  • Mage_XmlConnect_Block_Catalog_Product_Price_Giftcard
  • Mage_XmlConnect_Block_Catalog_Product_Related
  • Mage_XmlConnect_Block_Catalog_Product_Review
  • Mage_XmlConnect_Block_Catalog_Product_Review_List
  • Mage_XmlConnect_Block_Catalog_Search
  • Mage_XmlConnect_Block_Catalog_Search_Suggest
  • Mage_XmlConnect_Block_Checkout_Address_Billing
  • Mage_XmlConnect_Block_Checkout_Address_Form
  • Mage_XmlConnect_Block_Checkout_Address_Shipping
  • Mage_XmlConnect_Block_Checkout_Agreements
  • Mage_XmlConnect_Block_Checkout_Order_Review
  • Mage_XmlConnect_Block_Checkout_Order_Review_Info
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Authorizenet
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Ccsave
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Checkmo
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Authorizenet
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Ccsave
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Checkmo
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Free
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Paypal_Abstract
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Paypal_Express
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Paypal_Mecl
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Pbridge_Authorizenet
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Pbridge_Paypal_Direct
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Pbridge_Paypaluk_Direct
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Pbridge_Verisign
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Purchaseorder
  • Mage_XmlConnect_Block_Checkout_Payment_Method_List
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Paypal_Direct
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Paypal_Payflow
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Pbridge_Abstract
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Pbridge_Authorizenet
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Pbridge_Paypal
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Pbridge_Paypaluk
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Pbridge_Verisign
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Purchaseorder
  • Mage_XmlConnect_Block_Checkout_Pbridge_Result
  • Mage_XmlConnect_Block_Checkout_Shipping_Method_Available
  • Mage_XmlConnect_Block_Cms_Page
  • Mage_XmlConnect_Block_Configuration
  • Mage_XmlConnect_Block_Customer_Address_Form
  • Mage_XmlConnect_Block_Customer_Address_List
  • Mage_XmlConnect_Block_Customer_Form
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Boolean
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Date
  • Mage_XmlConnect_Block_Customer_Form_Renderer_File
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Image
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Multiline
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Multiselect
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Select
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Text
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Textarea
  • Mage_XmlConnect_Block_Customer_GiftcardCheck
  • Mage_XmlConnect_Block_Customer_Order_Details
  • Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Bundle
  • Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Default
  • Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Downloadable
  • Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Giftcard
  • Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Grouped
  • Mage_XmlConnect_Block_Customer_Order_Items
  • Mage_XmlConnect_Block_Customer_Order_List
  • Mage_XmlConnect_Block_Customer_Order_Totals
  • Mage_XmlConnect_Block_Customer_Order_Totals_Customerbalance
  • Mage_XmlConnect_Block_Customer_Order_Totals_Customerbalance_Refunded
  • Mage_XmlConnect_Block_Customer_Order_Totals_Giftcards
  • Mage_XmlConnect_Block_Customer_Order_Totals_Tax
  • Mage_XmlConnect_Block_Customer_Storecredit
  • Mage_XmlConnect_Block_Home
  • Mage_XmlConnect_Block_Review_Form
  • Mage_XmlConnect_Block_Wishlist
  • Mage_XmlConnect_CartController
  • Mage_XmlConnect_CatalogController
  • Mage_XmlConnect_CheckoutController
  • Mage_XmlConnect_CmsController
  • Mage_XmlConnect_ConfigurationController
  • Mage_XmlConnect_Controller_Action
  • Mage_XmlConnect_CustomerController
  • Mage_XmlConnect_Helper_Android
  • Mage_XmlConnect_Helper_Catalog_Category_Image
  • Mage_XmlConnect_Helper_Customer_Form_Renderer
  • Mage_XmlConnect_Helper_Customer_Order
  • Mage_XmlConnect_Helper_Data
  • Mage_XmlConnect_Helper_Image
  • Mage_XmlConnect_Helper_Ipad
  • Mage_XmlConnect_Helper_Iphone
  • Mage_XmlConnect_Helper_Theme
  • Mage_XmlConnect_IndexController
  • Mage_XmlConnect_Model_Adminhtml_System_Config_Backend_Baseurl
  • Mage_XmlConnect_Model_Adminhtml_System_Config_Backend_Currency_Default
  • Mage_XmlConnect_Model_Application
  • Mage_XmlConnect_Model_Catalog_Category_Image
  • Mage_XmlConnect_Model_ConfigData
  • Mage_XmlConnect_Model_History
  • Mage_XmlConnect_Model_Mysql4_Application
  • Mage_XmlConnect_Model_Mysql4_Application_Collection
  • Mage_XmlConnect_Model_Mysql4_Cms_Page_Collection
  • Mage_XmlConnect_Model_Mysql4_ConfigData
  • Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
  • Mage_XmlConnect_Model_Mysql4_Filter_Collection
  • Mage_XmlConnect_Model_Mysql4_History
  • Mage_XmlConnect_Model_Mysql4_History_Collection
  • Mage_XmlConnect_Model_Mysql4_Queue
  • Mage_XmlConnect_Model_Mysql4_Queue_Collection
  • Mage_XmlConnect_Model_Mysql4_Setup
  • Mage_XmlConnect_Model_Mysql4_Template
  • Mage_XmlConnect_Model_Mysql4_Template_Collection
  • Mage_XmlConnect_Model_Observer
  • Mage_XmlConnect_Model_Payment_Method_Paypal_Config
  • Mage_XmlConnect_Model_Payment_Method_Paypal_Mecl
  • Mage_XmlConnect_Model_Payment_Method_Paypal_Mep
  • Mage_XmlConnect_Model_Paypal_Mecl_Checkout
  • Mage_XmlConnect_Model_Paypal_Mep_Checkout
  • Mage_XmlConnect_Model_Preview_Abstract
  • Mage_XmlConnect_Model_Preview_Android
  • Mage_XmlConnect_Model_Preview_Ipad
  • Mage_XmlConnect_Model_Preview_Iphone
  • Mage_XmlConnect_Model_Queue
  • Mage_XmlConnect_Model_Resource_Application
  • Mage_XmlConnect_Model_Resource_Application_Collection
  • Mage_XmlConnect_Model_Resource_Cms_Page_Collection
  • Mage_XmlConnect_Model_Resource_ConfigData
  • Mage_XmlConnect_Model_Resource_ConfigData_Collection
  • Mage_XmlConnect_Model_Resource_Filter_Collection
  • Mage_XmlConnect_Model_Resource_History
  • Mage_XmlConnect_Model_Resource_History_Collection
  • Mage_XmlConnect_Model_Resource_Queue
  • Mage_XmlConnect_Model_Resource_Queue_Collection
  • Mage_XmlConnect_Model_Resource_Setup
  • Mage_XmlConnect_Model_Resource_Template
  • Mage_XmlConnect_Model_Resource_Template_Collection
  • Mage_XmlConnect_Model_Simplexml_Element
  • Mage_XmlConnect_Model_Simplexml_Form
  • Mage_XmlConnect_Model_Simplexml_Form_Abstract
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Checkbox
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Collection
  • Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Date
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Email
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset
  • Mage_XmlConnect_Model_Simplexml_Form_Element_File
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Image
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Multiline
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Multiselect
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Select
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Text
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Textarea
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Validator
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Validator_Abstract
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Validator_Rule
  • Mage_XmlConnect_Model_Tabs
  • Mage_XmlConnect_Model_Template
  • Mage_XmlConnect_Model_Theme
  • Mage_XmlConnect_Paypal_MeclController
  • Mage_XmlConnect_Paypal_MepController
  • Mage_XmlConnect_PbridgeController
  • Mage_XmlConnect_ReviewController
  • Mage_XmlConnect_WishlistController

Interfaces

  • Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface
  • 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_XmlConnect
 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:  * Customer address form xml renderer
 29:  *
 30:  * @category    Mage
 31:  * @package     Mage_XmlConnect
 32:  * @author      Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Address_Edit
 35: {
 36:     /**
 37:      * Customer name widget block
 38:      *
 39:      * @var Mage_Customer_Block_Widget_Name
 40:      */
 41:     protected $_nameWidgetBlock;
 42: 
 43:     /**
 44:      * Enterprise customer field renderer list as type => renderer block
 45:      *
 46:      * Original block relations:
 47:      * - 'text'      => 'enterprise_customer/form_renderer_text',
 48:      * - 'textarea'  => 'enterprise_customer/form_renderer_textarea',
 49:      * - 'multiline' => 'enterprise_customer/form_renderer_multiline',
 50:      * - 'date'      => 'enterprise_customer/form_renderer_date',
 51:      * - 'select'    => 'enterprise_customer/form_renderer_select',
 52:      * - 'multiselect' => 'enterprise_customer/form_renderer_multiselect',
 53:      * - 'boolean'   => 'enterprise_customer/form_renderer_boolean',
 54:      * - 'file'      => 'enterprise_customer/form_renderer_file'
 55:      * - 'image'     => 'enterprise_customer/form_renderer_image'
 56:      *
 57:      * @see customer.xml layout customer_form_template_handle node
 58:      * @var array
 59:      */
 60:     protected $_customerFiledRenderer = array(
 61:         'text'      => 'xmlconnect/customer_form_renderer_text',
 62:         'textarea'  => 'xmlconnect/customer_form_renderer_textarea',
 63:         'multiline' => 'xmlconnect/customer_form_renderer_multiline',
 64:         'date'      => 'xmlconnect/customer_form_renderer_date',
 65:         'select'    => 'xmlconnect/customer_form_renderer_select',
 66:         'multiselect' => 'xmlconnect/customer_form_renderer_multiselect',
 67:         'boolean'   => 'xmlconnect/customer_form_renderer_boolean',
 68:         'file'      => 'xmlconnect/customer_form_renderer_file',
 69:         'image'     => 'xmlconnect/customer_form_renderer_image'
 70:     );
 71: 
 72:     /**
 73:      * Render customer address form xml
 74:      *
 75:      * @return string
 76:      */
 77:     protected function _toHtml()
 78:     {
 79:         $address  = $this->getAddress();
 80: 
 81:         /**
 82:          * Init address object and save its data to variables
 83:          */
 84:         $addressId = (int)$this->getRequest()->getParam('id');
 85:         $billingChecked = $shippingChecked = false;
 86: 
 87:         if ($addressId && $address && $address->getId()) {
 88:             $defaultBillingAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
 89:             $defaultShippingAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping();
 90: 
 91:             $billingChecked = (int)$addressId == $defaultBillingAddressId;
 92:             $shippingChecked = (int)$addressId == $defaultShippingAddressId;
 93: 
 94:             $company    = $address->getCompany();
 95:             $street1    = $address->getStreet(1);
 96:             $street2    = $address->getStreet(2);
 97:             $city       = $address->getCity();
 98:             $regionId   = $address->getRegionId();
 99:             $region     = $address->getRegion();
100:             $postcode   = $address->getPostcode();
101:             $countryId  = $address->getCountryId();
102:             $telephone  = $address->getTelephone();
103:             $fax        = $address->getFax();
104:         }
105: 
106:         $action = Mage::helper('xmlconnect')->getActionUrl('xmlconnect/customer/saveaddress');
107: 
108:         /** @var Mage_XmlConnect_Model_Simplexml_Form $fromXmlObj */
109:         $fromXmlObj = Mage::getModel('xmlconnect/simplexml_form', array(
110:             'xml_id' => 'address_form',
111:             'action' => $action,
112:             'use_container' => true
113:         ));
114: 
115:         $contactInfoFieldset = $fromXmlObj->addFieldset('contact_info', array(
116:             'legend' => $this->__('Contact Information')
117:         ))->setCustomAttributes(array('legend'));
118: 
119:         $this->_addCustomerContactInfo($contactInfoFieldset);
120: 
121:         $contactInfoFieldset->addField('company', 'text', array(
122:             'label' => $this->__('Company'),
123:             'value' => isset($company) ? $company : ''
124:         ));
125:         $contactInfoFieldset->addField('telephone', 'text', array(
126:             'label' => $this->__('Telephone'),
127:             'required' => 'true',
128:             'value' => isset($telephone) ? $telephone : ''
129:         ));
130:         $contactInfoFieldset->addField('fax', 'text', array(
131:             'label' => $this->__('Fax'),
132:             'value' => isset($fax) ? $fax : ''
133:         ));
134: 
135:         $addressFieldset = $fromXmlObj->addFieldset('address_info', array('legend' => $this->__('Address')))
136:             ->setCustomAttributes(array('legend'));
137: 
138:         $addressFieldset->addField('street', 'text', array(
139:             'name' => 'street[]',
140:             'label' => $this->__('Street Address'),
141:             'required' => 'true',
142:             'value' => isset($street1) ? $street1 : ''
143:         ));
144:         $addressFieldset->addField('street_2', 'text', array(
145:             'name' => 'street[]',
146:             'label' => $this->__('Street Address %s', 2),
147:             'value' => isset($street2) ? $street2 : ''
148:         ));
149:         $addressFieldset->addField('city', 'text', array(
150:             'label' => $this->__('City'),
151:             'required' => 'true',
152:             'value' => isset($city) ? $city : ''
153:         ));
154: 
155:         $countryId  = isset($countryId) ? $countryId    : null;
156:         $regionId   = isset($regionId)  ? $regionId     : null;
157:         $region     = isset($region)    ? $region       : null;
158: 
159:         $addressFieldset->addField('country_id', 'countryListSelect', array(
160:             'label'     => $this->__('Country'),
161:             'required'  => 'true',
162:             'value'     => array(
163:                 'country_id'    => $countryId,
164:                 'region_id'     => $regionId,
165:                 'region'        => $region
166:             ),
167:             'old_format' => true
168:         ));
169:         $addressFieldset->addField('region', 'text', array(
170:             'label' => $this->__('State/Province'),
171:             'value' => isset($region) ? $region : ''
172:         ));
173:         $addressFieldset->addField('region_id', 'select', array(
174:             'label' => $this->__('State/Province'),
175:             'required' => 'true',
176:         ));
177:         $addressFieldset->addField('postcode', 'text', array(
178:             'label' => $this->__('Zip/Postal Code'),
179:             'required' => 'true',
180:             'value' => isset($postcode) ? $postcode : ''
181:         ));
182:         $addressFieldset->addField('default_billing', 'checkbox', array(
183:             'label' => $this->__('Use as my default billing address'),
184:             'value' => $billingChecked ? $billingChecked : 0
185:         ));
186: 
187:         $addressFieldset->addField('default_shipping', 'checkbox', array(
188:             'label' => $this->__('Use as my default shipping address'),
189:             'value' => $shippingChecked ? $shippingChecked : 0
190:         ));
191: 
192:         $this->_addCustomAddressAttributes($addressFieldset);
193: 
194:         return $fromXmlObj->getXml();
195:     }
196: 
197:     /**
198:      * Add customer contact attributes
199:      *
200:      * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
201:      * @return Mage_XmlConnect_Block_Customer_Address_Form
202:      */
203:     protected function _addCustomerContactInfo(
204:         Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
205:     ) {
206:         if (is_object(Mage::getConfig()->getNode('modules/Enterprise_Customer'))) {
207:             $this->setNameWidgetBlock(
208:                 $this->getLayout()->createBlock('customer/widget_name')->setObject(
209:                     $this->getAddress()->getFirstname() ? $this->getAddress() : $this->getCustomer()
210:             ));
211: 
212:             if ($this->getNameWidgetBlock()->showPrefix()) {
213:                 $this->_addPrefix($contactInfoFieldset);
214:             }
215: 
216:             $this->_addFirstName($contactInfoFieldset);
217: 
218:             if ($this->getNameWidgetBlock()->showMiddlename()) {
219:                 $this->_addMiddleName($contactInfoFieldset);
220:             }
221: 
222:             $this->_addLastName($contactInfoFieldset);
223: 
224:             if ($this->getNameWidgetBlock()->showSuffix()) {
225:                 $this->_addSuffix($contactInfoFieldset);
226:             }
227:         } else {
228:             $this->_addFirstName($contactInfoFieldset);
229:             $this->_addLastName($contactInfoFieldset);
230:         }
231:         return $this;
232:     }
233: 
234:     /**
235:      * Add customer prefix field
236:      *
237:      * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
238:      * @return Mage_XmlConnect_Block_Customer_Address_Form
239:      */
240:     protected function _addPrefix(Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset)
241:     {
242:         $attributes = array();
243:         $attributes += $contactInfoFieldset->checkAttribute(
244:             'value', $this->getNameWidgetBlock()->getObject()->getPrefix()
245:         );
246: 
247:         $attributes += $contactInfoFieldset->checkAttribute(
248:             'required', (int)$this->getNameWidgetBlock()->isPrefixRequired()
249:         );
250: 
251:         if ($this->getNameWidgetBlock()->getPrefixOptions() === false) {
252:             $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('prefix'), 'text', array(
253:                 'label' => $this->__('Prefix'),
254:                 'name' => $this->getNameWidgetBlock()->getFieldName('prefix')
255:             ) + $attributes);
256:         } else {
257:             $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('prefix'), 'select', array(
258:                 'label' => $this->__('Prefix'),
259:                 'name' => $this->getNameWidgetBlock()->getFieldName('prefix'),
260:                 'options' => $this->getNameWidgetBlock()->getPrefixOptions()
261:             ) + $attributes);
262:         }
263:         return $this;
264:     }
265: 
266:     /**
267:      * Add customer suffix field
268:      *
269:      * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
270:      * @return Mage_XmlConnect_Block_Customer_Address_Form
271:      */
272:     protected function _addSuffix(
273:         Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
274:     )
275:     {
276:         $attributes = array();
277:         $attributes += $contactInfoFieldset->checkAttribute(
278:             'value', $this->getNameWidgetBlock()->getObject()->getSuffix()
279:         );
280: 
281:         $attributes += $contactInfoFieldset->checkAttribute(
282:             'required', (int)$this->getNameWidgetBlock()->isSuffixRequired()
283:         );
284: 
285:         if ($this->getNameWidgetBlock()->getSuffixOptions() === false) {
286:             $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('suffix'), 'text', array(
287:                 'label' => $this->__('Suffix'),
288:                 'name' => $this->getNameWidgetBlock()->getFieldName('suffix')
289:             ) + $attributes);
290:         } else {
291:             $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('suffix'), 'select', array(
292:                 'label' => $this->__('Suffix'),
293:                 'name' => $this->getNameWidgetBlock()->getFieldName('suffix'),
294:                 'options' => $this->getNameWidgetBlock()->getSuffixOptions()
295:             ) + $attributes);
296:         }
297:         return $this;
298:     }
299: 
300:     /**
301:      * Add customer middle name field
302:      *
303:      * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
304:      * @return Mage_XmlConnect_Block_Customer_Address_Form
305:      */
306:     protected function _addMiddleName(
307:         Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
308:     )
309:     {
310:         $attributes = array();
311:         $attributes += $contactInfoFieldset->checkAttribute(
312:             'value',
313:             $this->getNameWidgetBlock()->getObject()->getMiddlename()
314:         );
315: 
316:         $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('middlename'), 'text', array(
317:             'label' => $this->__('M.I.'),
318:             'name' => $this->getNameWidgetBlock()->getFieldName('middlename')
319:         ) + $attributes);
320: 
321:         return $this;
322:     }
323: 
324:     /**
325:      * Add customer first name field
326:      *
327:      * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
328:      * @return Mage_XmlConnect_Block_Customer_Address_Form
329:      */
330:     protected function _addFirstName(
331:         Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
332:     ) {
333:         $firstName  = $this->getAddress()->getFirstname();
334:         $contactInfoFieldset->addField('firstname', 'text', array(
335:             'label' => $this->__('First Name'),
336:             'required' => 'true',
337:             'value' => isset($firstName) ? $firstName : ''
338:         ));
339:         return $this;
340:     }
341: 
342:     /**
343:      * Add customer last name field
344:      *
345:      * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
346:      * @return Mage_XmlConnect_Block_Customer_Address_Form
347:      */
348:     protected function _addLastName(
349:         Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
350:     ) {
351:         $lastName   = $this->getAddress()->getLastname();
352:         $contactInfoFieldset->addField('lastname', 'text', array(
353:             'label' => $this->__('Last Name'),
354:             'required' => 'true',
355:             'value' => isset($lastName) ? $lastName : ''
356:         ));
357:         return $this;
358:     }
359: 
360:     /**
361:      * Add custom customer attributes
362:      *
363:      * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $addressFieldset
364:      * @return Mage_XmlConnect_Block_Customer_Address_Form
365:      */
366:     protected function _addCustomAddressAttributes(
367:         Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $addressFieldset
368:     ) {
369:         if (is_object(Mage::getConfig()->getNode('modules/Enterprise_Customer'))) {
370:             /** @var $addressAttrBlock Enterprise_Customer_Block_Form */
371:             $addressAttrBlock = $this->getLayout()
372:                 ->addBlock('enterprise_customer/form', 'customer_address_attr');
373:             $addressAttrBlock->setFormCode('customer_address_edit');
374:             $addressAttrBlock->setEntity($this->getAddress());
375: 
376:             foreach ($this->_customerFiledRenderer as $type => $rendererBlock) {
377:                 $addressAttrBlock->addRenderer($type, $rendererBlock, 'customer/form/renderer/text.phtml');
378:             }
379: 
380:             if ($addressAttrBlock->hasUserDefinedAttributes()) {
381:                 foreach ($addressAttrBlock->getUserDefinedAttributes() as $attribute) {
382:                     $type   = $attribute->getFrontendInput();
383:                     $block  = $addressAttrBlock->getRenderer($type);
384:                     if ($block) {
385:                         $block->setAttributeObject($attribute)->setEntity($addressAttrBlock->getEntity())
386:                             ->addFieldToXmlObj($addressFieldset);
387:                     }
388:                 }
389:             }
390:         }
391:         return $this;
392:     }
393: 
394:     /**
395:      * Get customer name widget block
396:      *
397:      * @return Mage_Customer_Block_Widget_Name
398:      */
399:     public function getNameWidgetBlock()
400:     {
401:         return $this->_nameWidgetBlock;
402:     }
403: 
404:     /**
405:      * Set customer name widget block
406:      *
407:      * @param Mage_Customer_Block_Widget_Name $nameWidgetBlock
408:      * @return Mage_XmlConnect_Block_Customer_Address_Form
409:      */
410:     public function setNameWidgetBlock($nameWidgetBlock)
411:     {
412:         $this->_nameWidgetBlock = $nameWidgetBlock;
413:         return $this;
414:     }
415: 
416:     /**
417:      * Get enterprise customer fields renderer
418:      *
419:      * @return array
420:      */
421:     public function getCustomerFiledRenderer()
422:     {
423:         return $this->_customerFiledRenderer;
424:     }
425: 
426:     /**
427:      * Set enterprise customer fields renderer
428:      *
429:      * @param array $customerFiledRenderer
430:      * @return Mage_XmlConnect_Block_Customer_Address_Form
431:      */
432:     public function setCustomerFiledRenderer($customerFiledRenderer)
433:     {
434:         $this->_customerFiledRenderer = $customerFiledRenderer;
435:         return $this;
436:     }
437: }
438: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0