public function init() { // contato_nome $contato_nome = new Zend_Form_Element_Text("contato_nome"); $contato_nome->setLabel("Nome"); $contato_nome->setRequired(); $contato_nome->setAttribs(array('class' => 'form-control')); $contato_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators); // contato_email $contato_email = new Zend_Form_Element_Text("contato_email"); $contato_email->setLabel("E-mail"); $contato_email->setRequired(); $contato_email->setAttribs(array('class' => 'form-control')); $contato_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators); // contato_assunto $contato_assunto = new Zend_Form_Element_Select("contato_assunto"); $contato_assunto->setLabel("Assunto"); $contato_assunto->setRequired(); $contato_assunto->setAttribs(array('class' => 'form-control')); $contato_assunto->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $contato_assunto->setMultiOptions(array("" => "Selecione o assunto...", "Informação" => "Informação", "Elogio" => "Eologio", "Crítica" => "Crítica", "Sugestão" => "Sugestão", "Outros" => "Outros")); // contato_mensagem $contato_mensagem = new Zend_Form_Element_Textarea("contato_mensagem"); $contato_mensagem->setLabel("mensagem"); $contato_mensagem->setRequired(); $contato_mensagem->setAttribs(array('class' => 'form-control', 'rows' => 5)); $contato_mensagem->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $this->addElements(array($contato_nome, $contato_email, $contato_assunto, $contato_mensagem)); parent::init(); }
public function init() { $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/preferences_soundcloud.phtml')))); //enable soundcloud uploads $this->addElement('checkbox', 'UseSoundCloud', array('label' => 'Upload Recorded Shows To SoundCloud', 'required' => false, 'value' => Application_Model_Preference::GetDoSoundCloudUpload(), 'decorators' => array('ViewHelper'))); //SoundCloud Username $this->addElement('text', 'SoundCloudUser', array('class' => 'input_text', 'label' => 'SoundCloud Email:', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetSoundCloudUser(), 'decorators' => array('ViewHelper'))); //SoundCloud Password $this->addElement('password', 'SoundCloudPassword', array('class' => 'input_text', 'label' => 'SoundCloud Password:'******'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetSoundCloudPassword(), 'decorators' => array('ViewHelper'))); // Add the description element $this->addElement('textarea', 'SoundCloudTags', array('label' => 'SoundCloud Tags: (separate tags with spaces)', 'required' => false, 'class' => 'input_text_area', 'value' => Application_Model_Preference::GetSoundCloudTags(), 'decorators' => array('ViewHelper'))); //SoundCloud default genre $this->addElement('text', 'SoundCloudGenre', array('class' => 'input_text', 'label' => 'Default Genre:', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetSoundCloudGenre(), 'decorators' => array('ViewHelper'))); $select = new Zend_Form_Element_Select('SoundCloudTrackType'); $select->setLabel('Default Track Type:'); $select->setAttrib('class', 'input_select'); $select->setMultiOptions(array("" => "", "original" => "Original", "remix" => "Remix", "live" => "Live", "recording" => "Recording", "spoken" => "Spoken", "podcast" => "Podcast", "demo" => "Demo", "in progress" => "Work in progress", "stem" => "Stem", "loop" => "Loop", "sound effect" => "Sound Effect", "sample" => "One Shot Sample", "other" => "Other")); $select->setRequired(false); $select->setValue(Application_Model_Preference::GetSoundCloudTrackType()); $select->setDecorators(array('ViewHelper')); $this->addElement($select); $select = new Zend_Form_Element_Select('SoundCloudLicense'); $select->setLabel('Default License:'); $select->setAttrib('class', 'input_select'); $select->setMultiOptions(array("" => "", "no-rights-reserved" => "The work is in the public domain", "all-rights-reserved" => "All rights are reserved", "cc-by" => "Creative Commons Attribution", "cc-by-nc" => "Creative Commons Attribution Noncommercial", "cc-by-nd" => "Creative Commons Attribution No Derivative Works", "cc-by-sa" => "Creative Commons Attribution Share Alike", "cc-by-nc-nd" => "Creative Commons Attribution Noncommercial Non Derivate Works", "cc-by-nc-sa" => "Creative Commons Attribution Noncommercial Share Alike")); $select->setRequired(false); $select->setValue(Application_Model_Preference::GetSoundCloudLicense()); $select->setDecorators(array('ViewHelper')); $this->addElement($select); }
public function init() { $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/add-show-rebroadcast.phtml')))); $relativeDates = array(); $relativeDates[""] = ""; for ($i = 0; $i <= 30; $i++) { $relativeDates["{$i} days"] = "+{$i} " . _("days"); } for ($i = 1; $i <= 10; $i++) { $select = new Zend_Form_Element_Select("add_show_rebroadcast_date_{$i}"); $select->setAttrib('class', 'input_select'); $select->setMultiOptions($relativeDates); $select->setRequired(false); $select->setDecorators(array('ViewHelper')); $this->addElement($select); $text = new Zend_Form_Element_Text("add_show_rebroadcast_time_{$i}"); $text->setAttrib('class', 'input_text'); $text->addFilter('StringTrim'); $text->addValidator('date', false, array('HH:mm')); $text->addValidator('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered'))); $text->setRequired(false); $text->setDecorators(array('ViewHelper')); $this->addElement($text); } }
public function __construct($options = null) { parent::__construct(); $this->setName('custom_layout_settings_form'); $this->addElementPrefixPath('Oibs_Form_Decorator', 'Oibs/Form/Decorator/', 'decorator'); //echo '<div class="clear"></div>'; $clear = new Oibs_Form_Element_Note('clear'); $clear->setValue('<div class="clear"></div>'); // Font $customfont = new Zend_Form_Element_Select('customfont'); $customfont->setLabel('Custom Font')->setAttrib('id', 'customfont')->addMultiOptions(array('Arial', 'Castellar', 'Times New Roman', 'Microsoft Sans Serif', 'Harrington')); // Font size $customfontsize = new Zend_Form_Element_Select('customfontsize'); $customfontsize->setLabel('Font Size')->setAttrib('id', 'customfontsize')->addMultiOptions(array('8', '10', '12', '14', '16')); $customsizeclear = new Oibs_Form_Element_Note('customsizeclear'); $customsizeclear->setValue('<div class="clear"></div>'); // Font color $customfontcolor = $openid = new Zend_Form_Element_Text('customfontcolor'); $customfontcolor->setLabel('Font Color')->setAttrib('id', 'customfontcolor')->setValue('#000000'); // Add elements to form $this->addElements(array($customfont, $clear, $customfontsize, $customfontcolor)); // Add decorators $customfont->setDecorators(array('InputDecorator')); $customfontsize->setDecorators(array('InputDecorator')); $customfontcolor->setDecorators(array('ColorPickerDecorator')); $this->setDecorators(array('FormElements', 'Form')); }
public function init() { $isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled' ? false : true; $this->isSaas = $isSaas; $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/preferences_general.phtml', "isSaas" => $isSaas)))); $defaultFade = Application_Model_Preference::GetDefaultFade(); if ($defaultFade == "") { $defaultFade = '0.500000'; } //Station name $this->addElement('text', 'stationName', array('class' => 'input_text', 'label' => 'Station Name', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetStationName(), 'decorators' => array('ViewHelper'))); //Default station fade $this->addElement('text', 'stationDefaultFade', array('class' => 'input_text', 'label' => 'Default Fade (s):', 'required' => false, 'filters' => array('StringTrim'), 'validators' => array(array('regex', false, array('/^[0-9]{1,2}(\\.\\d{1,6})?$/', 'messages' => 'enter a time in seconds 0{.000000}'))), 'value' => $defaultFade, 'decorators' => array('ViewHelper'))); $third_party_api = new Zend_Form_Element_Radio('thirdPartyApi'); $third_party_api->setLabel('Allow Remote Websites To Access "Schedule" Info?<br> (Enable this to make front-end widgets work.)'); $third_party_api->setMultiOptions(array("Disabled", "Enabled")); $third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi()); $third_party_api->setDecorators(array('ViewHelper')); $this->addElement($third_party_api); /* Form Element for setting the Timezone */ $timezone = new Zend_Form_Element_Select("timezone"); $timezone->setLabel("Timezone"); $timezone->setMultiOptions($this->getTimezones()); $timezone->setValue(Application_Model_Preference::GetTimezone()); $timezone->setDecorators(array('ViewHelper')); $this->addElement($timezone); /* Form Element for setting which day is the start of the week */ $week_start_day = new Zend_Form_Element_Select("weekStartDay"); $week_start_day->setLabel("Week Starts On"); $week_start_day->setMultiOptions($this->getWeekStartDays()); $week_start_day->setValue(Application_Model_Preference::GetWeekStartDay()); $week_start_day->setDecorators(array('ViewHelper')); $this->addElement($week_start_day); }
public function init() { $CC_CONFIG = Config::getConfig(); // Set the method for the display form to POST $this->setMethod('post'); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/login.phtml')))); // Add username element $this->addElement('text', 'username', array('label' => _('Username:'******'class' => 'input_text', 'required' => true, 'value' => isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1 ? 'admin' : '', 'filters' => array('StringTrim'), 'validators' => array('NotEmpty'), 'decorators' => array('ViewHelper'))); // Add password element $this->addElement('password', 'password', array('label' => _('Password:'******'class' => 'input_text', 'required' => true, 'value' => isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1 ? 'admin' : '', 'filters' => array('StringTrim'), 'validators' => array('NotEmpty'), 'decorators' => array('ViewHelper'))); $locale = new Zend_Form_Element_Select("locale"); $locale->setLabel(_("Language:")); $locale->setMultiOptions(Application_Model_Locale::getLocales()); $locale->setDecorators(array('ViewHelper')); $this->addElement($locale); $recaptchaNeeded = false; if (Application_Model_LoginAttempts::getAttempts($_SERVER['REMOTE_ADDR']) >= 3) { $recaptchaNeeded = true; } if ($recaptchaNeeded) { // recaptcha $this->addRecaptcha(); } // Add the submit button $this->addElement('submit', 'submit', array('ignore' => true, 'label' => _('Login'), 'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center', 'decorators' => array('ViewHelper'))); }
/** * * Edit Group form * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname)); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/EditGroup.phtml')))); // get group from database $request = Zend_Controller_Front::getInstance()->getRequest(); $group = $request->getParam('name'); $Profiles = new Application_Model_Profiles(); $ProfilesMeta = new Application_Model_ProfilesMeta(); $profile = $Profiles->getProfile($group, false, true); $owners_profile = $Profiles->getProfileByField('id', $profile->owner); $username_minchars = Zend_Registry::get('config')->get('username_minchars'); $username_maxchars = Zend_Registry::get('config')->get('username_maxchars'); // fields $id = new Zend_Form_Element_Hidden('id'); $id->setValue($profile->id); $name = new Zend_Form_Element_Text('name'); $name->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Group Name'))->setValue($profile->name)->setIgnore(true)->setAttrib('readonly', true)->setAttrib('class', 'form-control'); $screenname = new Zend_Form_Element_Text('screen_name'); $screenname->setDecorators(array('ViewHelper', 'Errors'))->addFilter('StringTrim')->setValue($profile->screen_name)->addValidator('alnum', false, array('allowWhiteSpace' => true))->addValidator('stringLength', false, array($username_minchars, $username_maxchars))->setErrorMessages(array(sprintf($this->translator->translate('Please choose a valid name between %d and %d characters'), $username_minchars, $username_maxchars)))->setLabel($this->translator->translate('Screen Name'))->setRequired(true)->setAttrib('class', 'form-control'); $description = new Zend_Form_Element_Textarea('description'); $description->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('COLS', '')->setAttrib('ROWS', '4')->addFilter('StripTags')->setValue($ProfilesMeta->getMetaValue('description', $profile->id))->setLabel($this->translator->translate('About this group'))->setAttrib('class', 'form-control'); $profile_privacy = new Zend_Form_Element_Select('profile_privacy'); $profile_privacy->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('group_privacy_array'))->setErrorMessages(array($this->translator->translate('Select group visibility')))->setLabel($this->translator->translate('Select group visibility'))->setRequired(true)->setValue($profile->profile_privacy)->setAttrib('class', 'form-control'); $is_hidden = new Zend_Form_Element_Checkbox('is_hidden'); $is_hidden->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($profile->is_hidden) && $profile->is_hidden == 1 ? 1 : 0)->setLabel($this->translator->translate('Remove?'))->setCheckedValue("1")->setUncheckedValue("0"); $submit = new Zend_Form_Element_Submit('formsubmit'); $submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Save'))->setAttrib('class', 'submit btn btn-default'); $this->addElements(array($id, $name, $screenname, $profile_privacy, $description, $is_hidden, $submit)); $this->postInit(); }
public function init() { // profissional_beleza_id $profissional_beleza_id = new Zend_Form_Element_Radio("profissional_beleza_id"); $profissional_beleza_id->setLabel("Selecione o profissional desejado: "); $profissional_beleza_id->setRegisterInArrayValidator(false); $profissional_beleza_id->setRequired(); $profissional_beleza_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); // agenda_data $agenda_data = new Zend_Form_Element_Text("agenda_data"); $agenda_data->setLabel("Selecione a data: "); $agenda_data->setAttribs(array('class' => 'form-control', 'autocomplete' => 'off')); $agenda_data->setRequired(); $agenda_data->setDecorators(App_Forms_Decorators::$simpleElementDecorators); // agenda_hora $agenda_hora = new Zend_Form_Element_Select("agenda_hora"); $agenda_hora->setLabel('Selecione a hora: '); $agenda_hora->setAttribs(array('class' => 'form-control')); $agenda_hora->setMultiOptions(array('' => 'Horários')); $agenda_hora->setRequired(); $agenda_hora->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $agenda_hora->setRegisterInArrayValidator(false); // agenda_observacao $agenda_observacao = new Zend_Form_Element_Textarea("agenda_observacao"); $agenda_observacao->setLabel("Observações: "); $agenda_observacao->setAttribs(array('class' => 'form-control', 'rows' => 7, 'placeholder' => 'Informe alguma observação, por exemplo, alguma preferência de produto, etc.')); // salao_id $salao_id = new Zend_Form_Element_Hidden('salao_id'); // especialidade_id $especialidade_id = new Zend_Form_Element_Hidden("especialidade_id"); // usuario_id $usuario_id = new Zend_Form_Element_Hidden("usuario_id"); $this->addElements(array($profissional_beleza_id, $agenda_data, $agenda_hora, $agenda_observacao, $salao_id, $especialidade_id, $usuario_id)); parent::init(); }
public function init() { $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/preferences_soundcloud.phtml')))); //enable soundcloud uploads $this->addElement('checkbox', 'UseSoundCloud', array('label' => _('Automatically Upload Recorded Shows'), 'required' => false, 'value' => Application_Model_Preference::GetAutoUploadRecordedShowToSoundcloud(), 'decorators' => array('ViewHelper'))); //enable soundcloud uploads option $this->addElement('checkbox', 'UploadToSoundcloudOption', array('label' => _('Enable SoundCloud Upload'), 'required' => false, 'value' => Application_Model_Preference::GetUploadToSoundcloudOption(), 'decorators' => array('ViewHelper'))); //enable downloadable for soundcloud $this->addElement('checkbox', 'SoundCloudDownloadbleOption', array('label' => _('Automatically Mark Files "Downloadable" on SoundCloud'), 'required' => false, 'value' => Application_Model_Preference::GetSoundCloudDownloadbleOption(), 'decorators' => array('ViewHelper'))); //SoundCloud Username $this->addElement('text', 'SoundCloudUser', array('class' => 'input_text', 'label' => _('SoundCloud Email'), 'filters' => array('StringTrim'), 'autocomplete' => 'off', 'value' => Application_Model_Preference::GetSoundCloudUser(), 'decorators' => array('ViewHelper'), 'allowEmpty' => false, 'validators' => array(new ConditionalNotEmpty(array('UploadToSoundcloudOption' => '1'))))); //SoundCloud Password $this->addElement('password', 'SoundCloudPassword', array('class' => 'input_text', 'label' => _('SoundCloud Password'), 'filters' => array('StringTrim'), 'autocomplete' => 'off', 'value' => Application_Model_Preference::GetSoundCloudPassword(), 'decorators' => array('ViewHelper'), 'allowEmpty' => false, 'validators' => array(new ConditionalNotEmpty(array('UploadToSoundcloudOption' => '1'))), 'renderPassword' => true)); // Add the description element $this->addElement('textarea', 'SoundCloudTags', array('label' => _('SoundCloud Tags: (separate tags with spaces)'), 'required' => false, 'class' => 'input_text_area', 'value' => Application_Model_Preference::GetSoundCloudTags(), 'decorators' => array('ViewHelper'))); //SoundCloud default genre $this->addElement('text', 'SoundCloudGenre', array('class' => 'input_text', 'label' => _('Default Genre:'), 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetSoundCloudGenre(), 'decorators' => array('ViewHelper'))); $select = new Zend_Form_Element_Select('SoundCloudTrackType'); $select->setLabel(_('Default Track Type:')); $select->setAttrib('class', 'input_select'); $select->setMultiOptions(array("" => "", "original" => _("Original"), "remix" => _("Remix"), "live" => _("Live"), "recording" => _("Recording"), "spoken" => _("Spoken"), "podcast" => _("Podcast"), "demo" => _("Demo"), "in progress" => _("Work in progress"), "stem" => _("Stem"), "loop" => _("Loop"), "sound effect" => _("Sound Effect"), "sample" => _("One Shot Sample"), "other" => _("Other"))); $select->setRequired(false); $select->setValue(Application_Model_Preference::GetSoundCloudTrackType()); $select->setDecorators(array('ViewHelper')); $this->addElement($select); $select = new Zend_Form_Element_Select('SoundCloudLicense'); $select->setLabel(_('Default License:')); $select->setAttrib('class', 'input_select'); $select->setMultiOptions(array("" => "", "no-rights-reserved" => _("The work is in the public domain"), "all-rights-reserved" => _("All rights are reserved"), "cc-by" => _("Creative Commons Attribution"), "cc-by-nc" => _("Creative Commons Attribution Noncommercial"), "cc-by-nd" => _("Creative Commons Attribution No Derivative Works"), "cc-by-sa" => _("Creative Commons Attribution Share Alike"), "cc-by-nc-nd" => _("Creative Commons Attribution Noncommercial Non Derivate Works"), "cc-by-nc-sa" => _("Creative Commons Attribution Noncommercial Share Alike"))); $select->setRequired(false); $select->setValue(Application_Model_Preference::GetSoundCloudLicense()); $select->setDecorators(array('ViewHelper')); $this->addElement($select); }
public function init() { $this->setName('transfer_source'); $this->setAttrib('class', 'form-inline'); $host1 = new Zend_Form_Element_Text('host1'); $host1->setAttrib('class', 'form-control')->setLabel('host1')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Hostname'); $edit = new Zend_Form_Element_Hidden('edit'); //$edit->setLabel('Edition Mode'); //$edit->clearDecorators(); $host1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3')))); $user1 = new Zend_Form_Element_Text('user1'); $user1->setLabel('user1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('EmailAddress'); $user1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3')))); $password1 = new Zend_Form_Element_Text('password1'); $password1->setLabel('pass1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $password1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3')))); $action = new Zend_Form_Element_Select('action'); $action->setOptions(array('1' => 'source', '2' => 'target')); $action->setAttrib('class', 'form-control'); $action->options = array('1' => 'source', '2' => 'target'); $action->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-2')))); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Submit'); $submit->setAttrib('class', 'btn btn-default'); $submit->setAttrib('value', 'transfer_source'); $submit->setDecorators(array('ViewHelper', 'Description', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'colspan' => 2, 'align' => 'center')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $this->addElements(array($edit, $host1, $user1, $password1, $action, $submit)); $this->setDecorators(array('FormElements', 'Form')); }
/** * * Themes & styles * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname)); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/SettingsStyles.phtml')))); // load settings $AppOptions = new Application_Model_AppOptions(); $all_meta = $AppOptions->getAllOptions(); // fields $themes_array = array('/bootstrap/css/bootstrap.min.css' => 'Bootstrap'); $css_theme = new Zend_Form_Element_Select('css_theme'); $css_theme->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions($themes_array)->setErrorMessages(array($this->translator->translate('Please select')))->setLabel($this->translator->translate('Choose css theme'))->setRequired(true)->setValue(isset($all_meta['css_theme']) ? $all_meta['css_theme'] : 'bootstrap')->setAttrib('class', 'form-control'); $wide_layout = new Zend_Form_Element_Checkbox('wide_layout'); $wide_layout->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['wide_layout']) && $all_meta['wide_layout'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Extra-wide layout on large screens'))->setCheckedValue("1")->setUncheckedValue("0"); $cover_ysize = new Zend_Form_Element_Text('cover_ysize'); $cover_ysize->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Cover image height'))->setValidators(array('digits'))->setRequired(true)->setValue(isset($all_meta['cover_ysize']) ? $all_meta['cover_ysize'] : '220')->setAttrib('class', 'form-control'); $user_background = new Zend_Form_Element_Checkbox('user_background'); $user_background->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['user_background']) && $all_meta['user_background'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Users can have custom background image'))->setCheckedValue("1")->setUncheckedValue("0"); $subscriber_background = new Zend_Form_Element_Checkbox('subscriber_background'); $subscriber_background->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['subscriber_background']) && $all_meta['subscriber_background'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Subscribers can have custom background image'))->setCheckedValue("1")->setUncheckedValue("0"); $custom_css = new Zend_Form_Element_Textarea('css_custom'); $custom_css->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('COLS', '')->setAttrib('ROWS', '15')->setValue(isset($all_meta['css_custom']) ? $all_meta['css_custom'] : '')->setLabel($this->translator->translate('Custom css'))->setAttrib('class', 'form-control'); $submit = new Zend_Form_Element_Submit('submitbtn'); $submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Update'))->setAttrib('class', 'submit btn btn-default'); $this->addElements(array($css_theme, $wide_layout, $cover_ysize, $user_background, $subscriber_background, $custom_css, $submit)); $this->postInit(); }
public function init() { // projeto_id $projeto_id = new Zend_Form_Element_Select("projeto_id"); $projeto_id->setLabel("Projeto: "); $projeto_id->setAttribs(array('class' => 'form-control')); $projeto_id->setMultiOptions($this->getProjetos()); // cliente_id $cliente_id = new Zend_Form_Element_Select("cliente_id"); $cliente_id->setLabel("Cliente: "); $cliente_id->setAttribs(array('class' => 'form-control')); $cliente_id->setRequired(false); $cliente_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $cliente_id->setMultiOptions($this->getClientes()); // faturamento_tipo $faturamento_tipo = new Zend_Form_Element_Select("faturamento_tipo"); $faturamento_tipo->setLabel("Tipo: "); $faturamento_tipo->setAttribs(array('class' => 'form-control')); $faturamento_tipo->setRequired(false); $faturamento_tipo->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $faturamento_tipo->setMultiOptions(array(1 => 'Boleto', 2 => 'Transferência')); // faturamento_valor $faturamento_valor = new Zend_Form_Element_Text("faturamento_valor"); $faturamento_valor->setLabel("Valor: "); $faturamento_valor->setAttribs(array('class' => 'form-control')); //$faturamento_valor->setRequired(); $faturamento_valor->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); // faturamento_descricao $faturamento_descricao = new Zend_Form_Element_Text("faturamento_descricao"); $faturamento_descricao->setLabel("Descrição: "); $faturamento_descricao->setAttribs(array('class' => 'form-control')); $faturamento_descricao->setRequired(); $faturamento_descricao->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); // faturamento_nosso_numero $faturamento_nosso_numero = new Zend_Form_Element_Text("faturamento_nosso_numero"); $faturamento_nosso_numero->setLabel("Nosso Nº: "); $faturamento_nosso_numero->setAttribs(array('class' => 'form-control')); //$faturamento_nosso_numero->setRequired(); $faturamento_nosso_numero->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); // faturamento_vencimento $faturamento_vencimento = new Zend_Form_Element_Text("faturamento_vencimento"); $faturamento_vencimento->setLabel("Vencimento: "); $faturamento_vencimento->setAttribs(array('class' => 'form-control')); $faturamento_vencimento->setRequired(); $faturamento_vencimento->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); // faturamento_nota_fiscal $faturamento_nota_fiscal = new Zend_Form_Element_File("faturamento_nota_fiscal"); $faturamento_nota_fiscal->setLabel("Nota Fiscal:"); $faturamento_nota_fiscal->addDecorators(App_Forms_Decorators::$ElementDecoratorFile); $faturamento_nota_fiscal->setAttribs(array('class' => 'filestyle', 'data-buttonText' => 'Selecione a Nota Fiscal', 'data-iconName' => 'fa fa-file')); //$faturamento_nota_fiscal->setRequired(); $faturamento_nota_fiscal->setDestination(Zend_Registry::get('config')->notafiscal->filepath); $faturamento_nota_fiscal->addValidators(array(array('Extension', false, 'pdf'))); $this->addElements(array($projeto_id, $cliente_id, $faturamento_tipo, $faturamento_vencimento, $faturamento_valor, $faturamento_nosso_numero, $faturamento_descricao, $faturamento_nota_fiscal)); parent::init(); }
public function populateShowInstances($possibleInstances, $default) { $possibleInstances["0"] = _("No Show"); $instance = new Zend_Form_Element_Select("his_instance_select"); //$instance->setLabel(_("Choose Show Instance")); $instance->setMultiOptions($possibleInstances); $instance->setValue($default); $instance->setDecorators(array('ViewHelper')); $this->addElement($instance); }
public function init() { // proposta_numero $proposta_numero = new Zend_Form_Element_Text("proposta_numero"); $proposta_numero->setLabel("Número: "); $proposta_numero->setAttribs(array('class' => 'form-control')); // proposta_tipo_id $proposta_tipo_id = new Zend_Form_Element_Select("proposta_tipo_id"); $proposta_tipo_id->setLabel("Tipo Proposta: "); $proposta_tipo_id->setAttribs(array('class' => 'form-control')); $proposta_tipo_id->setRequired(); $proposta_tipo_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $proposta_tipo_id->setMultiOptions($this->getPropostaTipo()); // cliente_id $cliente_id = new Zend_Form_Element_Select("cliente_id"); $cliente_id->setLabel("Cliente: "); $cliente_id->setAttribs(array('class' => 'form-control')); $cliente_id->setRequired(); $cliente_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $cliente_id->setMultiOptions($this->getClientes()); // tipo_servico_id $tipo_servico_id = new Zend_Form_Element_Select("tipo_servico_id"); $tipo_servico_id->setLabel("Tipo de Serviço: "); $tipo_servico_id->setAttribs(array('class' => 'form-control')); $tipo_servico_id->setRequired(); $tipo_servico_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $tipo_servico_id->setMultiOptions($this->getTipoServicos()); // proposta_horas $proposta_horas = new Zend_Form_Element_Text("proposta_horas"); $proposta_horas->setLabel("Horas: "); $proposta_horas->setAttribs(array('class' => 'form-control')); // proposta_valor $proposta_valor = new Zend_Form_Element_Text("proposta_valor"); $proposta_valor->setLabel("Valor: "); $proposta_valor->setAttribs(array('class' => 'form-control')); // proposta_data $proposta_data = new Zend_Form_Element_Text("proposta_data"); $proposta_data->setLabel("Data: "); $proposta_data->setAttribs(array('class' => 'form-control')); // proposta_vencimento $proposta_vencimento = new Zend_Form_Element_Text("proposta_vencimento"); $proposta_vencimento->setLabel("Vencimento: "); $proposta_vencimento->setAttribs(array('class' => 'form-control')); // proposta_documento $proposta_documento = new Zend_Form_Element_File("proposta_documento"); $proposta_documento->setLabel("Proposta:"); $proposta_documento->addDecorators(App_Forms_Decorators::$ElementDecoratorFile); $proposta_documento->setAttribs(array('class' => 'filestyle', 'data-buttonText' => 'Selecione o PDF', 'data-iconName' => 'fa fa-file')); //$proposta_documento->setRequired(); $proposta_documento->setDestination(Zend_Registry::get('config')->proposta->filepath); $proposta_documento->addValidators(array(array('Extension', false, 'pdf'))); $this->addElements(array($proposta_numero, $cliente_id, $proposta_tipo_id, $tipo_servico_id, $proposta_horas, $proposta_valor, $proposta_data, $proposta_vencimento, $proposta_documento)); parent::init(); }
public function init() { // proposta_id /* $proposta_id = new Zend_Form_Element_Select("proposta_id"); $proposta_id->setLabel("Proposta: "); $proposta_id->setAttribs(array( 'class' => 'form-control' )); $proposta_id->setMultiOptions($this->getPropostas()); */ // cliente $cliente = new Zend_Form_Element_Select("cliente"); $cliente->setLabel("Cliente: "); $cliente->setAttribs(array('class' => 'form-control')); $cliente->setRequired(false); $cliente->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $cliente->setMultiOptions($this->getClientes()); // cliente_id $cliente_id = new Zend_Form_Element_Hidden("cliente_id"); // projeto_nome $projeto_nome = new Zend_Form_Element_Text("projeto_nome"); $projeto_nome->setLabel("Nome: "); $projeto_nome->setAttribs(array('class' => 'form-control')); $projeto_nome->setRequired(); $projeto_nome->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); // projeto_horas /* $projeto_horas = new Zend_Form_Element_Text("projeto_horas"); $projeto_horas->setLabel("Horas: "); $projeto_horas->setAttribs(array( 'class' => 'form-control', 'readonly' => true )); $projeto_horas->setRequired(); $projeto_horas->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); */ // projeto_valor /* $projeto_valor = new Zend_Form_Element_Text("projeto_valor"); $projeto_valor->setLabel("Valor: "); $projeto_valor->setAttribs(array( 'class' => 'form-control', 'readonly' => true )); $projeto_valor->setRequired(); $projeto_valor->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); */ /** * Add Elements */ $this->addElements(array($cliente, $cliente_id, $projeto_nome)); parent::init(); }
protected function _id_dificuldade_evento() { $e = new Zend_Form_Element_Select('id_dificuldade_evento'); $e->setRequired(true)->setLabel(_('Level:')); $e->setAttrib('class', 'form-control'); $model = new Application_Model_DificuldadeEvento(); $rs = $model->fetchAll(); foreach ($rs as $item) { $e->addMultiOption($item->id_dificuldade_evento, $item->descricao_dificuldade_evento); } $e->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', ''), array('Label', ''))); return $e; }
public function init() { // especialidade_id $especialidade_id = new Zend_Form_Element_Select("especialidade_id"); $especialidade_id->setLabel('Especialidade: '); $especialidade_id->setRequired(); $especialidade_id->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $especialidade_id->setMultiOptions($this->getEspecialidades()); $especialidade_id->setAttribs(array('class' => 'form-control')); // profissional_beleza_id $profissional_beleza_id = new Zend_Form_Element_Select("profissional_beleza_id"); $profissional_beleza_id->setLabel('Profissional: '); $profissional_beleza_id->setRequired(); $profissional_beleza_id->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $profissional_beleza_id->setMultiOptions($this->getProfissionaisBeleza()); $profissional_beleza_id->setAttribs(array('class' => 'form-control')); // agenda_data $agenda_data = new Zend_Form_Element_Text("agenda_data"); $agenda_data->setLabel('Data: '); $agenda_data->setRequired(); $agenda_data->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $agenda_data->setAttribs(array('class' => 'form-control', 'autocomplete' => 'off')); // agenda_horario $agenda_horario = new Zend_Form_Element_Text("agenda_horario"); $agenda_horario->setLabel('Horário: '); $agenda_horario->setRequired(); $agenda_horario->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $agenda_horario->setAttribs(array('class' => 'form-control')); // agenda_manual_nome $agenda_manual_nome = new Zend_Form_Element_Text("agenda_manual_nome"); $agenda_manual_nome->setLabel('Cliente: '); $agenda_manual_nome->setRequired(); $agenda_manual_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $agenda_manual_nome->setAttribs(array('class' => 'form-control')); // agenda_manual_email $agenda_manual_email = new Zend_Form_Element_Text("agenda_manual_email"); $agenda_manual_email->setLabel('E-mail: '); //$agenda_manual_email->setRequired(); $agenda_manual_email->setAttribs(array('class' => 'form-control')); // agenda_manual_telefone $agenda_manual_telefone = new Zend_Form_Element_Text("agenda_manual_telefone"); $agenda_manual_telefone->setLabel('Telefone: '); $agenda_manual_telefone->setRequired(); $agenda_manual_telefone->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $agenda_manual_telefone->setAttribs(array('class' => 'form-control')); $this->addElements(array($especialidade_id, $profissional_beleza_id, $agenda_data, $agenda_horario, $agenda_manual_nome, $agenda_manual_email, $agenda_manual_telefone)); parent::init(); }
/** * * Edit post * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname)); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/EditPost.phtml')))); // fields $text = new Zend_Form_Element_Textarea('content'); $text->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('COLS', '')->setAttrib('ROWS', '8')->addFilter('StripTags')->setAttrib('class', 'form-control'); $privacy = new Zend_Form_Element_Select('privacy'); $privacy->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('post_privacy_array'))->setErrorMessages(array($this->translator->translate('Select post privacy')))->setLabel($this->translator->translate('Privacy'))->setAttrib('class', 'form-control'); $submit = new Zend_Form_Element_Submit('submitbutton'); $submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Save'))->setAttrib('class', 'submit btn btn-default'); $this->addElements(array($text, $privacy, $submit)); $this->postInit(); }
/** * * Edit Profile form * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname)); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/Profile.phtml')))); // get user from database $Profiles = new Application_Model_Profiles(); $ProfilesMeta = new Application_Model_ProfilesMeta(); $profile = $Profiles->getProfile(Zend_Auth::getInstance()->getIdentity()->name, true); $all_meta = $ProfilesMeta->getMetaValues($profile->id); $username_minchars = Zend_Registry::get('config')->get('username_minchars'); $username_maxchars = Zend_Registry::get('config')->get('username_maxchars'); // fields $id = new Zend_Form_Element_Hidden('id'); $id->setValue($profile->id); $name = new Zend_Form_Element_Text('name'); $name->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Username'))->setValue($profile->name)->setIgnore(true)->setAttrib('readonly', true)->setAttrib('class', 'form-control'); $email = new Zend_Form_Element_Text('email'); $email->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Email'))->setValue($profile->email)->setIgnore(true)->setAttrib('readonly', true)->setAttrib('class', 'form-control'); $screenname = new Zend_Form_Element_Text('screen_name'); $screenname->setDecorators(array('ViewHelper', 'Errors'))->addFilter('StringTrim')->setValue($profile->screen_name)->addValidator('alnum', false, array('allowWhiteSpace' => true))->addValidator('stringLength', false, array($username_minchars, $username_maxchars))->setErrorMessages(array(sprintf($this->translator->translate('Please choose a valid name between %d and %d characters'), $username_minchars, $username_maxchars)))->setLabel($this->translator->translate('Screen Name'))->setRequired(true)->setAttrib('class', 'form-control'); $description = new Zend_Form_Element_Textarea('description'); $description->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('COLS', '')->setAttrib('ROWS', '4')->addFilter('StripTags')->setValue(isset($all_meta['description']) ? $all_meta['description'] : '')->setLabel($this->translator->translate('About you'))->setAttrib('class', 'form-control'); $profile_privacy = new Zend_Form_Element_Select('profile_privacy'); $profile_privacy->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('profile_privacy_array'))->setErrorMessages(array($this->translator->translate('Select profile visibility')))->setLabel($this->translator->translate('Profile visibility'))->setRequired(true)->setValue($profile->profile_privacy)->setAttrib('class', 'form-control'); $birthday = new Application_Form_Element_Date('birthday'); $birthday->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('class', 'form-control')->setLabel($this->translator->translate('Date of birth'))->setErrorMessages(array($this->translator->translate('Please enter a valid date')))->setYearSpan(1920, date('Y') - 1); if (isset($all_meta['birthday'])) { $timestamp = strtotime($all_meta['birthday']); $birthday->setValue(array('day' => date('d', $timestamp), 'month' => date('m', $timestamp), 'year' => date('Y', $timestamp))); } $gender = new Zend_Form_Element_Select('gender'); $gender->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('genders_array'))->setErrorMessages(array($this->translator->translate('Please select something')))->setLabel($this->translator->translate('Gender'))->setRequired(true)->setValue(isset($all_meta['gender']) ? $all_meta['gender'] : '')->setAttrib('class', 'form-control'); $online_status = new Zend_Form_Element_Select('show_online_status'); $online_status->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('onlinestatus_array'))->setErrorMessages(array($this->translator->translate('Select profile visibility')))->setLabel($this->translator->translate('Online Status'))->setRequired(true)->setValue(isset($all_meta['show_online_status']) ? $all_meta['show_online_status'] : 's')->setAttrib('class', 'form-control'); $contact_privacy = new Zend_Form_Element_Select('contact_privacy'); $contact_privacy->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('contactprivacy_array'))->setErrorMessages(array($this->translator->translate('Please select something')))->setLabel($this->translator->translate('Who can contact me?'))->setRequired(true)->setValue(isset($all_meta['contact_privacy']) ? $all_meta['contact_privacy'] : 'e')->setAttrib('class', 'form-control'); $location = new Zend_Form_Element_Text('location'); $location->setDecorators(array('ViewHelper', 'Errors'))->setRequired(false)->setLabel($this->translator->translate('Location'))->setAttrib('class', 'form-control')->addFilter('StripTags')->setValue(isset($all_meta['location']) ? $all_meta['location'] : '')->setErrorMessages(array($this->translator->translate('Enter a valid location'))); $website = new Zend_Form_Element_Text('website'); $website->setDecorators(array('ViewHelper', 'Errors'))->setRequired(false)->setLabel($this->translator->translate('Website'))->setAttrib('class', 'form-control')->addFilter('StripTags')->setValue(isset($all_meta['website']) ? $all_meta['website'] : '')->setErrorMessages(array($this->translator->translate('Enter a valid website'))); $submit = new Zend_Form_Element_Submit('formsubmit'); $submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Save'))->setAttrib('class', 'submit btn btn-default form-control'); $this->addElements(array($id, $name, $email, $screenname, $gender, $profile_privacy, $online_status, $contact_privacy, $description, $location, $website, $birthday, $submit)); $this->postInit(); }
public function init() { $notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator(); $rangeValidator = Application_Form_Helper_ValidationTypes::overrideBetweenValidator(0, 59.9); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/preferences_general.phtml')))); $defaultFadeIn = Application_Model_Preference::GetDefaultFadeIn(); $defaultFadeOut = Application_Model_Preference::GetDefaultFadeOut(); //Station name $this->addElement('text', 'stationName', array('class' => 'input_text', 'label' => _('Station Name'), 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetStationName(), 'decorators' => array('ViewHelper'))); //Default station fade in $this->addElement('text', 'stationDefaultCrossfadeDuration', array('class' => 'input_text', 'label' => _('Default Crossfade Duration (s):'), 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array($rangeValidator, $notEmptyValidator, 'regex', false, array('/^[0-9]{1,2}(\\.\\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}')))), 'value' => Application_Model_Preference::GetDefaultCrossfadeDuration(), 'decorators' => array('ViewHelper'))); //Default station fade in $this->addElement('text', 'stationDefaultFadeIn', array('class' => 'input_text', 'label' => _('Default Fade In (s):'), 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array($rangeValidator, $notEmptyValidator, 'regex', false, array('/^[0-9]{1,2}(\\.\\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}')))), 'value' => $defaultFadeIn, 'decorators' => array('ViewHelper'))); //Default station fade out $this->addElement('text', 'stationDefaultFadeOut', array('class' => 'input_text', 'label' => _('Default Fade Out (s):'), 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array($rangeValidator, $notEmptyValidator, 'regex', false, array('/^[0-9]{1,2}(\\.\\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}')))), 'value' => $defaultFadeOut, 'decorators' => array('ViewHelper'))); $third_party_api = new Zend_Form_Element_Radio('thirdPartyApi'); $third_party_api->setLabel(sprintf(_('Allow Remote Websites To Access "Schedule" Info?%s (Enable this to make front-end widgets work.)'), '<br>')); $third_party_api->setMultiOptions(array(_("Disabled"), _("Enabled"))); $third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi()); $third_party_api->setDecorators(array('ViewHelper')); $this->addElement($third_party_api); $locale = new Zend_Form_Element_Select("locale"); $locale->setLabel(_("Default Interface Language")); $locale->setMultiOptions(Application_Model_Locale::getLocales()); $locale->setValue(Application_Model_Preference::GetDefaultLocale()); $locale->setDecorators(array('ViewHelper')); $this->addElement($locale); /* Form Element for setting the Timezone */ $timezone = new Zend_Form_Element_Select("timezone"); $timezone->setLabel(_("Station Timezone")); $timezone->setMultiOptions(Application_Common_Timezone::getTimezones()); $timezone->setValue(Application_Model_Preference::GetDefaultTimezone()); $timezone->setDecorators(array('ViewHelper')); $this->addElement($timezone); /* Form Element for setting which day is the start of the week */ $week_start_day = new Zend_Form_Element_Select("weekStartDay"); $week_start_day->setLabel(_("Week Starts On")); $week_start_day->setMultiOptions($this->getWeekStartDays()); $week_start_day->setValue(Application_Model_Preference::GetWeekStartDay()); $week_start_day->setDecorators(array('ViewHelper')); $this->addElement($week_start_day); }
public function init() { $user = Application_Model_User::getCurrentUser(); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/showbuilder.phtml')))); // Add start date element $startDate = new Zend_Form_Element_Text('sb_date_start'); $startDate->class = 'input_text'; $startDate->setRequired(true)->setLabel('Date Start:')->setValue(date("Y-m-d"))->setFilters(array('StringTrim'))->setValidators(array('NotEmpty', array('date', false, array('YYYY-MM-DD'))))->setDecorators(array('ViewHelper')); $startDate->setAttrib('alt', 'date'); $this->addElement($startDate); // Add start time element $startTime = new Zend_Form_Element_Text('sb_time_start'); $startTime->class = 'input_text'; $startTime->setRequired(true)->setValue('00:00')->setFilters(array('StringTrim'))->setValidators(array('NotEmpty', array('date', false, array('HH:mm')), array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered'))))->setDecorators(array('ViewHelper')); $startTime->setAttrib('alt', 'time'); $this->addElement($startTime); // Add end date element $endDate = new Zend_Form_Element_Text('sb_date_end'); $endDate->class = 'input_text'; $endDate->setRequired(true)->setLabel('Date End:')->setValue(date("Y-m-d"))->setFilters(array('StringTrim'))->setValidators(array('NotEmpty', array('date', false, array('YYYY-MM-DD'))))->setDecorators(array('ViewHelper')); $endDate->setAttrib('alt', 'date'); $this->addElement($endDate); // Add end time element $endTime = new Zend_Form_Element_Text('sb_time_end'); $endTime->class = 'input_text'; $endTime->setRequired(true)->setValue('01:00')->setFilters(array('StringTrim'))->setValidators(array('NotEmpty', array('date', false, array('HH:mm')), array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered'))))->setDecorators(array('ViewHelper')); $endTime->setAttrib('alt', 'time'); $this->addElement($endTime); // add a select to choose a show. $showSelect = new Zend_Form_Element_Select("sb_show_filter"); $showSelect->setLabel("Show:"); $showSelect->setMultiOptions($this->getShowNames()); $showSelect->setValue(null); $showSelect->setDecorators(array('ViewHelper')); $this->addElement($showSelect); if ($user->getType() === 'H') { $myShows = new Zend_Form_Element_Checkbox('sb_my_shows'); $myShows->setLabel('All My Shows:')->setDecorators(array('ViewHelper')); $this->addElement($myShows); } }
protected function _id_sala() { /*$salas = new Application_Model_Sala(); $salas->fetchAll(); $salasForm = $this->createElement('select', 'id_sala', array('label'=>'Salas: ')); foreach ($salas->fetchAll() as $sala){ $salasForm->addMultiOptions(array($sala->id_sala => $sala->nome_sala)); }*/ $e = new Zend_Form_Element_Select('id_sala'); $e->setRequired(true); $e->setLabel(_('Place:')); $e->setAttrib('class', 'form-control'); $model = new Application_Model_Sala(); $rs = $model->fetchAll(); foreach ($rs as $item) { $e->addMultiOption($item->id_sala, $item->nome_sala); } $e->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', ''), array('Label', ''))); return $e; }
public function init() { $this->setAction($this->_actionUrl)->setMethod('post')->setAttrib('class', 'form')->setAttrib('id', 'edit-privilege'); $this->clearDecorators(); $fieldDecorators = array(array('ViewHelper'), array('Errors'), array('HtmlTag', array('tag' => 'li'))); $buttonDecorators = array(array('ViewHelper'), array('HtmlTag', array('tag' => 'li', 'class' => 'submit'))); $defaultDecorators = array(array('ViewHelper'), array('HtmlTag', array('tag' => 'li', 'class' => ''))); $this->addElement('hidden', 'id')->setDecorators($fieldDecorators); //privilege information $accountNote = new Zend_Form_Element_Note('account_info'); $accountNote->setValue('<h3>Privilege Information</h3>')->setDecorators($defaultDecorators); $this->addElement($accountNote); //role field $roles = new Zend_Form_Element_Select('sys_role_id'); $roles->setLabel("Roles")->addMultiOptions(array('1' => 'Administrator', '2' => 'Scrum Master', '3' => 'Member')); $roles->setDecorators($fieldDecorators); $this->addElement($roles); //login button $this->addElement('submit', 'save'); $this->getElement('save')->setDecorators($buttonDecorators); $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')), array(array('DivTag' => 'HtmlTag'), array('tag' => 'div', 'class' => 'loginDiv')), 'Form')); }
/** * * Search Filter for Users * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname), false); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/SearchFilters.phtml')))); // GET - requiered for pagination to work $this->setMethod('get'); $this->setAction(Zend_Controller_Front::getInstance()->getBaseUrl() . '/search/users/'); $request = Zend_Controller_Front::getInstance()->getRequest(); $request_gender = $request->getParam('search_filter_gender'); // fields $genders_array = Zend_Registry::get('genders_array'); // append "All" at the top $genders_array = array_reverse($genders_array, true); $genders_array[''] = $this->translator->translate('All'); $genders_array = array_reverse($genders_array, true); $gender = new Zend_Form_Element_Select('search_filter_gender', array('onchange' => 'submit();')); $gender->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions($genders_array)->setErrorMessages(array($this->translator->translate('Please select')))->setLabel($this->translator->translate('Gender Filter'))->setValue($request_gender)->setAttrib('class', 'form-control'); $this->addElements(array($gender)); $this->postInit(); }
/** * * Add a Group * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname)); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/AddGroup.phtml')))); $username_minchars = Zend_Registry::get('config')->get('username_minchars'); $username_maxchars = Zend_Registry::get('config')->get('username_maxchars'); // fields // lowercase, alnum without whitespaces $name = new Zend_Form_Element_Text('name'); $name->setDecorators(array('ViewHelper', 'Errors'))->setRequired(true)->addFilter('StringToLower')->addValidator('alnum', false, array('allowWhiteSpace' => false))->addValidator('stringLength', false, array($username_minchars, $username_maxchars))->setErrorMessages(array(sprintf($this->translator->translate('Please choose a valid username between %d and %d characters'), $username_minchars, $username_maxchars)))->setLabel($this->translator->translate('Username'))->setAttrib('class', 'form-control alnum-only'); $screenname = new Zend_Form_Element_Text('screen_name'); $screenname->setDecorators(array('ViewHelper', 'Errors'))->addFilter('StringTrim')->addValidator('alnum', false, array('allowWhiteSpace' => true))->addValidator('stringLength', false, array($username_minchars, $username_maxchars))->setErrorMessages(array(sprintf($this->translator->translate('Please choose a valid name between %d and %d characters'), $username_minchars, $username_maxchars)))->setLabel($this->translator->translate('Screen Name'))->setRequired(true)->setAttrib('class', 'form-control'); $description = new Zend_Form_Element_Textarea('description'); $description->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('COLS', '')->setAttrib('ROWS', '4')->addFilter('StripTags')->setLabel($this->translator->translate('About this group'))->setAttrib('class', 'form-control'); $profile_privacy = new Zend_Form_Element_Select('profile_privacy'); $profile_privacy->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('group_privacy_array'))->setErrorMessages(array($this->translator->translate('Select group visibility')))->setLabel($this->translator->translate('Select group visibility'))->setRequired(true)->setAttrib('class', 'form-control'); $submit = new Zend_Form_Element_Submit('formsubmit'); $submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Save'))->setAttrib('class', 'submit btn btn-default'); $this->addElements(array($screenname, $name, $profile_privacy, $description, $submit)); $this->postInit(); }
/** * * Mail settings * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname)); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/Settings.phtml')))); // load settings $AppOptions = new Application_Model_AppOptions(); $all_meta = $AppOptions->getAllOptions(); // fields $mail_adapters = array('smtp' => 'smtp', 'mail' => 'php mail()'); $mail_adapter = new Zend_Form_Element_Select('mail_adapter'); $mail_adapter->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions($mail_adapters)->setLabel($this->translator->translate('Email adapter'))->setRequired(true)->setValue(isset($all_meta['mail_adapter']) ? $all_meta['mail_adapter'] : 'Zend_Mail_Transport_Smtp')->setAttrib('class', 'form-control'); $mail_host = new Zend_Form_Element_Text('mail_host'); $mail_host->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('(smtp) host'))->setValue(isset($all_meta['mail_host']) ? $all_meta['mail_host'] : 'example.com')->setAttrib('class', 'form-control'); $mail_port = new Zend_Form_Element_Text('mail_port'); $mail_port->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('(smtp) port (25/465/587)'))->setValidators(array('digits'))->setValue(isset($all_meta['mail_port']) ? $all_meta['mail_port'] : '465')->setAttrib('class', 'form-control'); $mail_login = new Zend_Form_Element_Select('mail_login'); $mail_login->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(array('login' => 'login', '' => 'open'))->setLabel($this->translator->translate('(smtp) auth method'))->setValue(isset($all_meta['mail_login']) ? $all_meta['mail_login'] : '******')->setAttrib('class', 'form-control'); $mail_security_methods = array('ssl' => 'ssl', 'tls' => 'tls', '' => 'none'); $mail_security = new Zend_Form_Element_Select('mail_security'); $mail_security->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions($mail_security_methods)->setLabel($this->translator->translate('(smtp) security'))->setValue(isset($all_meta['mail_security']) ? $all_meta['mail_security'] : 'ssl')->setAttrib('class', 'form-control'); $mail_username = new Zend_Form_Element_Text('mail_username'); $mail_username->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('name'))->setValue(isset($all_meta['mail_username']) ? $all_meta['mail_username'] : '')->setAttrib('class', 'form-control'); $mail_password = new Zend_Form_Element_Password('mail_password'); $mail_password->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('(smtp) auth password'))->setAttrib('autocomplete', 'off')->setRenderPassword(true)->setValue(isset($all_meta['mail_password']) ? $all_meta['mail_password'] : '')->setAttrib('class', 'form-control'); $mail_username = new Zend_Form_Element_Text('mail_username'); $mail_username->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('(smtp) auth username'))->setValue(isset($all_meta['mail_username']) ? $all_meta['mail_username'] : '')->setAttrib('class', 'form-control'); $mail_from = new Zend_Form_Element_Text('mail_from'); $mail_from->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('from'))->setValue(isset($all_meta['mail_from']) ? $all_meta['mail_from'] : '')->setAttrib('class', 'form-control'); $mail_from_name = new Zend_Form_Element_Text('mail_from_name'); $mail_from_name->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('from name'))->setValue(isset($all_meta['mail_from_name']) ? $all_meta['mail_from_name'] : '')->setAttrib('class', 'form-control'); $submit = new Zend_Form_Element_Submit('submitbtn'); $submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Update'))->setAttrib('class', 'submit btn btn-default'); $this->addElements(array($mail_adapter, $mail_from, $mail_from_name, $mail_host, $mail_port, $mail_security, $mail_login, $mail_username, $mail_password, $submit)); $this->postInit(); }
public function addListenerFields($listener) { $listener->addElement('text', 'FirstName', array('label' => 'First Name *', 'class' => 'form-control', 'placeholder' => 'First Name ', 'required' => true, 'filters' => array('StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'), 'validators' => array("Alpha"))); $listener->addElement('text', 'LastName', array('class' => 'form-control', 'label' => 'Last Name *', 'placeholder' => 'Last Name ', 'required' => true, 'filters' => array('StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'))); $listener->addElement('text', 'Birthdate', array('data-inputmask' => "'alias': 'mm/dd/yyyy'", 'class' => 'form-control date', 'placeholder' => 'mm/dd/yyyy', 'label' => 'Date of Birth *', 'required' => true, 'decorators' => array('ViewHelper', 'Label', 'Errors'))); $listener->addElement('text', 'Address', array('class' => 'form-control', 'label' => 'Street Address *', 'placeholder' => 'Street Address ', 'required' => true, 'filters' => array('StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'))); $listener->addElement('text', 'AlternativeAddress', array('class' => 'form-control', 'label' => 'Address Line 2', 'placeholder' => 'Alternative Address ', 'required' => false, 'filters' => array('StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'))); $listener->addElement('text', 'City', array('class' => 'form-control', 'label' => 'City *', 'placeholder' => 'City ', 'required' => true, 'filters' => array('StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'))); $listener->addElement('text', 'State', array('class' => 'form-control', 'label' => 'State *', 'placeholder' => 'State ', 'required' => true, 'filters' => array('StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'))); $listener->addElement('text', 'Zip', array('class' => 'form-control', 'label' => 'Zip *', 'placeholder' => 'Zip ', 'size' => 5, 'required' => true, 'filters' => array('StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'), 'validators' => array("Digits", array('StringLength', false, array(5, 5))))); $listener->addElement('text', 'HomePhone', array('class' => 'form-control phone', 'label' => 'Home Phone *', 'placeholder' => 'ex. (xxx) xxx-xxxx ', 'size' => 10, 'required' => true, 'filters' => array('Digits', 'StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'), 'validators' => array("Digits", array('StringLength', false, array(10, 10))))); $listener->addElement('text', 'CellPhone', array('class' => 'form-control phone', 'label' => 'Cell Phone ', 'placeholder' => 'ex. (xxx) xxx-xxxx ', 'size' => 10, 'required' => false, 'filters' => array('Digits', 'StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'), 'validators' => array("Digits", array('StringLength', false, array(10, 10))))); $listener->addElement('text', 'Email', array('class' => 'form-control', 'label' => 'Email', 'placeholder' => 'E-mail ', 'size' => 27, 'required' => false, 'filters' => array('StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'), 'validators' => array('EmailAddress'))); $listener->addElement('text', 'Disability', array('class' => 'form-control', 'label' => 'What is your print disability/reason requesting service? *', 'placeholder' => 'What is your print disability/reason requesting service? ', 'required' => true, 'size' => 62, 'filters' => array('StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'))); $listener->addElement('text', 'OtherDisability', array('class' => 'form-control', 'label' => 'Are there any other medical conditions we should know about? ', 'placeholder' => 'Other medical conditions? ', 'required' => false, 'size' => 62, 'filters' => array('StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'), 'validators' => array(array('Alnum', true, array('allowWhiteSpace' => true))))); $listener->addElement('text', 'HowLearn', array('class' => 'form-control', 'label' => 'How did you learn about the Audio Reading Service? *', 'placeholder' => 'How did you learn about the Audio Reading Service? ', 'required' => true, 'size' => 62, 'filters' => array('StringTrim'), 'decorators' => array('ViewHelper', 'Label', 'Errors'), 'validators' => array(array('Alnum', true, array('allowWhiteSpace' => true))))); $race = new Zend_Form_Element_Select('Race'); $race->setAttrib('class', 'form-control'); $race->setLabel("Race")->addMultiOptions(array('--' => '', 'Caucasian' => 'Caucasian', 'African American' => 'African American', 'Hispanic / Latino' => 'Hispanic / Latino', 'Native American' => 'Native American', 'Other' => 'Other')); $race->setDecorators(array('ViewHelper', 'Label')); $race->setRequired(false); $listener->addElement($race); $income = new Zend_Form_Element_Select('Income'); $income->setAttrib('class', 'form-control'); $income->setLabel("Income")->addMultiOptions(array('--' => '', 'Under $10,000' => 'Under $10,000', '$10,000 - 15,000' => '$10,000 - 15,000', '$15,001 - 20,000' => '$15,001 - 20,000', '$20,001 - 25,000' => '$20,001 - 25,000', '25,001 - 30,000' => '$25,001 - 30,000', '$30,001 - 45,000' => '$30,001 - 45,000', '$45,001 - 55,000' => '$45,001 - 55,000', 'Over $55,000' => 'Over $55,000')); $income->setDecorators(array('ViewHelper', 'Label')); $income->setRequired(false); $listener->addElement($income); $numInHome = new Zend_Form_Element_Select('NumberInHome'); $numInHome->setAttrib('class', 'form-control'); $numInHome->setLabel("Number in Household")->addMultiOptions(array('--' => '', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5 or more' => '5 or more')); $numInHome->setDecorators(array('ViewHelper', 'Label')); $numInHome->setRequired(false); $listener->addElement($numInHome); $listener->addDisplayGroup(array('Race', 'Income', 'NumberInHome'), 'seventh', array('decorators' => array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'dropdowns'))))); $listener->addElement('MultiCheckbox', 'Multi', array('class' => 'checkbox-inline big-checkbox', 'label' => 'Choose Your Preferred Format (Maximum of 2)', 'multioptions' => array('Large Print' => ' Large Print', 'Braille' => ' Braille', 'Audio CD' => ' Audio CD', 'Email' => ' Email'))); }
public function __construct($options = array()) { parent::__construct($options); $register = new Ot_Config_Register(); $vars = $register->getVars(); $varsByModule = array(); foreach ($vars as $v) { if (!isset($varsByModule[$v['namespace']])) { $varsByModule[$v['namespace']] = array(); } $varsByModule[$v['namespace']][] = $v['object']; } $section = new Zend_Form_Element_Select('section', array('label' => 'Select Configuration Section:')); $section->setDecorators(array('ViewHelper', array(array('wrapperField' => 'HtmlTag'), array('tag' => 'div', 'class' => 'select-control')), array('Label', array('placement' => 'prepend', 'class' => 'select-label')), array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'select-header')))); $this->addElement($section); $sectionOptions = array(); foreach ($varsByModule as $key => $value) { $group = array(); foreach ($value as $v) { //$elm = $v->getFormElement(); $elm = $v->renderFormElement(); $elm->setDecorators(array('ViewHelper', array('Errors', array('class' => 'help-inline')), array(array('wrapperField' => 'HtmlTag'), array('tag' => 'div', 'class' => 'fields')), array('Label', array('placement' => 'append', 'class' => 'field-label')), array('Description', array('placement' => 'append', 'tag' => 'div', 'class' => 'field-description')), array(array('empty' => 'HtmlTag'), array('placement' => 'append', 'tag' => 'div', 'class' => 'clearfix')), array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'field-group')))); $group[] = $elm->getName(); $this->addElement($elm); } $sectionOptions[preg_replace('/[^a-z]/i', '', $key)] = $key; $this->addDisplayGroup($group, $key); } asort($sectionOptions); $section->setMultiOptions($sectionOptions); $this->setDisplayGroupDecorators(array('FormElements', 'Fieldset')); $this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'Save Configuration')); $this->addElement('button', 'cancel', array('label' => 'form-button-cancel', 'type' => 'button')); $this->addDisplayGroup(array('submit', 'cancel'), 'actions', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); return $this; }
public function init() { // categoria_id $categoria_id = new Zend_Form_Element_Select("categoria_id"); $categoria_id->setLabel("Categoria: "); $categoria_id->setRequired(); $categoria_id->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $categoria_id->setAttribs(array('class' => 'form-control')); $categoria_id->setMultiOptions($this->getCategorias()); // especialidade_nome $especialidade_nome = new Zend_Form_Element_Text("especialidade_nome"); $especialidade_nome->setLabel("Nome Especialidade: "); $especialidade_nome->setRequired(); $especialidade_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $especialidade_nome->setAttribs(array('class' => 'form-control')); // especialidade_descricao $especialidade_descricao = new Zend_Form_Element_Textarea("especialidade_descricao"); $especialidade_descricao->setLabel("Descrição Especialidade: "); $especialidade_descricao->setRequired(); $especialidade_descricao->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $especialidade_descricao->setAttribs(array('class' => 'form-control', 'rows' => 5)); $this->addElements(array($categoria_id, $especialidade_nome, $especialidade_descricao)); parent::init(); }
/** * * General settings * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname)); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/Settings.phtml')))); // load settings $AppOptions = new Application_Model_AppOptions(); $all_meta = $AppOptions->getAllOptions(); // fields $limit_posts = new Zend_Form_Element_Text('limit_posts'); $limit_posts->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Max posts per page'))->setValidators(array('digits'))->setRequired(true)->setValue(isset($all_meta['limit_posts']) ? $all_meta['limit_posts'] : '5')->setAttrib('class', 'form-control'); $max_post_length = new Zend_Form_Element_Text('max_post_length'); $max_post_length->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Max post length'))->setValidators(array('digits'))->setRequired(true)->setValue(isset($all_meta['max_post_length']) ? $all_meta['max_post_length'] : '2000')->setAttrib('class', 'form-control'); $limit_comments = new Zend_Form_Element_Text('limit_comments'); $limit_comments->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Number of visible comments per resource'))->setValidators(array('digits'))->setRequired(true)->setValue(isset($all_meta['limit_comments']) ? $all_meta['limit_comments'] : '3')->setAttrib('class', 'form-control'); $pagination_limit = new Zend_Form_Element_Text('pagination_limit'); $pagination_limit->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Pagination limit'))->setValidators(array('digits'))->setRequired(true)->setValue(isset($all_meta['pagination_limit']) ? $all_meta['pagination_limit'] : '10')->setAttrib('class', 'form-control'); $max_scroll_fetches = new Zend_Form_Element_Text('max_scroll_fetches'); $max_scroll_fetches->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Maximum fetches on infinite scroll (0 = no limit)'))->setValidators(array('digits'))->setRequired(true)->setValue(isset($all_meta['max_scroll_fetches']) ? $all_meta['max_scroll_fetches'] : '0')->setAttrib('class', 'form-control'); $languages_array = array_merge(array('' => ''), Zend_Registry::get('languages_array')); $default_language = new Zend_Form_Element_Select('default_language'); $default_language->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions($languages_array)->setLabel($this->translator->translate('Choose default language'))->setRequired(true)->setValue(isset($all_meta['default_language']) ? $all_meta['default_language'] : '')->setAttrib('class', 'form-control'); $username_minchars = new Zend_Form_Element_Text('username_minchars'); $username_minchars->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Min chars for username'))->setValidators(array('digits'))->setRequired(true)->setValue(isset($all_meta['username_minchars']) ? $all_meta['username_minchars'] : '5')->setAttrib('class', 'form-control'); $username_maxchars = new Zend_Form_Element_Text('username_maxchars'); $username_maxchars->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Max chars for username'))->setValidators(array('digits'))->setRequired(true)->setValue(isset($all_meta['username_maxchars']) ? $all_meta['username_maxchars'] : '20')->setAttrib('class', 'form-control'); $sidebar_max_users = new Zend_Form_Element_Text('sidebar_max_users'); $sidebar_max_users->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Max users to show on sidebar boxes'))->setValidators(array('digits'))->setRequired(true)->setValue(isset($all_meta['sidebar_max_users']) ? $all_meta['sidebar_max_users'] : '3')->setAttrib('class', 'form-control'); $user_manage_groups = new Zend_Form_Element_Checkbox('user_manage_groups'); $user_manage_groups->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['user_manage_groups']) && $all_meta['user_manage_groups'] == 1 ? 1 : 0)->setLabel($this->translator->translate('User can manage groups'))->setCheckedValue("1")->setUncheckedValue("0"); $user_manage_pages = new Zend_Form_Element_Checkbox('user_manage_pages'); $user_manage_pages->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['user_manage_pages']) && $all_meta['user_manage_pages'] == 1 ? 1 : 0)->setLabel($this->translator->translate('User can manage pages'))->setCheckedValue("1")->setUncheckedValue("0"); $disable_groups_pages = new Zend_Form_Element_Checkbox('disable_groups_pages'); $disable_groups_pages->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['disable_groups_pages']) && $all_meta['disable_groups_pages'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Disable groups and pages feature (only admin can manage them)'))->setCheckedValue("1")->setUncheckedValue("0"); $user_activation_disabled = new Zend_Form_Element_Checkbox('user_activation_disabled'); $user_activation_disabled->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['user_activation_disabled']) && $all_meta['user_activation_disabled'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Disable user activation after registration'))->setCheckedValue("1")->setUncheckedValue("0"); $allow_addons = new Zend_Form_Element_Checkbox('allow_addons'); $allow_addons->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['allow_addons']) && $all_meta['allow_addons'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Load addons'))->setCheckedValue("1")->setUncheckedValue("0"); $disable_ajax_validator = new Zend_Form_Element_Checkbox('disable_ajax_validator'); $disable_ajax_validator->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['disable_ajax_validator']) && $all_meta['disable_ajax_validator'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Disable Ajax form validation'))->setCheckedValue("1")->setUncheckedValue("0"); $newuser_notify_email = new Zend_Form_Element_Text('newuser_notify_email'); $newuser_notify_email->addValidator('EmailAddress', true)->addFilter('StringToLower')->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('When new user signs up send notification to this email'))->setValue(isset($all_meta['newuser_notify_email']) ? $all_meta['newuser_notify_email'] : '')->setAttrib('class', 'form-control'); $report_notify_email = new Zend_Form_Element_Text('report_notify_email'); $report_notify_email->addValidator('EmailAddress', true)->addFilter('StringToLower')->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('When resource is reported send notification to this email'))->setValue(isset($all_meta['report_notify_email']) ? $all_meta['report_notify_email'] : '')->setAttrib('class', 'form-control'); $auto_follow_users = new Zend_Form_Element_Text('auto_follow_users'); $auto_follow_users->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Upon registration follow these users (usernames separated by comma)'))->setValue(isset($all_meta['auto_follow_users']) ? $all_meta['auto_follow_users'] : '')->setAttrib('class', 'form-control'); $heartbeatfreq = new Zend_Form_Element_Text('heartbeatfreq'); $heartbeatfreq->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Notification freqency in seconds (heartbeat)'))->setValidators(array('digits'))->setRequired(true)->setValue(isset($all_meta['heartbeatfreq']) ? $all_meta['heartbeatfreq'] : '5')->setAttrib('class', 'form-control'); $session_lifetime = new Zend_Form_Element_Text('session_lifetime'); $session_lifetime->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Session lifetime (Remember me) time in seconds. Set to 0 to use php server settings.'))->setValidators(array('digits'))->setRequired(true)->setValue(isset($all_meta['session_lifetime']) ? $all_meta['session_lifetime'] : '0')->setAttrib('class', 'form-control'); $recaptcha_active = new Zend_Form_Element_Checkbox('recaptcha_active'); $recaptcha_active->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['recaptcha_active']) && $all_meta['recaptcha_active'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Use ReCaptcha'))->setCheckedValue("1")->setUncheckedValue("0"); $recaptcha_privatekey = new Zend_Form_Element_Text('recaptcha_privatekey'); $recaptcha_privatekey->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('ReCaptcha Private Key'))->setValue(isset($all_meta['recaptcha_privatekey']) ? $all_meta['recaptcha_privatekey'] : '123456789')->setAttrib('class', 'form-control'); $recaptcha_publickey = new Zend_Form_Element_Text('recaptcha_publickey'); $recaptcha_publickey->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('ReCaptcha Public Key'))->setValue(isset($all_meta['recaptcha_publickey']) ? $all_meta['recaptcha_publickey'] : '123456789')->setAttrib('class', 'form-control'); $facebook_appid = new Zend_Form_Element_Text('facebook_appid'); $facebook_appid->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Facebook app id'))->setValue(isset($all_meta['facebook_appid']) ? $all_meta['facebook_appid'] : '123456789')->setAttrib('class', 'form-control'); $facebook_secret = new Zend_Form_Element_Text('facebook_secret'); $facebook_secret->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Facebook secret'))->setValue(isset($all_meta['facebook_secret']) ? $all_meta['facebook_secret'] : '123456789')->setAttrib('class', 'form-control'); $allow_guests = new Zend_Form_Element_Checkbox('allow_guests'); $allow_guests->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['allow_guests']) && $all_meta['allow_guests'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Allow public posts so the guests can explore the site'))->setCheckedValue("1")->setUncheckedValue("0"); $submit = new Zend_Form_Element_Submit('submitbtn'); $submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Update'))->setAttrib('class', 'submit btn btn-default'); $this->addElements(array($default_language, $facebook_appid, $facebook_secret, $allow_addons, $user_manage_groups, $user_manage_pages, $disable_groups_pages, $user_activation_disabled, $allow_guests, $disable_ajax_validator, $limit_posts, $max_post_length, $limit_comments, $pagination_limit, $max_scroll_fetches, $newuser_notify_email, $report_notify_email, $auto_follow_users, $username_minchars, $username_maxchars, $sidebar_max_users, $heartbeatfreq, $session_lifetime, $recaptcha_active, $recaptcha_publickey, $recaptcha_privatekey, $submit)); $this->postInit(); }