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_Checkout_Agreement_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
00036 {
00037
00038
00039
00040
00041 public function __construct()
00042 {
00043 parent::__construct();
00044
00045 $this->setId('checkoutAgreementForm');
00046 $this->setTitle(Mage::helper('checkout')->__('Terms and Conditions Information'));
00047 }
00048
00049
00050
00051
00052
00053 protected function _prepareForm()
00054 {
00055 $model = Mage::registry('checkout_agreement');
00056 $form = new Varien_Data_Form(array(
00057 'id' => 'edit_form',
00058 'action' => $this->getData('action'),
00059 'method' => 'post'
00060 ));
00061
00062 $fieldset = $form->addFieldset('base_fieldset', array(
00063 'legend' => Mage::helper('checkout')->__('Terms and Conditions Information'),
00064 'class' => 'fieldset-wide',
00065 ));
00066
00067 if ($model->getId()) {
00068 $fieldset->addField('agreement_id', 'hidden', array(
00069 'name' => 'agreement_id',
00070 ));
00071 }
00072 $fieldset->addField('name', 'text', array(
00073 'name' => 'name',
00074 'label' => Mage::helper('checkout')->__('Condition Name'),
00075 'title' => Mage::helper('checkout')->__('Condition Name'),
00076 'required' => true,
00077 ));
00078
00079 $fieldset->addField('is_active', 'select', array(
00080 'label' => Mage::helper('checkout')->__('Status'),
00081 'title' => Mage::helper('checkout')->__('Status'),
00082 'name' => 'is_active',
00083 'required' => true,
00084 'options' => array(
00085 '1' => Mage::helper('checkout')->__('Enabled'),
00086 '0' => Mage::helper('checkout')->__('Disabled'),
00087 ),
00088 ));
00089
00090 $fieldset->addField('is_html', 'select', array(
00091 'label' => Mage::helper('checkout')->__('Show Content as'),
00092 'title' => Mage::helper('checkout')->__('Show Content as'),
00093 'name' => 'is_html',
00094 'required' => true,
00095 'options' => array(
00096 0 => Mage::helper('checkout')->__('Text'),
00097 1 => Mage::helper('checkout')->__('HTML'),
00098 ),
00099 ));
00100
00101 if (!Mage::app()->isSingleStoreMode()) {
00102 $fieldset->addField('store_id', 'multiselect', array(
00103 'name' => 'stores[]',
00104 'label' => Mage::helper('checkout')->__('Store View'),
00105 'title' => Mage::helper('checkout')->__('Store View'),
00106 'required' => true,
00107 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
00108 ));
00109 }
00110 else {
00111 $fieldset->addField('store_id', 'hidden', array(
00112 'name' => 'stores[]',
00113 'value' => Mage::app()->getStore(true)->getId()
00114 ));
00115 $model->setStoreId(Mage::app()->getStore(true)->getId());
00116 }
00117
00118 $fieldset->addField('checkbox_text', 'editor', array(
00119 'name' => 'checkbox_text',
00120 'label' => Mage::helper('checkout')->__('Checkbox text'),
00121 'title' => Mage::helper('checkout')->__('Checkbox text'),
00122 'rows' => '5',
00123 'cols' => '30',
00124 'wysiwyg' => false,
00125 'required' => true,
00126 ));
00127
00128 $fieldset->addField('content', 'editor', array(
00129 'name' => 'content',
00130 'label' => Mage::helper('checkout')->__('Content'),
00131 'title' => Mage::helper('checkout')->__('Content'),
00132 'style' => 'height:24em;',
00133 'wysiwyg' => false,
00134 'required' => true,
00135 ));
00136
00137 $fieldset->addField('content_height', 'text', array(
00138 'name' => 'content_height',
00139 'label' => Mage::helper('checkout')->__('Content Height (css)'),
00140 'title' => Mage::helper('checkout')->__('Content Height'),
00141 'maxlength' => 25,
00142 'class' => 'validate-css-length',
00143 ));
00144
00145 $form->setValues($model->getData());
00146 $form->setUseContainer(true);
00147 $this->setForm($form);
00148
00149 return parent::_prepareForm();
00150 }
00151 }