本文整理汇总了PHP中Engine_Form::addDefaultDecorators方法的典型用法代码示例。如果您正苦于以下问题:PHP Engine_Form::addDefaultDecorators方法的具体用法?PHP Engine_Form::addDefaultDecorators怎么用?PHP Engine_Form::addDefaultDecorators使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine_Form
的用法示例。
在下文中一共展示了Engine_Form::addDefaultDecorators方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$this->setTitle('Compose Message');
$this->setDescription('Create your new message with the form below. Your message can be addressed to up to 10 recipients.')->setAttrib('id', 'messages_compose');
$user_level = Engine_Api::_()->user()->getViewer()->level_id;
// init to
$this->addElement('Text', 'to', array('label' => 'Send To', 'autocomplete' => 'off'));
Engine_Form::addDefaultDecorators($this->to);
// Init to Values
$this->addElement('Hidden', 'toValues', array('label' => 'Send To', 'required' => true, 'allowEmpty' => false, 'order' => 2, 'validators' => array('NotEmpty'), 'filters' => array('HtmlEntities')));
Engine_Form::addDefaultDecorators($this->toValues);
// init title
$this->addElement('Text', 'title', array('label' => 'Subject', 'order' => 3, 'filters' => array(new Engine_Filter_Censor(), new Engine_Filter_HtmlSpecialChars())));
// init body - editor
$editor = Engine_Api::_()->getDbtable('permissions', 'authorization')->getAllowed('messages', $user_level, 'editor');
if ($editor == 'editor') {
$editorOptions = array('bbcode' => true, 'html' => true);
if (Engine_Api::_()->authorization()->isAllowed('album', $user, 'create')) {
$upload_url = Zend_Controller_Front::getInstance()->getRouter()->assemble(array('action' => 'upload-photo'), 'messages_general', true);
}
if (!empty($upload_url)) {
$editorOptions['upload_url'] = $upload_url;
$editorOptions['plugins'] = array('table', 'fullscreen', 'media', 'preview', 'paste', 'code', 'image', 'textcolor', 'jbimages', 'link');
$editorOptions['toolbar1'] = array('undo', 'redo', 'removeformat', 'pastetext', '|', 'code', 'media', 'image', 'jbimages', 'link', 'fullscreen', 'preview');
}
$this->addElement('TinyMce', 'body', array('disableLoadDefaultDecorators' => true, 'order' => 4, 'required' => true, 'editorOptions' => $editorOptions, 'allowEmpty' => false, 'decorators' => array('ViewHelper', 'Label', array('HtmlTag', array('style' => 'display: block;'))), 'filters' => array(new Engine_Filter_HtmlSpecialChars(), new Engine_Filter_Censor())));
} else {
// init body - plain text
$this->addElement('Textarea', 'body', array('label' => 'Message', 'order' => 4, 'required' => true, 'allowEmpty' => false, 'filters' => array(new Engine_Filter_HtmlSpecialChars(), new Engine_Filter_Censor(), new Engine_Filter_EnableLinks())));
}
// init submit
$this->addElement('Button', 'submit', array('label' => 'Send Message', 'order' => 5, 'type' => 'submit', 'ignore' => true));
}
示例2: init
public function init()
{
$this->setTitle('Compose Message');
$this->setDescription('Create your new message with the form below. Your message can be addressed to up to 10 recipients.')->setAttrib('id', 'notice_compose');
$user_level = Engine_Api::_()->user()->getViewer()->level_id;
// init to
$this->addElement('Text', 'to', array('label' => 'Send To', 'autocomplete' => 'off'));
Engine_Form::addDefaultDecorators($this->to);
// Init to Values
$this->addElement('Hidden', 'toValues', array('label' => 'Send To', 'required' => true, 'allowEmpty' => false, 'order' => 2, 'validators' => array('NotEmpty'), 'filters' => array('HtmlEntities')));
Engine_Form::addDefaultDecorators($this->toValues);
// init title
$this->addElement('Text', 'title', array('label' => 'Subject', 'order' => 4, 'filters' => array(new Engine_Filter_Censor(), new Engine_Filter_HtmlSpecialChars())));
// init body - editor
$editor = Engine_Api::_()->getDbtable('permissions', 'authorization')->getAllowed('messages', $user_level, 'editor');
if ($editor == 'editor') {
$this->addElement('TinyMce', 'body', array('disableLoadDefaultDecorators' => true, 'order' => 5, 'required' => true, 'editorOptions' => array('bbcode' => true, 'html' => true), 'allowEmpty' => false, 'decorators' => array('ViewHelper', 'Label', array('HtmlTag', array('style' => 'display: block;'))), 'filters' => array(new Engine_Filter_HtmlSpecialChars(), new Engine_Filter_Censor(), new Engine_Filter_EnableLinks())));
} else {
// init body - plain text
$this->addElement('Textarea', 'body', array('label' => 'Message', 'order' => 5, 'required' => true, 'allowEmpty' => false, 'filters' => array(new Engine_Filter_HtmlSpecialChars(), new Engine_Filter_Censor(), new Engine_Filter_EnableLinks())));
}
$this->addAdditionalElements();
$this->loadDefaultDecorators();
$this->getDecorator('Description')->setOption('escape', false);
// init submit
$this->addElement('Button', 'submit', array('label' => 'Send Message', 'order' => 7, 'type' => 'submit', 'ignore' => true));
}
示例3: init
public function init()
{
// Set form attributes
$this->setTitle('Create Advertisement');
$this->setDescription('Follow this guide to design and create a new advertisement.');
$this->setAttrib('id', 'form-upload');
$this->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));
// Title
$this->addElement('Text', 'name', array('label' => 'Advertisement Name', 'allowEmpty' => false, 'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', false, array(1, 64))), 'filters' => array('StripTags', new Engine_Filter_Censor(), new Engine_Filter_EnableLinks())));
$this->addElement('Radio', 'media_type', array('id' => 'mediatype', 'label' => 'Advertisement Media', 'onchange' => "updateTextFields(this)", 'multiOptions' => array("0" => "Upload Banner Image", "1" => "Insert Banner HTML"), 'description' => 'CORE_FORM_ADMIN_ADS_AD_MEDIATYPE_DESCRIPTION'));
// $this->media->getDecorator('Description')->setOption('placement', 'append');
// Init file
$fancyUpload = new Engine_Form_Element_FancyUpload('file');
$fancyUpload->clearDecorators()->addDecorator('FormFancyUpload')->addDecorator('viewScript', array('viewScript' => '_FancyUpload.tpl', 'placement' => ''));
Engine_Form::addDefaultDecorators($fancyUpload);
$fancyUpload->setLabel("Upload Banner Image");
$this->addElement($fancyUpload);
$this->addElement('Hidden', 'photo_id');
$this->addDisplayGroup(array('file'), 'upload_image');
$upload_image_group = $this->getDisplayGroup('upload_image');
$this->addElement('Textarea', 'html_code', array('label' => 'HTML Code'));
// Buttons
$this->addElement('Button', 'preview_html', array('label' => 'Preview', 'ignore' => true, 'onclick' => 'javascript:preview();', 'decorators' => array('ViewHelper')));
$this->addDisplayGroup(array('html_code', 'preview_html'), 'html_field');
$html_code_group = $this->getDisplayGroup('html_code');
// init submit
$this->addElement('Button', 'submit', array('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true));
}
示例4: init
public function init()
{
$this->setAttrib('enctype', 'multipart/form-data')->setAttrib('name', 'EditPhoto');
$this->addElement('Image', 'current', array('label' => 'Current Photo', 'ignore' => true, 'decorators' => array(array('ViewScript', array('viewScript' => '_formEditImage.tpl', 'class' => 'form element', 'testing' => 'testing')))));
Engine_Form::addDefaultDecorators($this->current);
$this->addElement('File', 'Filedata', array('label' => 'Choose New Photo', 'destination' => APPLICATION_PATH . '/public/temporary/', 'multiFile' => 1, 'validators' => array(array('Count', false, 1), array('Extension', false, 'jpg,jpeg,png,gif')), 'onchange' => 'javascript:uploadSignupPhoto();'));
$this->addElement('Hidden', 'coordinates', array('filters' => array('HtmlEntities')));
$this->addElement('Button', 'done', array('label' => 'Save Photo', 'type' => 'submit'));
}
示例5: init
public function init()
{
$this->setAttrib('enctype', 'multipart/form-data')->setAttrib('name', 'CropPhoto');
$this->addElement('Image', 'current', array('label' => 'Main Photo', 'ignore' => true, 'decorators' => array(array('ViewScript', array('viewScript' => '_formCropImage.tpl', 'class' => 'form element', 'testing' => 'testing')))));
Engine_Form::addDefaultDecorators($this->current);
$this->addElement('Hidden', 'coordinates', array('filters' => array('HtmlEntities')));
$this->addElement('Button', 'done', array('label' => 'Save Photo', 'type' => 'submit', 'onsubmit' => 'lassoEnd()', 'decorators' => array('ViewHelper')));
$this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'link' => true, 'prependText' => ' or ', 'href' => 'javascript:void(0)', 'onclick' => 'parent.Smoothbox.close()', 'class' => 'smoothbox', 'decorators' => array('ViewHelper')));
$this->addDisplayGroup(array('done', 'cancel'), 'buttons');
}
示例6: loadDefaultDecorators
/**
* Load default decorators
*
* @return void
*/
public function loadDefaultDecorators()
{
if ($this->loadDefaultDecoratorsIsDisabled()) {
return;
}
$decorators = $this->getDecorators();
if (empty($decorators)) {
Engine_Form::addDefaultDecorators($this);
}
}
示例7: init
public function init()
{
$view = Zend_Registry::get('Zend_View');
$settings = Engine_Api::_()->getApi('settings', 'core');
$viewer = Engine_Api::_()->user()->getViewer();
$this->setTitle('Edit Feedback');
//Category
$this->addElement('Select', 'category_id', array('required' => true, 'allowEmpty' => false, 'label' => '*Category'));
//Custom field
$customFields = new Ynfeedback_Form_Feedback_Fields(array_merge(array('item' => $this->_item), $this->_formArgs));
$this->addSubForms(array('fields' => $customFields));
//Business name
$this->addElement('Text', 'title', array('label' => '*Feedback', 'allowEmpty' => false, 'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', false, array(1, 100))), 'filters' => array('StripTags', new Engine_Filter_Censor())));
//description
$this->addElement('Textarea', 'description', array('label' => '*Description', 'allowEmpty' => false, 'required' => true, 'filters' => array(), 'validators' => array(array('NotEmpty', true))));
//Co-authors
$this->addElement('Text', 'to', array('label' => 'Co-authors', 'autocomplete' => 'off'));
Engine_Form::addDefaultDecorators($this->to);
// Init to Values
$this->addElement('Hidden', 'toValues', array('style' => 'margin-top:-5px', 'order' => 5, 'filters' => array('HtmlEntities')));
Engine_Form::addDefaultDecorators($this->toValues);
//Severity
$this->addElement('Select', 'severity', array('required' => true, 'allowEmpty' => false, 'label' => 'Severity'));
$tableSeverity = Engine_Api::_()->getDbTable('severities', 'ynfeedback');
$this->severity->addMultiOptions($tableSeverity->getSeverityArray());
// Privacy
$viewOptions = (array) Engine_Api::_()->authorization()->getAdapter('levels')->getAllowed('ynfeedback_idea', $viewer, 'auth_view');
$commentOptions = (array) Engine_Api::_()->authorization()->getAdapter('levels')->getAllowed('ynfeedback_idea', $viewer, 'auth_comment');
$availableLabels = array('everyone' => $view->translate('Everyone'), 'owner_network' => $view->translate('Friends and Networks'), 'owner_member_member' => $view->translate('Friends of Friends'), 'owner_member' => $view->translate('Friends Only'), 'owner' => $view->translate('Just Me'));
$viewOptions = array_intersect_key($availableLabels, array_flip($viewOptions));
$commentOptions = array_intersect_key($availableLabels, array_flip($commentOptions));
// View
if (!empty($viewOptions) && count($viewOptions) >= 1) {
// Make a hidden field
if (count($viewOptions) == 1) {
$this->addElement('hidden', 'auth_view', array('value' => key($viewOptions)));
// Make select box
} else {
$this->addElement('Select', 'auth_view', array('label' => 'Privacy', 'multiOptions' => $viewOptions, 'value' => key($viewOptions)));
}
}
// Comment
if (!empty($commentOptions) && count($commentOptions) >= 1) {
// Make a hidden field
if (count($commentOptions) == 1) {
$this->addElement('hidden', 'auth_comment', array('value' => key($commentOptions)));
// Make select box
} else {
$this->addElement('Select', 'auth_comment', array('label' => 'Comment Privacy', 'multiOptions' => $commentOptions, 'value' => key($commentOptions)));
}
}
$this->addElement('Button', 'submit_button', array('value' => 'submit_button', 'label' => 'Save Changes', 'onclick' => 'removeSubmit()', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper')));
$this->addElement('Cancel', 'cancel', array('label' => 'Cancel', 'link' => true, 'prependText' => ' or ', 'decorators' => array('ViewHelper')));
$this->addDisplayGroup(array('submit_button', 'cancel'), 'buttons', array('decorators' => array('FormElements', 'DivDivDivWrapper')));
}
示例8: loadDefaultDecorators
/**
* Load default decorators
*
* @return void
*/
public function loadDefaultDecorators()
{
if ($this->loadDefaultDecoratorsIsDisabled()) {
return;
}
$decorators = $this->getDecorators();
if (empty($decorators)) {
$this->addDecorator('Tooltip')->addDecorator('Image');
Engine_Form::addDefaultDecorators($this);
}
}
示例9: init
public function init()
{
$this->setAttrib('enctype', 'multipart/form-data')->setAttrib('name', 'EditPhoto');
$this->addElement('Image', 'current', array('label' => 'Current Photo', 'ignore' => true, 'decorators' => array(array('ViewScript', array('viewScript' => '_formEditImage.tpl', 'class' => 'form element', 'testing' => 'testing')))));
Engine_Form::addDefaultDecorators($this->current);
$this->addElement('File', 'Filedata', array('label' => 'Choose New Photo', 'destination' => APPLICATION_PATH . '/public/temporary/', 'multiFile' => 1, 'validators' => array(array('Count', false, 1), array('Extension', false, 'jpg,jpeg,png,gif')), 'onchange' => 'javascript:uploadSignupPhoto();'));
$this->addElement('Hidden', 'coordinates', array('filters' => array('HtmlEntities')));
$this->addElement('Button', 'done', array('label' => 'Save Photo', 'type' => 'submit', 'decorators' => array('ViewHelper')));
$this->addElement('Cancel', 'remove', array('label' => 'remove photo', 'link' => true, 'prependText' => ' or ', 'href' => Zend_Controller_Front::getInstance()->getRouter()->assemble(array('action' => 'remove-photo')), 'onclick' => null, 'class' => 'smoothbox', 'decorators' => array('ViewHelper')));
$this->addDisplayGroup(array('done', 'remove'), 'buttons');
}
示例10: init
public function init()
{
$auth = Engine_Api::_()->authorization()->context;
$user = $this->getItem();
$this->setTitle('Privacy Settings')->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));
// Init blocklist
$this->addElement('Hidden', 'blockList', array('label' => 'Blocked Members', 'description' => 'Adding a person to your block list makes your profile (and all of your other content) unviewable to them. Any connections you have to the blocked person will be canceled.', 'order' => -1));
Engine_Form::addDefaultDecorators($this->blockList);
// Init search
$this->addElement('Checkbox', 'search', array('label' => 'Do not display me in searches, browsing members, or the "Online Members" list.', 'checkedValue' => 0, 'uncheckedValue' => 1));
$availableLabels = array('owner' => 'Only Me', 'member' => 'Only My Followers', 'network' => 'Followers & Networks', 'registered' => 'All Registered Members', 'everyone' => 'Everyone');
// Init profile view
$view_options = (array) Engine_Api::_()->authorization()->getAdapter('levels')->getAllowed('user', $user, 'auth_view');
$view_options = array_intersect_key($availableLabels, array_flip($view_options));
$this->addElement('Radio', 'privacy', array('label' => 'Profile Privacy', 'description' => 'Who can view your profile?', 'multiOptions' => $view_options));
foreach ($this->_roles as $role) {
if (1 === $auth->isAllowed($user, $role, 'view')) {
$this->privacy->setValue($role);
}
}
$availableLabelsComment = array('owner' => 'Only Me', 'member' => 'Only My Followers', 'network' => 'Followers & Networks', 'registered' => 'All Registered Members');
// Init profile comment
$comment_options = (array) Engine_Api::_()->authorization()->getAdapter('levels')->getAllowed('user', $user, 'auth_comment');
$comment_options = array_intersect_key($availableLabelsComment, array_flip($comment_options));
$this->addElement('Radio', 'comment', array('label' => 'Profile Posting Privacy', 'description' => 'Who can post on your profile?', 'multiOptions' => $comment_options));
foreach ($this->_roles as $role) {
if (1 === $auth->isAllowed($user, $role, 'comment')) {
$this->comment->setValue($role);
}
}
$this->addElement('Radio', 'private_contact', array('label' => 'Private Contact Information', 'description' => 'Who can view my private contact information?', 'multiOptions' => array(0 => 'Everyone', 1 => 'Followers & Professionals', 2 => 'Professionals Only')));
$availableLabels = array('owner' => 'Only Me', 'member' => 'Only My Followers', 'network' => 'Followers & Networks', 'registered' => 'All Registered Members');
// Init profile view
$get_notification_options = (array) Engine_Api::_()->authorization()->getAdapter('levels')->getAllowed('ynmember_user', $user, 'auth_get_notification');
$get_notification_options = array_intersect_key($availableLabels, array_flip($get_notification_options));
$this->addElement('Radio', 'get_notification_privacy', array('label' => 'Get Notification Privacy', 'description' => 'Who can get notification for some of my action? Actions: Create new items.
Join/attend Club/Event.
All actions on members (follow/rate member, etc...).
Like/comment an item.', 'multiOptions' => $get_notification_options));
foreach ($this->_roles as $role) {
if (1 === $auth->isAllowed($user, $role, 'get_notification')) {
$this->get_notification_privacy->setValue($role);
}
}
// Init publishtypes
if (Engine_Api::_()->getApi('settings', 'core')->getSetting('activity.publish', true)) {
$this->addElement('MultiCheckbox', 'publishTypes', array('label' => 'Recent Activity Privacy', 'description' => 'Which of the following things do you want to have published about you in the recent activity feed? Note that changing this setting will only affect future news feed items.'));
}
// Init submit
$this->addElement('Button', 'submit', array('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true));
return $this;
}
示例11: init
public function init()
{
$this->setTitle('Ask for Recommendations')->setDescription('Search member who will be asked for recommendations.')->setAttrib('class', 'global_form_popup');
$this->addElement('Text', 'to', array('autocomplete' => 'off'));
Engine_Form::addDefaultDecorators($this->to);
// Init to Values
$this->addElement('Hidden', 'toValues', array('style' => 'margin-top:-5px', 'order' => 1, 'filters' => array('HtmlEntities')));
Engine_Form::addDefaultDecorators($this->toValues);
$this->addElement('Button', 'submit_btn', array('label' => 'Submit', 'type' => 'submit', 'order' => 3, 'ignore' => true, 'decorators' => array('ViewHelper')));
$onclick = 'parent.Smoothbox.close();';
$this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'order' => 4, 'link' => true, 'prependText' => ' or ', 'onclick' => $onclick, 'decorators' => array('ViewHelper')));
$this->addDisplayGroup(array('submit_btn', 'cancel'), 'buttons');
}
示例12: init
public function init()
{
$view = Zend_Registry::get('Zend_View');
$description = $view->translate('Search sport which will be added as your sport. You can add up to %s sport(s).', 2 - $this->getCount());
$this->setTitle('Add Sports')->setDescription($description)->setAttrib('class', 'global_form_popup');
$this->addElement('Text', 'to', array('autocomplete' => 'off'));
Engine_Form::addDefaultDecorators($this->to);
// Init to Values
$this->addElement('Hidden', 'toValues', array('style' => 'margin-top:-5px', 'order' => 1, 'filters' => array('HtmlEntities')));
Engine_Form::addDefaultDecorators($this->toValues);
$this->addElement('Button', 'submit_btn', array('label' => 'Submit', 'type' => 'submit', 'order' => 3, 'ignore' => true, 'decorators' => array('ViewHelper')));
$onclick = 'parent.Smoothbox.close();';
$this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'order' => 4, 'link' => true, 'prependText' => ' or ', 'onclick' => $onclick, 'decorators' => array('ViewHelper')));
$this->addDisplayGroup(array('submit_btn', 'cancel'), 'buttons');
}
示例13: init
public function init()
{
// Init to Values
$this->addElement('Hidden', 'toValues', array('label' => 'Blog Title', 'style' => 'margin-top:-5px', 'order' => 0, 'validators' => array('NotEmpty'), 'filters' => array('HtmlEntities')));
Engine_Form::addDefaultDecorators($this->toValues);
$this->addElement('Text', 'to', array('label' => 'Blog Title', 'autocomplete' => 'off', 'order' => 1, 'required' => true, 'allowEmpty' => false, 'description' => 'Start typing a blog title to see a list of suggestions'));
Engine_Form::addDefaultDecorators($this->to);
$this->to->getDecorator("Description")->setOption("placement", "append");
$this->to->setAttrib('required', true);
$this->addElement('Dummy', 'import', array('decorators' => array(array('ViewScript', array('viewScript' => '_import.tpl', 'class' => 'form element')))));
$this->addElement('Button', 'submit', array('label' => 'Import', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper')));
$this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'link' => true, 'prependText' => ' or ', 'href' => '', 'onclick' => 'parent.Smoothbox.close();', 'decorators' => array('ViewHelper')));
// DisplayGroup: buttons
$this->addDisplayGroup(array('submit', 'cancel'), 'buttons', array('decorators' => array('FormElements', 'DivDivDivWrapper')));
}
示例14: init
public function init()
{
$user = Engine_Api::_()->user()->getViewer();
$this->setTitle('Create New Sponsor')->setAttrib('id', 'ynrespnosive_sponsor_create_form')->setAttrib('class', 'global_form_popup')->setMethod("POST")->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));
$this->addElement('Text', 'to', array('autocomplete' => 'off', 'label' => 'Select an Existing Event as Reference'));
Engine_Form::addDefaultDecorators($this->to);
// Init to Values
$this->addElement('Hidden', 'toValues', array('label' => 'Select an Existing Event as Reference', 'required' => true, 'allowEmpty' => false, 'style' => 'margin-top:-5px', 'order' => 1, 'validators' => array('NotEmpty'), 'filters' => array('HtmlEntities')));
Engine_Form::addDefaultDecorators($this->toValues);
// Photo
$this->addElement('File', 'photo', array('label' => 'Logo'));
$this->photo->addValidator('Extension', false, 'jpg,png,gif,jpeg');
// Buttons
$this->addElement('Button', 'submit', array('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper')));
$this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'link' => false, 'onClick' => 'javascript:parent.Smoothbox.close();', 'prependText' => ' or ', 'decorators' => array('ViewHelper')));
$this->addDisplayGroup(array('submit', 'cancel'), 'buttons', array('decorators' => array('FormElements', 'DivDivDivWrapper')));
}
示例15: init
public function init()
{
$this->setTitle('Compose Message');
$this->setDescription('Create your new message with the form below. Your message can be addressed to up to 10 recipients.')->setAttrib('id', 'messages_compose');
// init to
$this->addElement('Text', 'to', array('label' => 'Send To', 'autocomplete' => 'off'));
Engine_Form::addDefaultDecorators($this->to);
// Init to Values
$this->addElement('Hidden', 'toValues', array('required' => true, 'allowEmpty' => false, 'order' => 2, 'validators' => array('NotEmpty'), 'filters' => array('HtmlEntities')));
Engine_Form::addDefaultDecorators($this->toValues);
// init title
$this->addElement('Text', 'title', array('label' => 'Subject', 'order' => 3, 'filters' => array(new Engine_Filter_Censor(), new Engine_Filter_HtmlSpecialChars())));
// init body
$this->addElement('Textarea', 'body', array('label' => 'Message', 'order' => 4, 'required' => true, 'allowEmpty' => false, 'filters' => array(new Engine_Filter_HtmlSpecialChars(), new Engine_Filter_Censor(), new Engine_Filter_EnableLinks())));
// init submit
$this->addElement('Button', 'submit', array('label' => 'Send Message', 'order' => 5, 'type' => 'submit', 'ignore' => true));
}