Public Member Functions | |
__construct () | |
Protected Member Functions | |
_prepareForm () |
Definition at line 35 of file Form.php.
__construct | ( | ) |
Init form
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 41 of file Form.php.
00042 { 00043 parent::__construct(); 00044 $this->setId('block_form'); 00045 $this->setTitle(Mage::helper('cms')->__('Block Information')); 00046 }
_prepareForm | ( | ) | [protected] |
Prepare form before rendering HTML
Check is single store mode
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 48 of file Form.php.
00049 { 00050 $model = Mage::registry('cms_block'); 00051 00052 $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post')); 00053 00054 $form->setHtmlIdPrefix('block_'); 00055 00056 $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('cms')->__('General Information'), 'class' => 'fieldset-wide')); 00057 00058 if ($model->getBlockId()) { 00059 $fieldset->addField('block_id', 'hidden', array( 00060 'name' => 'block_id', 00061 )); 00062 } 00063 00064 $fieldset->addField('title', 'text', array( 00065 'name' => 'title', 00066 'label' => Mage::helper('cms')->__('Block Title'), 00067 'title' => Mage::helper('cms')->__('Block Title'), 00068 'required' => true, 00069 )); 00070 00071 $fieldset->addField('identifier', 'text', array( 00072 'name' => 'identifier', 00073 'label' => Mage::helper('cms')->__('Identifier'), 00074 'title' => Mage::helper('cms')->__('Identifier'), 00075 'required' => true, 00076 'class' => 'validate-xml-identifier', 00077 )); 00078 00079 /** 00080 * Check is single store mode 00081 */ 00082 if (!Mage::app()->isSingleStoreMode()) { 00083 $fieldset->addField('store_id', 'multiselect', array( 00084 'name' => 'stores[]', 00085 'label' => Mage::helper('cms')->__('Store View'), 00086 'title' => Mage::helper('cms')->__('Store View'), 00087 'required' => true, 00088 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true), 00089 )); 00090 } 00091 else { 00092 $fieldset->addField('store_id', 'hidden', array( 00093 'name' => 'stores[]', 00094 'value' => Mage::app()->getStore(true)->getId() 00095 )); 00096 $model->setStoreId(Mage::app()->getStore(true)->getId()); 00097 } 00098 00099 $fieldset->addField('is_active', 'select', array( 00100 'label' => Mage::helper('cms')->__('Status'), 00101 'title' => Mage::helper('cms')->__('Status'), 00102 'name' => 'is_active', 00103 'required' => true, 00104 'options' => array( 00105 '1' => Mage::helper('cms')->__('Enabled'), 00106 '0' => Mage::helper('cms')->__('Disabled'), 00107 ), 00108 )); 00109 00110 $fieldset->addField('content', 'editor', array( 00111 'name' => 'content', 00112 'label' => Mage::helper('cms')->__('Content'), 00113 'title' => Mage::helper('cms')->__('Content'), 00114 'style' => 'height:36em', 00115 'wysiwyg' => false, 00116 'required' => true, 00117 )); 00118 00119 $form->setValues($model->getData()); 00120 $form->setUseContainer(true); 00121 $this->setForm($form); 00122 00123 return parent::_prepareForm(); 00124 }