addFieldset('general', array('legend'=>Mage::helper('core')->__('General Settings'))); if (!Mage::app()->isSingleStoreMode()) { $field = $fieldset->addField('store_id', 'select', array( 'label' => Mage::helper('core')->__('Store'), 'title' => Mage::helper('core')->__('Store'), 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), 'name' => 'store_id', 'required' => true, )); $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element'); $field->setRenderer($renderer); } else { $fieldset->addField('store_id', 'hidden', array( 'name' => 'store_id', 'value' => Mage::app()->getStore(true)->getId(), )); } $fieldset->addField('design', 'select', array( 'label' => Mage::helper('core')->__('Custom Design'), 'title' => Mage::helper('core')->__('Custom Design'), 'values' => Mage::getSingleton('core/design_source_design')->getAllOptions(), 'name' => 'design', 'required' => true, )); $dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); $fieldset->addField('date_from', 'date', array( 'label' => Mage::helper('core')->__('Date From'), 'title' => Mage::helper('core')->__('Date From'), 'name' => 'date_from', 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'format' => $dateFormatIso, //'required' => true, )); $fieldset->addField('date_to', 'date', array( 'label' => Mage::helper('core')->__('Date To'), 'title' => Mage::helper('core')->__('Date To'), 'name' => 'date_to', 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'format' => $dateFormatIso, //'required' => true, )); $formData = Mage::getSingleton('adminhtml/session')->getDesignData(true); if (!$formData){ $formData = Mage::registry('design')->getData(); } else { $formData = $formData['design']; } $form->addValues($formData); $form->setFieldNameSuffix('design'); $this->setForm($form); } }