Protected Member Functions | |
_prepareForm () |
Definition at line 26 of file General.php.
_prepareForm | ( | ) | [protected] |
Prepare form before rendering HTML
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 29 of file General.php.
00030 { 00031 $form = new Varien_Data_Form(); 00032 00033 $fieldset = $form->addFieldset('general', array('legend'=>Mage::helper('core')->__('General Settings'))); 00034 00035 if (!Mage::app()->isSingleStoreMode()) { 00036 $fieldset->addField('store_id', 'select', array( 00037 'label' => Mage::helper('core')->__('Store'), 00038 'title' => Mage::helper('core')->__('Store'), 00039 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), 00040 'name' => 'store_id', 00041 'required' => true, 00042 )); 00043 } else { 00044 $fieldset->addField('store_id', 'hidden', array( 00045 'name' => 'store_id', 00046 'value' => Mage::app()->getStore(true)->getId(), 00047 )); 00048 } 00049 00050 $fieldset->addField('design', 'select', array( 00051 'label' => Mage::helper('core')->__('Custom Design'), 00052 'title' => Mage::helper('core')->__('Custom Design'), 00053 'values' => Mage::getSingleton('core/design_source_design')->getAllOptions(), 00054 'name' => 'design', 00055 'required' => true, 00056 )); 00057 00058 $dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); 00059 $fieldset->addField('date_from', 'date', array( 00060 'label' => Mage::helper('core')->__('Date From'), 00061 'title' => Mage::helper('core')->__('Date From'), 00062 'name' => 'date_from', 00063 'image' => $this->getSkinUrl('images/grid-cal.gif'), 00064 'format' => $dateFormatIso, 00065 //'required' => true, 00066 )); 00067 $fieldset->addField('date_to', 'date', array( 00068 'label' => Mage::helper('core')->__('Date To'), 00069 'title' => Mage::helper('core')->__('Date To'), 00070 'name' => 'date_to', 00071 'image' => $this->getSkinUrl('images/grid-cal.gif'), 00072 'format' => $dateFormatIso, 00073 //'required' => true, 00074 )); 00075 00076 $formData = Mage::getSingleton('adminhtml/session')->getDesignData(true); 00077 if (!$formData){ 00078 $formData = Mage::registry('design')->getData(); 00079 } else { 00080 $formData = $formData['design']; 00081 } 00082 00083 $form->addValues($formData); 00084 $form->setFieldNameSuffix('design'); 00085 $this->setForm($form); 00086 }