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
00027
00028
00029
00030
00031
00032
00033
00034
00035 class Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form
00036 {
00037
00038 protected function _prepareForm()
00039 {
00040 $model = Mage::registry('cms_page');
00041
00042 $form = new Varien_Data_Form();
00043
00044 $form->setHtmlIdPrefix('page_');
00045
00046 $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('cms')->__('General Information'),'class'=>'fieldset-wide'));
00047
00048 if ($model->getPageId()) {
00049 $fieldset->addField('page_id', 'hidden', array(
00050 'name' => 'page_id',
00051 ));
00052 }
00053
00054 $fieldset->addField('title', 'text', array(
00055 'name' => 'title',
00056 'label' => Mage::helper('cms')->__('Page Title'),
00057 'title' => Mage::helper('cms')->__('Page Title'),
00058 'required' => true,
00059 ));
00060
00061 $fieldset->addField('identifier', 'text', array(
00062 'name' => 'identifier',
00063 'label' => Mage::helper('cms')->__('SEF URL Identifier'),
00064 'title' => Mage::helper('cms')->__('SEF URL Identifier'),
00065 'required' => true,
00066 'class' => 'validate-identifier',
00067 'after_element_html' => '<p class="nm"><small>' . Mage::helper('cms')->__('(eg: domain.com/identifier)') . '</small></p>',
00068 ));
00069
00070
00071
00072
00073 if (!Mage::app()->isSingleStoreMode()) {
00074 $fieldset->addField('store_id', 'multiselect', array(
00075 'name' => 'stores[]',
00076 'label' => Mage::helper('cms')->__('Store View'),
00077 'title' => Mage::helper('cms')->__('Store View'),
00078 'required' => true,
00079 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
00080 ));
00081 }
00082 else {
00083 $fieldset->addField('store_id', 'hidden', array(
00084 'name' => 'stores[]',
00085 'value' => Mage::app()->getStore(true)->getId()
00086 ));
00087 $model->setStoreId(Mage::app()->getStore(true)->getId());
00088 }
00089
00090 $fieldset->addField('is_active', 'select', array(
00091 'label' => Mage::helper('cms')->__('Status'),
00092 'title' => Mage::helper('cms')->__('Page Status'),
00093 'name' => 'is_active',
00094 'required' => true,
00095 'options' => array(
00096 '1' => Mage::helper('cms')->__('Enabled'),
00097 '0' => Mage::helper('cms')->__('Disabled'),
00098 ),
00099 ));
00100
00101 $fieldset->addField('content', 'editor', array(
00102 'name' => 'content',
00103 'label' => Mage::helper('cms')->__('Content'),
00104 'title' => Mage::helper('cms')->__('Content'),
00105 'style' => 'height:36em;',
00106 'wysiwyg' => false,
00107 'required' => true,
00108 ));
00109
00110
00111 $form->setValues($model->getData());
00112 $this->setForm($form);
00113
00114 return parent::_prepareForm();
00115 }
00116 }