예제 #1
0
 protected function addProviderElements()
 {
     $element = new Zend_Form_Element_Hidden('providerElements');
     $element->setLabel('TV.com Provider Configuration');
     $element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('feed_title');
     $element->setLabel('Feed title:');
     $element->addValidator(new Zend_Validate_StringLength(0, 128));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('feed_link');
     $element->setLabel('Feed link:');
     $element->addValidator(new Zend_Validate_StringLength(0, 255));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('feed_description');
     $element->setLabel('Feed description:');
     $element->addValidator(new Zend_Validate_StringLength(0, 255));
     $this->addElement($element);
     $this->addElement('Text', 'feed_language', array('label' => 'Feed language:', 'value' => 'en-us'));
     $this->addElement('Text', 'feed_copyright', array('label' => 'Feed copyright:'));
     $this->addElement('Text', 'feed_image_title', array('label' => 'Feed image title:'));
     $this->addElement('Text', 'feed_image_url', array('label' => 'Feed image url:'));
     $this->addElement('Text', 'feed_image_link', array('label' => 'Feed image link:'));
     $this->addElement('Text', 'feed_image_width', array('label' => 'Feed image width:'));
     $this->addElement('Text', 'feed_image_height', array('label' => 'Feed image height:'));
     $element = new Zend_Form_Element_Hidden('feed_url');
     $element->clearDecorators();
     $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl')));
     $this->addElement($element);
     $this->addDisplayGroup(array('feed_title', 'feed_link', 'feed_description', 'feed_language', 'feed_copyright'), 'feed', array('legend' => 'Feed Configuration', 'decorators' => array('FormElements', 'Fieldset')));
     $this->addDisplayGroup(array('feed_image_title', 'feed_image_url', 'feed_image_link', 'feed_image_width', 'feed_image_height'), 'feed_image', array('legend' => 'Feed Image Configuration', 'decorators' => array('FormElements', 'Fieldset')));
     $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
 }
 protected function addProviderElements()
 {
     $element = new Zend_Form_Element_Hidden('providerElements');
     $element->setLabel('DoubleClick Specific Configuration');
     $element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
     $this->addElements(array($element));
     $element = new Zend_Form_Element_Text('cue_points_provider');
     $element->setLabel('Cue Points Provider:');
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('items_per_page');
     $element->setLabel('Items Per Page:');
     $this->addElement($element);
     $this->setDefault('items_per_page', 100);
     $this->addDisplayGroup(array('cue_points_provider', 'items_per_page'), 'general_group', array('legend' => 'General', 'decorators' => array('FormElements', 'Fieldset')));
     $element = new Zend_Form_Element_Text('channel_title');
     $element->setLabel('Channel title:');
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('channel_description');
     $element->setLabel('Channel description:');
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('channel_link');
     $element->setLabel('Channel link:');
     $this->addElement($element);
     $element = new Zend_Form_Element_Checkbox('ignore_scheduling_in_feed');
     $element->setLabel('Ignore Scheduling In Feed, As Default Feed Behavior');
     $this->addElement($element);
     $this->addDisplayGroup(array('channel_title', 'channel_description', 'channel_link', 'ignore_scheduling_in_feed'), 'channel', array('legend' => 'Feed Configuration', 'decorators' => array('FormElements', 'Fieldset')));
     $element = new Zend_Form_Element_Hidden('feed_url');
     $element->clearDecorators();
     $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl')));
     $this->addElement($element);
     $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
 }
 protected function addProviderElements()
 {
     $this->setDescription(null);
     // Channel Configuration
     $this->addElement('text', 'channel_title', array('label' => 'Channel title:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_link', array('label' => 'Channel link:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_description', array('label' => 'Channel description:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_language', array('label' => 'Channel language:', 'filters' => array('StringTrim'), 'value' => 'en-us'));
     $this->addElement('text', 'channel_copyright', array('label' => 'Channel copyright:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_image_title', array('label' => 'Channel image title:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_image_url', array('label' => 'Channel image url:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_image_link', array('label' => 'Channel image link:', 'filters' => array('StringTrim')));
     $this->addDisplayGroup(array('channel_title', 'channel_link', 'channel_description', 'channel_language', 'channel_copyright', 'channel_image_title', 'channel_image_url', 'channel_image_link'), 'general', array('legend' => 'Channel Configuration', 'decorators' => array('FormElements', 'Fieldset')));
     // FTP Configuration
     $this->addElement('text', 'ftp_host', array('label' => 'FTP Host:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'ftp_login', array('label' => 'FTP Login:'******'filters' => array('StringTrim')));
     $this->addElement('text', 'ftp_password', array('label' => 'FTP Password:'******'filters' => array('StringTrim')));
     $this->addDisplayGroup(array('ftp_host', 'ftp_login', 'ftp_password'), 'sftp', array('legend' => 'FTP Configuration', 'decorators' => array('FormElements', 'Fieldset')));
     // Feed URL
     $element = new Zend_Form_Element_Hidden('feed_url');
     $element->clearDecorators();
     $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl')));
     $this->addElement($element);
     $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
 }
예제 #4
0
 /**
  * Initialization form
  */
 public function init()
 {
     // Вызываем родительский метод
     parent::init();
     //---------------- Форма ----------------
     // Указываем action формы
     $urlAction = $this->getUrl('login', 'account');
     $urlForgotPassword = $this->getUrl('fetchpassword', 'account');
     $this->setAction($urlAction);
     //Зададим метод передачи данных
     $this->setMethod('post');
     // Задаем атрибут class для формы
     $this->setAttrib('class', 'myfrm span5');
     $this->setAttrib('id', 'login-form');
     //$this->setAttrib('class', 'row');
     //---------- Имя пользователя --------------
     $this->addElement('text', 'username', array('label' => 'Имя входа пользователя', 'required' => true, 'filters' => array('StringTrim')));
     //---------- Пароль пользователя --------------
     $this->addElement('password', 'password', array('label' => 'Пароль', 'required' => true));
     //----------- Скрытый элемент для создания ссылки -----------
     //если пользователь забыл свой пароль
     $forgot_password = new Zend_Form_Element_Hidden('forgot_password', array('label' => $this->Translate('Забыли пароль') . '?'));
     $forgot_password->clearDecorators();
     $forgot_password->addDecorator('AnchorLabel', array('href' => $urlForgotPassword));
     $this->addElement($forgot_password);
     //--------- Добавим кнопку -----------
     $this->addElement('submit', 'send', array('ignore' => true, 'label' => 'Вход'));
     $this->getElement('send')->setAttrib('class', 'btn btn-primary');
     //---------------- Группа Авторизационные данные ----------------
     // Группируем элементы
     // Группа полей связанных с авторизационными данными
     $this->addDisplayGroup(array('username', 'password', 'forgot_password', 'send'), 'authDataGroup', array('legend' => 'Авторизационные данные'));
     //Добавим скрытый элемент для перенаправления входа пользователя
     $this->addElement('hidden', 'redirect', array());
 }
 protected function addProviderElements()
 {
     $this->setDescription(null);
     $element = new Zend_Form_Element_Hidden('feed_url');
     $element->clearDecorators();
     $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl')));
     $this->addElement($element);
     $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
 }
 protected function addProviderElements()
 {
     $this->setDescription(null);
     $element = new Zend_Form_Element_Hidden('feed_url');
     $element->clearDecorators();
     $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl')));
     $this->addElement($element);
     $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
     $this->addElement('text', 'background_image_wide', array('label' => 'Wide Background Image:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'background_image_standard', array('label' => 'Standard Background Image:', 'filters' => array('StringTrim')));
 }
 protected function addProviderElements()
 {
     $this->setDescription(null);
     $this->addElement('text', 'feed_title', array('label' => 'Feed Title:', 'filters' => array('StringTrim'), 'required' => true));
     $this->addElement('text', 'feed_subtitle', array('label' => 'Feed Subtitle:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'feed_link', array('label' => 'Feed Link:', 'filters' => array('StringTrim'), 'required' => true));
     $this->addElement('text', 'feed_author_name', array('label' => 'Feed Author Name:', 'filters' => array('StringTrim')));
     $this->addDisplayGroup(array('feed_title', 'feed_subtitle', 'feed_link', 'feed_author_name'), 'feed_default_values', array('legend' => 'Default Feed Values', 'decorators' => array('FormElements', 'Fieldset')));
     $element = new Zend_Form_Element_Hidden('feed_url');
     $element->clearDecorators();
     $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl')));
     $this->addElement($element);
     $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
 }
예제 #8
0
파일: Blog.php 프로젝트: Alexeykolobov/php
 public function init($blogid)
 {
     //echo $blogid; die;
     global $mySession;
     $db = new Db();
     $image_value = "";
     $blogtitle_value = "";
     $blogdesc_value = "";
     $status_value = "";
     $blog_value = "";
     $old_image_value = "";
     if ($blogid != "") {
         $Data = $db->runQuery("select * from " . BLOGPOST . " where blog_id='" . $blogid . "'");
         //$image_value=$Data[0]['post_image'];
         $blogtitle_value = $Data[0]['blog_title'];
         $blogdesc_value = $Data[0]['blog_desc'];
         $image_value = $Data[0]['blog_image'];
         $status_value = $Data[0]['blog_status'];
         $old_image_value = $Data[0]['blog_image'];
     }
     $old_image = new Zend_Form_Element_Hidden('old_image');
     $old_image->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($old_image_value);
     $this->addElement($old_image);
     $image = new Zend_Form_Element_File('image');
     $image->setDestination(SITE_ROOT . 'images/blogimg/');
     if ($blogid == "") {
         $image->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Please select a photo.'));
     }
     $image->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox")->addDecorator('Errors', array('class' => 'error'))->setValue($image_value);
     $this->addElement($image);
     $blogtitle = new Zend_Form_Element_Text('blogtitle');
     $blogtitle->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setAttrib("style", "width:165px;")->setValue($blogtitle_value);
     $this->addElement($blogtitle);
     $blog_description = new Zend_Form_Element_Textarea('blog_description');
     $blog_description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Please enter this field.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setAttrib("style", "width:170px; height:60px;")->setValue($blogdesc_value);
     $this->addElement($blog_description);
     //echo "dfs"; die;
     $StatusArr = array();
     $StatusArr[0]['key'] = "1";
     $StatusArr[0]['value'] = "Active";
     $StatusArr[1]['key'] = "0";
     $StatusArr[1]['value'] = "Inactive";
     $blog_status = new Zend_Form_Element_Select('blog_status');
     $blog_status->addMultiOptions($StatusArr)->setAttrib("class", "textInput")->setValue($status_value);
     $this->addElement($blog_status);
 }
예제 #9
0
 protected function addProviderElements()
 {
     $element = new Zend_Form_Element_Hidden('providerElements');
     $element->setLabel('AVN Provider Configuration');
     $element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('feed_title');
     $element->setLabel('Feed title:');
     $element->addValidator(new Zend_Validate_StringLength(0, 128));
     $this->addElement($element);
     $element = new Zend_Form_Element_Hidden('feed_url');
     $element->clearDecorators();
     $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl')));
     $this->addElement($element);
     $this->addDisplayGroup(array('feed_title', 'feed_link', 'feed_description'), 'feed', array('legend' => 'Feed Configuration', 'decorators' => array('FormElements', 'Fieldset')));
     $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
 }
예제 #10
0
 protected function addProviderElements()
 {
     $this->setDescription(null);
     $element = new Zend_Form_Element_Hidden('feed_url');
     $element->clearDecorators();
     $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl')));
     $this->addElement($element);
     $this->addElement('text', 'channel_title', array('label' => 'Channel title:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_link', array('label' => 'Channel link:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_description', array('label' => 'Channel description:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_language', array('label' => 'Channel language:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_copyright', array('label' => 'Channel copyright:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_image_title', array('label' => 'Channel image title:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_image_url', array('label' => 'Channel image url:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_image_link', array('label' => 'Channel image link:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'item_media_rating', array('label' => 'Item media rating:', 'filters' => array('StringTrim')));
     $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
 }
 protected function addProviderElements()
 {
     $this->setDescription('');
     $this->loadDefaultDecorators();
     $this->addDecorator('Description', array('placement' => 'prepend'));
     $element = new Zend_Form_Element_Hidden('providerElements');
     $element->setLabel('At&t Uverse Specific Configuration');
     $element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
     $this->addElements(array($element));
     $this->addElement('text', 'channel_title', array('label' => 'Channel Title:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'ftp_host', array('label' => 'FTP Host:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'ftp_username', array('label' => 'FTP user name:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'ftp_password', array('label' => 'FTP password:'******'filters' => array('StringTrim')));
     $this->addElement('text', 'ftp_path', array('label' => 'FTP Path:', 'filters' => array('StringTrim')));
     // Feed URL
     $element = new Zend_Form_Element_Hidden('feed_url');
     $element->clearDecorators();
     $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl')));
     $this->addElement($element);
     $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
     $this->addMetadataForm();
 }
 protected function addProviderElements()
 {
     $element = new Zend_Form_Element_Hidden('providerElements');
     $element->setLabel('Comcast MRSS Provider Configuration');
     $element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('feed_title');
     $element->setLabel('Feed title:');
     $element->setRequired(true);
     $element->addValidator(new Zend_Validate_StringLength(0, 38));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('feed_link');
     $element->setLabel('Feed link:');
     $element->addValidator(new Zend_Validate_StringLength(0, 80));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('feed_description');
     $element->setLabel('Feed description:');
     $element->setRequired(true);
     $element->addValidator(new Zend_Validate_StringLength(0, 128));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('feed_last_build_date');
     $element->setLabel('Feed last build date:');
     $element->setRequired(true);
     $date = new DateTime('now', new DateTimeZone('UTC'));
     $element->setValue(str_replace('+0000', 'Z', $date->format(DateTime::ISO8601)));
     // comcast used Z for UTC timezone in their example (2008-04-11T12:30:00Z)
     $this->addElement($element);
     $this->addElement('select', 'c_platform_tv_series_field', array('label' => 'cPlatform TV Series Field:'));
     $this->addElement('textarea', 'cplatform_xml', array('label' => 'cPlatform TV Series XML', 'rows' => 8));
     $this->addMetadataFieldsAsValues('c_platform_tv_series_field');
     $this->addDisplayGroup(array('feed_title', 'feed_link', 'feed_description', 'feed_last_build_date', 'cplatform_xml', 'c_platform_tv_series_field'), 'feed', array('legend' => 'Feed Configuration', 'decorators' => array('FormElements', 'Fieldset')));
     $element = new Zend_Form_Element_Hidden('feed_url');
     $element->clearDecorators();
     $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl')));
     $this->addElement($element);
     $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
 }
예제 #13
0
파일: Form.php 프로젝트: JellyBellyDev/zle
 /**
  * Add an hidden field to the form without any decorator
  *
  * @param string $name  Name of the hidden field
  * @param string $value Value for the hidden field
  *
  * @return void
  */
 public function addHidden($name, $value)
 {
     $hidden = new Zend_Form_Element_Hidden($name, array('value' => $value));
     $hidden->clearDecorators();
     $hidden->addDecorator('ViewHelper');
     $this->addElement($hidden);
 }
예제 #14
0
파일: User.php 프로젝트: Alexeykolobov/php
 public function init($userId)
 {
     global $mySession;
     $db = new Db();
     if ($userId != "") {
         $adminData = $db->runQuery("select * from " . USERS . " where user_id='" . $userId . "'");
         $first_name_value = $adminData[0]['first_name'];
         $last_name_value = $adminData[0]['last_name'];
         $email_address_value = $adminData[0]['email_address'];
         $old_profile_image_value = $adminData[0]['image'];
         $gender_value = $adminData[0]['gender'];
         //$dob_value=$adminData[0]['dob'];
         $dob_value = changeDate($adminData[0]['dob'], 1);
         $location_value = $adminData[0]['location'];
         $country_value = $adminData[0]['country'];
         $blog_url_value = $adminData[0]['blog_url'];
         $website_url_value = $adminData[0]['website_url'];
         $about_me_value = $adminData[0]['about_me'];
         $occupation_value = $adminData[0]['occupation'];
         //$password_value=md5($adminData[0]['password']);
     }
     $first_name = new Zend_Form_Element_Text('first_name');
     $first_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'First Name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($first_name_value);
     $this->addElement($first_name);
     $last_name = new Zend_Form_Element_Text('last_name');
     $last_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Last Name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setAttrib("onkeypress", "return checknummsp1(event);")->setValue($last_name_value);
     $this->addElement($last_name);
     $email_address = new Zend_Form_Element_Text('email_address');
     $email_address->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Email address is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($email_address_value);
     $this->addElement($email_address);
     if (@$_REQUEST['email_address'] != "") {
         $email_address->addValidator('EmailAddress', true)->addErrorMessage('Please enter a valid email address');
     }
     $old_profile_image = new Zend_Form_Element_Hidden('old_profile_image');
     $old_profile_image->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($old_profile_image_value);
     $this->addElement($old_profile_image);
     $user_pic = new Zend_Form_Element_File('user_pic');
     $user_pic->setDestination(SITE_ROOT . 'images/profileimgs/');
     if ($userId == "") {
         $user_pic->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Please select a photo.'));
     }
     $user_pic->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox")->addDecorator('Errors', array('class' => 'error'))->setValue($image_value);
     $this->addElement($user_pic);
     $GenderArr = array();
     $GenderArr[0]['key'] = "1";
     $GenderArr[0]['value'] = "Male";
     $GenderArr[1]['key'] = "2";
     $GenderArr[1]['value'] = "Female";
     $gender = new Zend_Form_Element_Radio('gender');
     $gender->addMultiOptions($GenderArr)->setValue($gender_value);
     $this->addElement($gender);
     $countryArr = array();
     $sql = "select * from " . COUNTRIES;
     $countryData = $db->runQuery($sql);
     $countryArr[0]['key'] = 0;
     $countryArr[0]['value'] = "---Select Country---";
     $i = 1;
     foreach ($countryData as $key => $data) {
         $countryArr[$i]['key'] = $data['country_id'];
         $countryArr[$i]['value'] = $data['country_name'];
         $i++;
     }
     $country = new Zend_Form_Element_Select('country');
     $country->setRequired(true)->addMultiOptions($countryArr)->addValidator('NotEmpty', true, array('messages' => 'Country is required.'))->addDecorator('Errors', array('class' => 'error'))->setValue($country_value);
     $this->addElement($country);
     $password = new Zend_Form_Element_Text('password');
     $password->setAttrib("class", "textInput")->setValue($password_value);
     $this->addElement($password);
     $cpassword = new Zend_Form_Element_Password('cpassword');
     $cpassword->setAttrib("class", "textInput")->setValue($password_value);
     $this->addElement($cpassword);
     $npassword = new Zend_Form_Element_Password('npassword');
     $npassword->setAttrib("class", "textInput")->setValue($password_value);
     $this->addElement($npassword);
     if (isset($_REQUEST['changePass']) && $userId != "") {
         $npassword->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Password is required.'))->addDecorator('Errors', array('class' => 'error'));
         $cpassword->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Confirm password is required.'))->addDecorator('Errors', array('class' => 'error'));
     }
     $GenderArr = array();
     $GenderArr[0]['key'] = "1";
     $GenderArr[0]['value'] = "Male";
     $GenderArr[1]['key'] = "2";
     $GenderArr[1]['value'] = "Female";
     $gender = new Zend_Form_Element_Radio('gender');
     $gender->addMultiOptions($GenderArr)->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Field is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($gender_value);
     $this->addElement($gender);
     $location = new Zend_Form_Element_Text('location');
     $location->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Location is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($location_value);
     $this->addElement($location);
     $occupation = new Zend_Form_Element_Text('occupation');
     $occupation->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Occupation is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($occupation_value);
     $this->addElement($occupation);
     $about_me = new Zend_Form_Element_Textarea('about_me');
     //$about_me->setRequired(true)
     //->addValidator('NotEmpty',true,array('messages' =>'Please enter this field.'))
     $about_me->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setAttrib("style", "width:150px; height:60px;")->setValue($about_me_value);
     $this->addElement($about_me);
     $blog_url = new Zend_Form_Element_Text('blog_url');
     //$blog_url->setRequired(true)
     //->addValidator('NotEmpty',true,array('messages' =>'Blog URL is required.'))
     $blog_url->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->addValidator('Hostname', true)->setAttrib("Placeholder", "http://")->setValue("{$website_url_value}");
     $this->addElement($blog_url);
     $website_url = new Zend_Form_Element_Text('website_url');
     //$website_url->setRequired(true)
     //->addValidator('NotEmpty',true,array('messages' =>'Website URL is required.'))
     $website_url->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->addValidator('Hostname', true)->setAttrib("Placeholder", "http://")->setValue("{$website_url_value}");
     $this->addElement($website_url);
 }