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_Tag_Tag_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
00036 {
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->setId('tag_form');
00041 $this->setTitle(Mage::helper('tag')->__('Block Information'));
00042 }
00043
00044 protected function _prepareForm()
00045 {
00046 $model = Mage::registry('tag_tag');
00047
00048 $form = new Varien_Data_Form(array(
00049 'id' => 'edit_form',
00050 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'), 'ret' => Mage::registry('ret'))),
00051 'method' => 'post'
00052 ));
00053
00054 $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('tag')->__('General Information')));
00055
00056 if ($model->getTagId()) {
00057 $fieldset->addField('tag_id', 'hidden', array(
00058 'name' => 'tag_id',
00059 ));
00060 }
00061
00062 $fieldset->addField('name', 'text', array(
00063 'name' => 'name',
00064 'label' => Mage::helper('tag')->__('Tag Name'),
00065 'title' => Mage::helper('tag')->__('Tag Name'),
00066 'required' => true,
00067 ));
00068
00069 $fieldset->addField('status', 'select', array(
00070 'label' => Mage::helper('tag')->__('Status'),
00071 'title' => Mage::helper('tag')->__('Status'),
00072 'name' => 'status',
00073 'required' => true,
00074 'options' => array(
00075 Mage_Tag_Model_Tag::STATUS_DISABLED => Mage::helper('tag')->__('Disabled'),
00076 Mage_Tag_Model_Tag::STATUS_PENDING => Mage::helper('tag')->__('Pending'),
00077 Mage_Tag_Model_Tag::STATUS_APPROVED => Mage::helper('tag')->__('Approved'),
00078 ),
00079 ));
00080
00081 $form->setValues($model->getData());
00082 $form->setUseContainer(true);
00083 $form->setAction( $this->getUrl($form->getAction(), array(
00084 'ret' => $this->getRequest()->getParam('ret'),
00085 'customer_id' => $this->getRequest()->getParam('customer_id'),
00086 'product_id' => $this->getRequest()->getParam('product_id'),
00087 )));
00088 $this->setForm($form);
00089 return parent::_prepareForm();
00090 }
00091
00092 }