00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 class Mage_Adminhtml_Block_System_Design_Edit_Tab_General extends Mage_Adminhtml_Block_Widget_Form
00027 {
00028
00029 protected function _prepareForm()
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
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
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 }
00087
00088 }