public function init() { //parent::init(); $this->addDecorators(array('FormElements')); $fields = Engine_Api::_()->getApi('core', 'fields')->getFieldsMeta($this->_type); foreach ($fields as $field) { if (!$field->search || !$field->alias) { continue; } $key = $field->alias; // Hack for birthday type fields $params = $field->getElementParams($this->_type, array('required' => false)); // Range type fields if ($field->type == 'date' || $field->type == 'birthdate' || $field->type == 'float') { $subform = new Engine_Form(array('description' => $params['options']['label'], 'elementsBelongTo' => $key, 'decorators' => array('FormElements', array('Description', array('placement' => 'PREPEND', 'tag' => 'label', 'class' => 'form-label')), array('HtmlTag', array('tag' => 'div', 'class' => 'integer_field form-wrapper integer_field_unselected', 'id' => 'integer-wrapper'))))); //Engine_Form::enableForm($subform); unset($params['options']['label']); $params['options']['decorators'] = array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'form-element'))); $subform->addElement($params['type'], 'min', $params['options']); $subform->addElement($params['type'], 'max', $params['options']); $this->addSubForm($subform, $key); } else { $this->addElement($params['type'], $key, $params['options']); } $element = $this->getElement($key); } $this->addElement('Button', 'done', array('label' => 'Search', 'type' => 'submit')); }
public function init() { $this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'))->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array())); parent::init(); $this->addElement('Text', 'search', array('label' => 'Search Music:')); $this->addElement('Select', 'sort', array('label' => 'Browse By:', 'multiOptions' => array('recent' => 'Most Recent', 'popular' => 'Most Popular'))); }
public function render(Zend_View_Interface $view = null) { if ($this->isEmailAntispamEnabled()) { $this->{$this->_orgEmailFieldName}->setValue(''); } return parent::render($view); }
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)); }
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)); }
public function getValues() { $values = parent::getValues(); $address = trim($values['address']); $keyword = trim($values['keyword']); $zipcode = $values['zipcode']; $values['keyword'] = $keyword; $values['address'] = $address; $values['address_pattern'] = "%%"; if ($keyword) { if ($values['match']) { $values['keyword_pattern'] = implode('|', array_map(array($this, 'boundWord'), preg_split('#\\s+#', $keyword))); } else { $values['keyword_partern'] = $this->boundWord(implode('|', preg_split('#\\s+#', $keyword))); } } else { $values['keyword_pattern'] = ''; } try { $position = Engine_Api::_()->ynevent()->getPositionsAction($zipcode); $values['lat'] = $position[0]; $values['lon'] = $position[1]; } catch (Exception $e) { $values['lat'] = 0; $values['lon'] = 0; if (APPLICATION_ENV == 'development') { throw $e; } } // $values. return $values; }
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)); }
public function init() { $this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'))->setMethod('GET')->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array('page' => null))); parent::init(); $this->addElement('Text', 'search', array('label' => 'Search Polls:')); $this->addElement('Select', 'show', array('label' => 'Show', 'multiOptions' => array('1' => 'Everyone\'s Polls', '2' => 'Only My Friends\' Polls'), 'onchange' => 'searchPolls();')); $this->addElement('Select', 'closed', array('label' => 'Status', 'onchange' => 'searchPolls();', 'multiOptions' => array('' => 'All Polls', '0' => 'Only Open Polls', '1' => 'Only Closed Polls'))); $this->addElement('Select', 'order', array('label' => 'Browse By:', 'onchange' => 'searchPolls();', 'multiOptions' => array('recent' => 'Most Recent', 'popular' => 'Most Popular'))); }
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')); }
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'); }
public function getAdditionalOptionsElement() { $subform = new Zend_Form_SubForm(array('name' => 'extra', 'order' => 1000000, 'decorators' => array('FormElements'))); Engine_Form::enableForm($subform); $subform->addElement('Checkbox', 'has_photo', array('label' => 'Only Members With Photos', 'decorators' => array('ViewHelper', array('Label', array('placement' => 'APPEND', 'tag' => 'label')), array('HtmlTag', array('tag' => 'li'))))); $subform->addElement('Checkbox', 'is_online', array('label' => 'Only Online Members', 'decorators' => array('ViewHelper', array('Label', array('placement' => 'APPEND', 'tag' => 'label')), array('HtmlTag', array('tag' => 'li'))))); $subform->addElement('Button', 'done', array('label' => 'Search', 'onclick' => 'javascript:searchMembers()', 'ignore' => true)); $this->addSubForm($subform, $subform->getName()); return $this; }
/** * Load default decorators * * @return void */ public function loadDefaultDecorators() { if ($this->loadDefaultDecoratorsIsDisabled()) { return; } $decorators = $this->getDecorators(); if (empty($decorators)) { Engine_Form::addDefaultDecorators($this); } }
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'))); }
public function init() { $this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'))->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()))->setMethod('GET'); parent::init(); $this->addElement('Text', 'search', array('label' => 'Search Music:')); $this->addElement('Select', 'show', array('label' => 'Show', 'multiOptions' => array('1' => 'Everyone\'s Playlists', '2' => 'Only My Friends\' Playlists'))); $this->addElement('Select', 'sort', array('label' => 'Browse By:', 'multiOptions' => array('recent' => 'Most Recent', 'popular' => 'Most Popular'))); $this->addElement('Hidden', 'user'); $this->addElement('Hidden', 'page', array('order' => 100)); $this->addElement('Button', 'search_bt', array('label' => 'Search', 'type' => 'submit', 'order' => 101)); }
/** * 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); } }
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'); }
public function init() { $this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'))->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array())); parent::init(); $this->addElement('Text', 'search', array('label' => 'Search Albums:')); $this->addElement('Select', 'sort', array('label' => 'Browse By:', 'multiOptions' => array('recent' => 'Most Recent', 'popular' => 'Most Popular'))); // prepare categories $categories = Engine_Api::_()->getDbtable('categories', 'album')->getCategoriesAssoc(); if (count($categories) > 0) { $this->addElement('Select', 'category_id', array('label' => 'Category', 'multiOptions' => $categories)); } }
public function __construct($options = null) { if (is_array($options) && array_key_exists('isEditing', $options)) { $this->_isEditing = $options['isEditing']; unset($options['isEditing']); } if (is_array($options) && array_key_exists('category', $options)) { $this->_category = $options['category']; unset($options['category']); } parent::__construct($options); }
public function __construct($options = null) { if (array_key_exists('remove_title', $options)) { $this->_title = $options['remove_title']; unset($options['remove_title']); } if (array_key_exists('remove_description', $options)) { $this->_description = $options['remove_description']; unset($options['remove_description']); } parent::__construct($options); }
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; }
public function isValid($data) { $result = parent::isValid($data); if ($result) { $users = $this->getElement('users')->getValue(); $recipients = $this->getElement('recipients')->getValue(); if (empty($users) && empty($recipients)) { $this->addError('You have not entered any users or emails to invite joining event !'); $result = false; } } return $result; }
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'); }
public function init() { $this->setTitle('Delete Level')->setDescription('Are you sure you want to delete this level? Members in this level will be re-assigned to the default level.'); $level_id = new Zend_Form_Element_Hidden('level_id'); $level_id->addValidator('Int')->addValidator('DbRecordExists', array('table' => Engine_Api::_()->getDbtable('levels', 'authorization'), 'field' => 'level_id')); $this->addElements(array($level_id)); // Buttons $this->addElement('Button', 'submit', array('label' => 'Delete Level', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper'))); $this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'link' => true, 'prependText' => ' or ', 'href' => 'admin/levels', 'decorators' => array('ViewHelper'))); $this->addDisplayGroup(array('submit', 'cancel'), 'buttons'); $button_group = $this->getDisplayGroup('buttons'); Engine_Form::setFormElementTypeClasses($this); }
public function init() { $this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box')); parent::init(); $this->addElement('Text', 'search', array('label' => 'Search Albums:')); $this->addElement('Select', 'sort', array('label' => 'Browse By:', 'multiOptions' => array('recent' => 'Most Recent', 'popular' => 'Most Popular'))); // prepare categories $categories = Engine_Api::_()->getDbtable('categories', 'album')->getCategoriesAssoc(); if (count($categories) > 0) { $this->addElement('Select', 'category_id', array('label' => 'Category', 'multiOptions' => $categories)); } $this->addElement('Button', 'submit_btn', array('label' => 'Search', 'type' => 'submit', 'ignore' => true)); }
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'))); }
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'); }
public function init() { $this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'))->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array())); parent::init(); $this->addElement('Text', 'search', array('label' => 'Search Albums:')); $this->addElement('Select', 'sort', array('label' => 'Browse By:', 'multiOptions' => array('recent' => 'Most Recent', 'popular' => 'Most Popular'))); // prepare categories $categories = Engine_Api::_()->album()->getCategories(); if (count($categories) != 0) { $categories_prepared[0] = ""; foreach ($categories as $category) { $categories_prepared[$category->category_id] = $category->category_name; } // category field $this->addElement('Select', 'category_id', array('label' => 'Category', 'multiOptions' => $categories_prepared)); } }
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'))); }
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)); }
public function init() { $this->setTitle('Event Owner Transfer')->setDescription('Please choose a member you want to transfer the owner role to:')->setAttrib('class', 'global_form_popup')->setMethod('post')->setAttrib('id', 'ynevent_transfer'); $this->addElement('Text', 'to', array('autocomplete' => 'off')); Engine_Form::addDefaultDecorators($this->to); // Init to Values $this->addElement('Hidden', 'toValues', array('label' => 'Member', 'required' => true, 'allowEmpty' => false, 'style' => 'margin-top:-5px', 'order' => 1, 'validators' => array('NotEmpty'), 'filters' => array('HtmlEntities'))); Engine_Form::addDefaultDecorators($this->toValues); $this->addElement('Button', 'submit', array('label' => 'Submit', 'type' => 'submit', 'order' => 3, 'ignore' => true)); $onclick = 'parent.Smoothbox.close();'; $session = new Zend_Session_Namespace('mobile'); if ($session->mobile) { $onclick = ''; } $this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'order' => 4, 'link' => true, 'prependText' => ' or ', 'onclick' => $onclick)); $this->addDisplayGroup(array('submit', 'cancel'), 'buttons'); }