Mage_Adminhtml_Block_Customer_Edit_Renderer_Region Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Customer_Edit_Renderer_Region:

Mage_Adminhtml_Block_Abstract Varien_Data_Form_Element_Renderer_Interface Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 render (Varien_Data_Form_Element_Abstract $element)


Detailed Description

Customer address region field renderer

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 of file Region.php.


Member Function Documentation

render ( Varien_Data_Form_Element_Abstract element  ) 

Implements Varien_Data_Form_Element_Renderer_Interface.

Definition at line 35 of file Region.php.

00036     {
00037         if ($country = $element->getForm()->getElement('country_id')) {
00038             $countryId = $country->getValue();
00039         }
00040         else {
00041             return $element->getDefaultHtml();
00042         }
00043 
00044         $regionId = $element->getForm()->getElement('region_id')->getValue();
00045 
00046         $html = '<tr>';
00047         $element->setClass('input-text');
00048         $html.= '<td class="label">'.$element->getLabelHtml().'</td><td class="value">';
00049         $html.= $element->getElementHtml();
00050 
00051         $selectName = str_replace('region', 'region_id', $element->getName());
00052         $selectId   = $element->getHtmlId().'_id';
00053         $html.= '<select id="'.$selectId.'" name="'.$selectName.'" class="select required-entry" style="display:none">';
00054         $html.= '<option value="">'.Mage::helper('customer')->__('Please select').'</option>';
00055         $html.= '</select>';
00056         $html.= '<script type="text/javascript">
00057         if ($("'.$country->getHtmlId().'") != undefined) {
00058             new regionUpdater("'.$country->getHtmlId().'", "'.$element->getHtmlId().'", "'.$selectId.'", '.$this->helper('directory')->getRegionJson().');
00059         }
00060         </script>';
00061         $html.= '</td></tr>'."\n";
00062         return $html;
00063     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:47 2009 for Magento by  doxygen 1.5.8