Mage_Install_Block_Locale Class Reference

Inheritance diagram for Mage_Install_Block_Locale:

Mage_Install_Block_Abstract Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getLocale ()
 getPostUrl ()
 getChangeUrl ()
 getLocaleSelect ()
 getTimezoneSelect ()
 getTimezone ()
 getCurrencySelect ()
 getCurrency ()
 getFormData ()


Detailed Description

Definition at line 34 of file Locale.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 37 of file Locale.php.

00038     {
00039         parent::__construct();
00040         $this->setTemplate('install/locale.phtml');
00041     }


Member Function Documentation

getChangeUrl (  ) 

Retrieve locale change url

Returns:
string

Definition at line 74 of file Locale.php.

00075     {
00076         return $this->getUrl('*/*/localeChange');
00077     }

getCurrency (  ) 

Retrieve currency

Returns:
string

Definition at line 154 of file Locale.php.

00155     {
00156         return Mage::getSingleton('install/session')->getCurrency()
00157             ? Mage::getSingleton('install/session')->getCurrency()
00158             : Mage::app()->getLocale()->getCurrency();
00159     }

getCurrencySelect (  ) 

Retrieve currency dropdown html

Returns:
string

Definition at line 136 of file Locale.php.

00137     {
00138         $html = $this->getLayout()->createBlock('core/html_select')
00139             ->setName('config[currency]')
00140             ->setId('currency')
00141             ->setTitle(Mage::helper('install')->__('Default Currency'))
00142             ->setClass('required-entry')
00143             ->setValue($this->getCurrency())
00144             ->setOptions(Mage::app()->getLocale()->getOptionCurrencies())
00145             ->getHtml();
00146         return $html;
00147     }

getFormData (  ) 

Definition at line 161 of file Locale.php.

00162     {
00163         $data = $this->getData('form_data');
00164         if (is_null($data)) {
00165             $data = new Varien_Object();
00166             $this->setData('form_data', $data);
00167         }
00168         return $data;
00169     }

getLocale (  ) 

Retrieve locale object

Returns:
Zend_Locale

Definition at line 48 of file Locale.php.

00049     {
00050         $locale = $this->getData('locale');
00051         if (is_null($locale)) {
00052             $locale = Mage::app()->getLocale()->getLocale();
00053             $this->setData('locale', $locale);
00054         }
00055         return $locale;
00056     }

getLocaleSelect (  ) 

Retrieve locale dropdown HTML

Returns:
string

Definition at line 84 of file Locale.php.

00085     {
00086         $html = $this->getLayout()->createBlock('core/html_select')
00087             ->setName('config[locale]')
00088             ->setId('locale')
00089             ->setTitle(Mage::helper('install')->__('Locale'))
00090             ->setClass('required-entry')
00091             ->setValue($this->getLocale()->__toString())
00092             ->setOptions(Mage::app()->getLocale()->getTranslatedOptionLocales())
00093             ->getHtml();
00094         return $html;
00095     }

getPostUrl (  ) 

Retrieve locale data post url

Returns:
string

Definition at line 63 of file Locale.php.

00064     {
00065         return $this->getCurrentStep()->getNextUrl();
00066         //return $this->getUrl('*/*/localePost');
00067     }

getTimezone (  ) 

Retrieve timezone

Returns:
string

Definition at line 120 of file Locale.php.

00121     {
00122         $timezone = Mage::getSingleton('install/session')->getTimezone()
00123             ? Mage::getSingleton('install/session')->getTimezone()
00124             : Mage::app()->getLocale()->getTimezone();
00125         if ($timezone == Mage_Core_Model_Locale::DEFAULT_TIMEZONE) {
00126             $timezone = 'America/Los_Angeles';
00127         }
00128         return $timezone;
00129     }

getTimezoneSelect (  ) 

Retrieve timezone dropdown HTML

Returns:
string

Definition at line 102 of file Locale.php.

00103     {
00104         $html = $this->getLayout()->createBlock('core/html_select')
00105             ->setName('config[timezone]')
00106             ->setId('timezone')
00107             ->setTitle(Mage::helper('install')->__('Time Zone'))
00108             ->setClass('required-entry')
00109             ->setValue($this->getTimezone())
00110             ->setOptions(Mage::app()->getLocale()->getOptionTimezones())
00111             ->getHtml();
00112         return $html;
00113     }


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

Generated on Sat Jul 4 17:24:27 2009 for Magento by  doxygen 1.5.8