Protected Member Functions | |
_prepareForm () |
Definition at line 35 of file Form.php.
_prepareForm | ( | ) | [protected] |
Prepare form before rendering HTML
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 37 of file Form.php.
00038 { 00039 $userId = Mage::getSingleton('admin/session')->getUser()->getId(); 00040 $user = Mage::getModel('admin/user') 00041 ->load($userId); 00042 $user->unsetData('password'); 00043 00044 $form = new Varien_Data_Form(); 00045 00046 $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('adminhtml')->__('Account Information'))); 00047 00048 $fieldset->addField('username', 'text', array( 00049 'name' => 'username', 00050 'label' => Mage::helper('adminhtml')->__('User Name'), 00051 'title' => Mage::helper('adminhtml')->__('User Name'), 00052 'required' => true, 00053 ) 00054 ); 00055 00056 $fieldset->addField('firstname', 'text', array( 00057 'name' => 'firstname', 00058 'label' => Mage::helper('adminhtml')->__('First Name'), 00059 'title' => Mage::helper('adminhtml')->__('First Name'), 00060 'required' => true, 00061 ) 00062 ); 00063 00064 $fieldset->addField('lastname', 'text', array( 00065 'name' => 'lastname', 00066 'label' => Mage::helper('adminhtml')->__('Last Name'), 00067 'title' => Mage::helper('adminhtml')->__('Last Name'), 00068 'required' => true, 00069 ) 00070 ); 00071 00072 $fieldset->addField('user_id', 'hidden', array( 00073 'name' => 'user_id', 00074 ) 00075 ); 00076 00077 $fieldset->addField('email', 'text', array( 00078 'name' => 'email', 00079 'label' => Mage::helper('adminhtml')->__('Email'), 00080 'title' => Mage::helper('adminhtml')->__('User Email'), 00081 'required' => true, 00082 ) 00083 ); 00084 00085 $fieldset->addField('password', 'password', array( 00086 'name' => 'password', 00087 'label' => Mage::helper('adminhtml')->__('New Password'), 00088 'title' => Mage::helper('adminhtml')->__('New Password'), 00089 'class' => 'input-text validate-admin-password', 00090 ) 00091 ); 00092 00093 $fieldset->addField('confirmation', 'password', array( 00094 'name' => 'password_confirmation', 00095 'label' => Mage::helper('adminhtml')->__('Password Confirmation'), 00096 'class' => 'input-text validate-cpassword', 00097 ) 00098 ); 00099 00100 $form->setValues($user->getData()); 00101 $form->setAction($this->getUrl('*/system_account/save')); 00102 $form->setMethod('post'); 00103 $form->setUseContainer(true); 00104 $form->setId('edit_form'); 00105 00106 $this->setForm($form); 00107 00108 return parent::_prepareForm(); 00109 }