当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Form_Element_Checkbox::setDecorators方法代码示例

本文整理汇总了PHP中Zend_Form_Element_Checkbox::setDecorators方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Checkbox::setDecorators方法的具体用法?PHP Zend_Form_Element_Checkbox::setDecorators怎么用?PHP Zend_Form_Element_Checkbox::setDecorators使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Form_Element_Checkbox的用法示例。


在下文中一共展示了Zend_Form_Element_Checkbox::setDecorators方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($options = null)
 {
     $this->_disabledDefaultActions = true;
     $this->_addRequiredAsterisks = false;
     parent::__construct($options);
     $baseDir = $this->getView()->baseUrl();
     $this->getView()->headLink()->appendStylesheet("{$this->getView()->baseUrl()}/themes/default/css/login.css", 'all');
     $this->setAttrib('class', 'login');
     $regexValidate = new Cible_Validate_Email();
     $regexValidate->setMessage($this->getView()->getCibleText('validation_message_emailAddressInvalid'), 'regexNotMatch');
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel($this->getView()->getClientText('login_form_email_label'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToLower')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->addValidator($regexValidate)->setAttrib('class', 'loginTextInput');
     $this->addElement($email);
     $password = new Zend_Form_Element_Password('password');
     $password->setLabel($this->getView()->getClientText('login_form_password_label'))->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'loginTextInput')->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))));
     $this->addElement($password);
     // checkbox for client persistance
     $status = new Zend_Form_Element_Checkbox('stayOn');
     $status->setLabel($this->getView()->getClientText('login_form_stayOn_label'));
     $status->setValue(1);
     $status->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd'))));
     $this->addElement($status);
     // Submit button
     $submit = new Zend_Form_Element_Submit('submit_login');
     $submit->setLabel('')->setAttrib('class', 'subscribeButton-' . Zend_Registry::get("languageSuffix"));
     $submit->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd'))));
     $this->addElement($submit);
     $this->setAttrib('class', 'login-form');
 }
开发者ID:anunay,项目名称:stentors,代码行数:29,代码来源:FormLogin.php

示例2: init

 /**
  *
  * Change notifications form
  *
  */
 public function init()
 {
     $cname = explode('_', get_class());
     $this->preInit(end($cname));
     // use template file
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/Notifications.phtml'))));
     // fields
     $ProfilesMeta = new Application_Model_ProfilesMeta();
     $notifications_meta = json_decode($ProfilesMeta->getMetaValue('bulk_notifications'), true);
     $n1 = new Zend_Form_Element_Checkbox('notification_email_1');
     $n1->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_1']) && $notifications_meta['notification_email_1'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email when someone posts a new comment'))->setCheckedValue("1")->setUncheckedValue("0");
     $n2 = new Zend_Form_Element_Checkbox('notification_email_2');
     $n2->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_2']) && $notifications_meta['notification_email_2'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email when someone likes your post'))->setCheckedValue("1")->setUncheckedValue("0");
     $n3 = new Zend_Form_Element_Checkbox('notification_email_3');
     $n3->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_3']) && $notifications_meta['notification_email_3'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email when someone follows you'))->setCheckedValue("1")->setUncheckedValue("0");
     $n4 = new Zend_Form_Element_Checkbox('notification_email_4');
     $n4->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_4']) && $notifications_meta['notification_email_4'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email on new friends'))->setCheckedValue("1")->setUncheckedValue("0");
     $n6 = new Zend_Form_Element_Checkbox('notification_email_6');
     $n6->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_6']) && $notifications_meta['notification_email_6'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email when you lose a follower'))->setCheckedValue("1")->setUncheckedValue("0");
     $n7 = new Zend_Form_Element_Checkbox('notification_email_7');
     $n7->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_7']) && $notifications_meta['notification_email_7'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email when someone posts on your wall'))->setCheckedValue("1")->setUncheckedValue("0");
     $n8 = new Zend_Form_Element_Checkbox('notification_email_8');
     $n8->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_8']) && $notifications_meta['notification_email_8'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email when someone sends you a private message'))->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($n1, $n2, $n3, $n4, $n6, $n7, $n8, $submit));
     $this->postInit();
 }
开发者ID:georgepaul,项目名称:socialstrap,代码行数:33,代码来源:Notifications.php

示例3: init

 /**
  *
  * Change network background
  *
  */
 public function init()
 {
     $cname = explode('_', get_class());
     $this->preInit(end($cname));
     // use template file
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/SettingsBackground.phtml'))));
     // load settings
     $AppOptions = new Application_Model_AppOptions();
     $all_meta = $AppOptions->getAllOptions();
     // fields
     $background_image = new Zend_Form_Element_File('background');
     $background_image->setDecorators(array('File', 'Errors'))->setLabel($this->translator->translate('Choose Picture (jpg, png or gif)'))->addValidator('Extension', false, 'jpg,jpeg,png,gif');
     $background_color = new Zend_Form_Element_Text('background_color');
     $background_color->setDecorators(array('ViewHelper', 'Errors'))->addFilter('StringTrim')->setValue(isset($all_meta['background_color']) ? $all_meta['background_color'] : 'ff0000')->setErrorMessages(array($this->translator->translate('Please pick a color')))->setLabel($this->translator->translate('Background Color'))->setRequired(true)->setAttrib('class', 'form-control colorpicker-input');
     $background_repeat = new Zend_Form_Element_Checkbox('background_repeat');
     $background_repeat->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['background_repeat']) && $all_meta['background_repeat'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Repeat background'))->setCheckedValue("1")->setUncheckedValue("0");
     $background_scroll = new Zend_Form_Element_Checkbox('background_scroll');
     $background_scroll->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['background_scroll']) && $all_meta['background_scroll'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Scroll background'))->setCheckedValue("1")->setUncheckedValue("0");
     $background_stretch = new Zend_Form_Element_Checkbox('background_stretch');
     $background_stretch->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['background_stretch']) && $all_meta['background_stretch'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Stretch background'))->setCheckedValue("1")->setUncheckedValue("0");
     $disable_image = new Zend_Form_Element_Checkbox('background_noimage');
     $disable_image->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['background_noimage']) && $all_meta['background_noimage'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Disable custom image'))->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($background_image, $background_repeat, $background_scroll, $background_stretch, $disable_image, $background_color, $submit));
     $this->postInit();
 }
开发者ID:georgepaul,项目名称:songslikesocial,代码行数:32,代码来源:SettingsBackground.php

示例4: __construct

 /**
  *
  * @param array $options Options to build the form
  */
 public function __construct($options = null)
 {
     parent::__construct($options);
     // Title
     $title = new Zend_Form_Element_Text('FSI_Title');
     $title->setLabel($this->getView()->getCibleText('form_section_title_label') . " <span class='field_required'>*</span>")->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'section_title_edit', 'id' => 'title'))))->setAttrib('class', 'stdTextInput');
     $this->addElement($title);
     // Show title
     $showTitle = new Zend_Form_Element_Checkbox('FS_ShowTitle');
     $showTitle->setLabel($this->getView()->getCibleText('form_section_showtitle_label'));
     $showTitle->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox'))));
     $this->addElement($showTitle);
     // Repeat section
     $repeat = new Zend_Form_Element_Checkbox('FS_Repeat');
     $repeat->setLabel($this->getView()->getCibleText('form_label_has_profil'));
     $repeat->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox'))));
     $this->addElement($repeat);
     // Repeat min
     $repeatMin = new Zend_Form_Element_Text('FS_RepeatMin');
     $repeatMin->setLabel($this->getView()->getCibleText('form_section_repeatMin_label') . " <span class='field_required'>*</span>")->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'section_RepeatMin');
     $this->addElement($repeatMin);
     // Repeat max
     $repeatMax = new Zend_Form_Element_Text('FS_RepeatMax');
     $repeatMax->setLabel($this->getView()->getCibleText('form_section_repeatMax_label') . " <span class='field_required'>*</span>")->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'section_RepeatMax');
     $this->addElement($repeatMax);
     // Sequence - hidden input
     $sequence = new Zend_Form_Element_Hidden('FS_Seq');
     $this->addElement($sequence);
     // page break - hiden input
     $pageBreak = new Zend_Form_Element_Hidden('FS_PageBreak');
     $this->addElement($pageBreak);
     // Set the form id
     $this->setAttrib('id', 'section');
 }
开发者ID:anunay,项目名称:stentors,代码行数:38,代码来源:FormSectionForm.php

示例5: __construct

 public function __construct($options = null)
 {
     $baseDir = $options['baseDir'];
     $pageID = $options['pageID'];
     parent::__construct($options);
     /****************************************/
     // PARAMETERS
     /****************************************/
     // select box category (Parameter #1)
     $blockCategory = new Zend_Form_Element_Select('Param1');
     $blockCategory->setLabel('Catégorie d\'évènement de ce bloc')->setAttrib('class', 'largeSelect');
     $categories = new Categories();
     $select = $categories->select()->setIntegrityCheck(false)->from('Categories')->join('CategoriesIndex', 'C_ID = CI_CategoryID')->where('C_ModuleID = ?', 7)->where('CI_LanguageID = ?', Zend_Registry::get("languageID"))->order('CI_Title');
     $categoriesArray = $categories->fetchAll($select);
     foreach ($categoriesArray as $category) {
         $blockCategory->addMultiOption($category['C_ID'], $category['CI_Title']);
     }
     // number of news to show in front-end (Parameter #2)
     $at_least_one = new Zend_Validate_GreaterThan('0');
     $at_least_one->setMessage('Vous devez afficher au moins un événement.');
     $not_null = new Zend_Validate_NotEmpty();
     $not_null->setMessage($this->getView()->getCibleText('validation_message_empty_field'));
     $blockNewsMax = new Zend_Form_Element_Text('Param2');
     $blockNewsMax->setLabel('Nombre d\'évènement à afficher')->setRequired(true)->setValue('1')->addValidator($not_null, true)->addValidator($at_least_one, true)->setAttrib('class', 'smallTextInput');
     // show the breif text in front-end (Parameter #3)
     $blockShowBrief = new Zend_Form_Element_Checkbox('Param3');
     $blockShowBrief->setLabel('Afficher le texte bref');
     $blockShowBrief->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox'))));
     $this->addElements(array($blockCategory, $blockNewsMax, $blockShowBrief));
     $this->removeDisplayGroup('parameters');
     $this->addDisplayGroup(array('Param999', 'Param1', 'Param2', 'Param3'), 'parameters');
     $parameters = $this->getDisplayGroup('parameters');
     //$parameters->setLegend($this->_view->getCibleText('form_parameters_fieldset'));
 }
开发者ID:anunay,项目名称:stentors,代码行数:34,代码来源:FormBlockEvents.php

示例6: init

 /**
  *
  * 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();
 }
开发者ID:georgepaul,项目名称:socialstrap,代码行数:38,代码来源:EditGroup.php

示例7: init

 /**
  *
  * 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();
 }
开发者ID:georgepaul,项目名称:songslikesocial,代码行数:33,代码来源:SettingsStyle.php

示例8: render

 /**
  * @param string $content
  * @return string
  */
 public function render($content)
 {
     $prepend = $this->getElement()->getAttrib('prepend');
     $append = $this->getElement()->getAttrib('append');
     if (null === $prepend && null === $append) {
         return $content;
     }
     $placement = 'prepend';
     $addOn = $prepend;
     if (null !== $append) {
         $placement = 'append';
         $addOn = $append;
     }
     if (is_array($addOn)) {
         $addOn = new Zend_Config($addOn, true);
     }
     $addOnClass = 'add-on';
     if ($addOn instanceof Zend_Config) {
         if (isset($addOn->active) && true === $addOn->active) {
             $addOnClass .= ' active';
             unset($addOn->active);
         }
         $prependedElement = new Zend_Form_Element_Checkbox($addOn);
         $prependedElement->setDecorators(array(array('ViewHelper')));
         $addOn = $prependedElement->render($this->getElement()->getView());
     }
     $this->getElement()->setAttrib('prepend', null);
     $this->getElement()->setAttrib('append', null);
     $span = '<span class="' . $addOnClass . '">' . $addOn . '</span>';
     return '<div class="input-' . $placement . '">
                 ' . ('prepend' == $placement ? $span : '') . $content . ('append' == $placement ? $span : '') . '
             </div>';
 }
开发者ID:rusnewman,项目名称:zend-form-decorators-bootstrap,代码行数:37,代码来源:Addon.php

示例9: __construct

 public function __construct($options = null)
 {
     parent::__construct($options);
     // Title
     $title = new Zend_Form_Element_Text('NR_Title');
     $title->setLabel($this->getView()->getCibleText('form_label_title'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput');
     $this->addElement($title);
     // Date picker
     $datePicker = new Cible_Form_Element_DatePicker('NR_Date', array('jquery.params' => array('changeYear' => true, 'changeMonth' => true)));
     $datePicker->setLabel($this->getView()->getCibleText('form_extranet_newsletter_label_releaseDate'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->addValidator('Date', true, array('messages' => array('dateNotYYYY-MM-DD' => $this->getView()->getCibleText('validation_message_invalid_date'), 'dateInvalid' => $this->getView()->getCibleText('validation_message_invalid_date'), 'dateFalseFormat' => $this->getView()->getCibleText('validation_message_invalid_date'))));
     $this->addElement($datePicker);
     // Language
     $language = new Zend_Form_Element_Select('NR_LanguageID');
     $language->setLabel($this->getView()->getCibleText('form_label_language'))->setAttrib('class', 'largeSelect');
     $languagesData = Cible_FunctionsGeneral::getAllLanguage();
     foreach ($languagesData as $languageData) {
         $language->addMultiOption($languageData['L_ID'], $languageData['L_Title']);
     }
     $this->addElement($language);
     // Category
     $category = new Zend_Form_Element_Select('NR_CategoryID');
     $category->setLabel($this->getView()->getCibleText('form_label_category'))->setAttrib('class', 'largeSelect');
     $categoriesData = $this->getView()->getAllNewsletterCategories();
     foreach ($categoriesData as $categoryData) {
         $category->addMultiOption($categoryData['C_ID'], $categoryData['CI_Title']);
     }
     $this->addElement($category);
     // Model
     $model = new Zend_Form_Element_Select('NR_ModelID');
     $model->setLabel($this->getView()->getCibleText('form_label_model'))->setAttrib('class', 'largeSelect');
     $modelsData = $this->getView()->getAllNewsletterModels();
     foreach ($modelsData as $modelData) {
         $model->addMultiOption($modelData['NMI_NewsletterModelID'], $modelData['NMI_Title']);
     }
     $this->addElement($model);
     //if($this->salutationDefaultText!=""){
     $intro = new Cible_Form_Element_Editor('NR_TextIntro', array('mode' => Cible_Form_Element_Editor::ADVANCED));
     $intro->setLabel($this->getView()->getCibleText('form_label_newsletter_text_intro'))->setAttrib('class', 'largeEditor');
     $this->addElement($intro);
     // show online
     $showOnline = new Zend_Form_Element_Checkbox('NR_Online');
     $showOnline->setLabel($this->getView()->getCibleText('form_label_showOnline'));
     $showOnline->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox'))));
     $this->addElement($showOnline);
     // email
     //            $regexValidate = new Cible_Validate_Email();
     //            $regexValidate->setMessage($this->getView()->getCibleText('validation_message_emailAddressInvalid'), 'regexNotMatch');
     $email = new Zend_Form_Element_Text('NR_AdminEmail');
     $email->setLabel($this->getView()->getCibleText('newsletter_form_label_admin_email'))->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToLower')->setAttrib('class', 'stdTextInput');
     /*$email->setDecorators(array(
           'ViewHelper',
           array('label', array('placement' => 'prepend')),
           array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'dd_form dd_email'))
       ));*/
     // $email->setAttrib('class', 'newsletter_form_element text_email');
     $this->addElement($email);
 }
开发者ID:anunay,项目名称:stentors,代码行数:57,代码来源:FormNewsletter.php

示例10: _addTags

 protected function _addTags()
 {
     $tags = $this->_tagRepository->fetchEntities();
     $group = current($this->getDisplayGroups());
     foreach ($tags as $tag) {
         $element = new \Zend_Form_Element_Checkbox('tag_' . $tag->id, array('class' => 'checkbox', 'label' => $tag->name));
         $element->setDecorators($this->_config->elementDecorators->toArray());
         $this->addElement($element);
         $group->addElement($element);
     }
 }
开发者ID:kromeyer,项目名称:MMK-Newsroom,代码行数:11,代码来源:TagForm.php

示例11: __construct

 public function __construct($options = null)
 {
     $this->_disabledDefaultActions = true;
     parent::__construct($options);
     $newsletterCategories = $this->getView()->GetAllNewsletterCategories();
     $newsletterCategories = $newsletterCategories->toArray();
     foreach ($newsletterCategories as $cat) {
         $chkCat = new Zend_Form_Element_Checkbox("chkNewsletter{$cat['C_ID']}");
         $chkCat->setLabel($cat['CI_Title']);
         $chkCat->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox'))));
         $this->addElement($chkCat);
     }
 }
开发者ID:anunay,项目名称:stentors,代码行数:13,代码来源:FormNewsletterUsers.php

示例12: __construct

 public function __construct($options = null)
 {
     $this->_addSubmitSaveClose = false;
     parent::__construct($options);
     $galleryID = $options['galleryID'];
     $imageSrc = "";
     // show online
     $showOnline = new Zend_Form_Element_Checkbox('GI_Online');
     $showOnline->setValue(1);
     $showOnline->setLabel($this->getView()->getCibleText('form_label_showOnline'));
     $showOnline->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox'))));
     $this->addElement($showOnline);
     // image position
     $position = new Zend_Form_Element_Text('GI_Position');
     $position->setLabel($this->getView()->getCibleText('form_label_position'));
     $position->setRequired(true);
     $position->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))));
     $position->addValidator('Int', true, array('messages' => array('notInt' => $this->getView()->getCibleText('validation_message_int_field'))));
     $this->addElement($position);
     // IMAGE
     /*
      $imageSrc = "";
      $imageView = new Zend_Form_Element_Image('imageView',array('src' => $imageSrc));
      $imageView->setOrder(4);
     
      $this->addElement($imageView);
     */
     if ($galleryID != "") {
         $imageTmp = new Zend_Form_Element_Hidden('ImageSrc_tmp');
         $imageTmp->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'openOnly' => true))));
         $this->addElement($imageTmp);
         $imageOrg = new Zend_Form_Element_Hidden('ImageSrc_original');
         $imageOrg->setDecorators(array('ViewHelper'));
         $this->addElement($imageOrg);
         $imageView = new Zend_Form_Element_Image('ImageSrc_preview', array('src' => $imageSrc, 'onclick' => 'return false;'));
         $imageView->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'closeOnly' => true))));
         $this->addElement($imageView);
         $imagePicker = new Cible_Form_Element_ImageGalleryPicker('ImageSrc', array('associatedElement' => 'imageView', 'galleryID' => $galleryID));
         $imagePicker->removeDecorator('label');
         $this->addElement($imagePicker);
     }
     // Title
     $title = new Zend_Form_Element_Text('II_Title');
     $title->setLabel($this->getView()->getCibleText('form_label_title'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput');
     $this->addElement($title);
     // Description
     $title = new Zend_Form_Element_Text('II_Description');
     $title->setLabel($this->getView()->getCibleText('form_label_description'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput');
     $this->addElement($title);
 }
开发者ID:anunay,项目名称:stentors,代码行数:50,代码来源:FormImage.php

示例13: init

 public function init()
 {
     // usuario_nome
     $usuario_nome = new Zend_Form_Element_Text('usuario_nome');
     $usuario_nome->setLabel('Nome Completo: ');
     $usuario_nome->setRequired();
     $usuario_nome->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!"));
     $usuario_nome->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe seu nome'));
     $usuario_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // usuario_email
     $usuario_email = new Zend_Form_Element_Text('usuario_email');
     $usuario_email->setLabel('E-mail: ');
     $usuario_email->addValidator(new App_Validate_UsuarioEmail());
     $usuario_email->setRequired();
     $usuario_email->addValidator('EmailAddress');
     $usuario_email->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe seu e-mail'));
     $usuario_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // usuario_cep
     $usuario_cep = new Zend_Form_Element_Text('usuario_cep');
     $usuario_cep->setLabel('CEP: ');
     $usuario_cep->setRequired();
     $usuario_cep->addValidator(new App_Validate_Cep());
     $usuario_cep->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe seu CEP'));
     $usuario_cep->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // usuario_senha
     $usuario_senha = new Zend_Form_Element_Password("usuario_senha");
     $usuario_senha->setLabel("Senha: ");
     $usuario_senha->setRequired();
     $usuario_senha->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe sua senha'));
     $usuario_senha->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // usuario_politica_termo
     $usuario_politica_termo = new Zend_Form_Element_Checkbox('usuario_politica_termo');
     $usuario_politica_termo->setLabel(" \n            Li e concordo com a \n            <a href='' data-toggle='modal' data-target='#modal-politica'>Política de Privacidade</a> e \n            <a href='' data-toggle='modal' data-target='#modal-termo'>Termo de Uso</a>.\n        ");
     $usuario_politica_termo->setDecorators(App_Forms_Decorators::$checkboxElementDecorators_termo);
     //$usuario_politica_termo->addDecorator();
     //$usuario_politica_termo->setValue(0);
     //$usuario_politica_termo->setCheckedValue('') ;
     $usuario_politica_termo->setUnCheckedValue('');
     $usuario_politica_termo->setRequired();
     $usuario_politica_termo->addErrorMessage('Você precisa concordar com nossa Pólitica de Privacidade e Termo de Uso');
     // captcha
     $captcha = new Zend_Form_Element_Captcha('captcha', array('label' => 'Informe os careacteres da imagem: ', 'class' => 'form-control', 'captcha' => array('captcha' => 'Image', 'wordLen' => 3, 'timeout' => 300, 'font' => APPLICATION_PATH . '/../public/views/fonts/Exo-SemiBold.ttf', 'imgDir' => APPLICATION_PATH . '/../public/views/captcha/', 'imgUrl' => '/../public/views/captcha/')));
     $captcha->removeDecorator('ViewHelper');
     $this->addElements(array($usuario_nome, $usuario_email, $usuario_cep, $usuario_senha, $usuario_politica_termo));
     parent::init();
     $this->getElement('submit')->setLabel('Cadastrar');
 }
开发者ID:nandorodpires2,项目名称:homemakes,代码行数:47,代码来源:CadastroUsuario.php

示例14: __construct

 /**
  *
  * @param array $options Options to build the form
  */
 public function __construct($options = null)
 {
     // Disable the defaults buttons
     if (isset($options['disableAction'])) {
         $this->_disabledDefaultActions = $options['disableAction'];
     }
     if (isset($options['recipients'])) {
         $recipients = $options['recipients'];
         $recipientsList = $this->_setRecipientList($recipients);
         unset($options['recipients']);
     }
     parent::__construct($options);
     // Title
     $title = new Zend_Form_Element_Text('FI_Title');
     $title->setLabel($this->getView()->getCibleText('form_label_title'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput');
     $this->addElement($title);
     // Notification
     $notification = new Zend_Form_Element_Checkbox('F_Notification');
     $notification->setLabel($this->getView()->getCibleText('form_label_has_notification'));
     $notification->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox'))));
     $this->addElement($notification);
     $emailList = new Zend_Form_Element_Textarea('FN_Email');
     $emailList->setAttrib('title', $this->getView()->getCibleText('form_notification_emails_info'));
     if (!empty($recipientsList)) {
         $emailList->setValue($recipientsList);
     }
     $emailList->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'formRecipientsEmail'))));
     $this->addElement($emailList);
     // isSercure
     //            $hasProfil = new Zend_Form_Element_Checkbox('F_Profil');
     //            $hasProfil->setLabel($this->getView()->getCibleText(
     //                    'form_label_has_profil'));
     //            $hasProfil->setDecorators(array(
     //                'ViewHelper',
     //                array('label', array('placement' => 'append')),
     //                array(
     //                    array('row' => 'HtmlTag'),
     //                    array('tag' => 'dd', 'class' => 'label_after_checkbox')),
     //            ));
     //
     //            $this->addElement($hasProfil);
     //hasCaptcha
     $hasCaptcha = new Zend_Form_Element_Checkbox('F_Captcha');
     $hasCaptcha->setLabel($this->getView()->getCibleText('form_label_has_captcha'))->setValue(true)->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox'))));
     $this->addElement($hasCaptcha);
     $this->setAttrib('id', 'Form');
 }
开发者ID:anunay,项目名称:stentors,代码行数:51,代码来源:FormForm.php

示例15: __construct

 public function __construct($options = null)
 {
     parent::__construct($options);
     $moduleID = -1;
     $moduleName = '';
     if (!empty($options['moduleID'])) {
         $moduleID = $options['moduleID'];
         $moduleName = Cible_FunctionsModules::getModuleNameByID($moduleID);
     }
     // input text for the title of the text module
     $categoryTitle = new Zend_Form_Element_Text('Title');
     $categoryTitle->setLabel($this->getView()->getCibleText('form_category_title_label'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->_view->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput');
     $label = $categoryTitle->getDecorator('Label');
     $label->setOption('class', $this->_labelCSS);
     $this->addElement($categoryTitle);
     $categoryDescription = new Zend_Form_Element_Textarea('WordingShowAllRecords');
     $categoryDescription->setLabel($this->_view->getCibleText('form_category_view_all_label'))->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'stdTextarea');
     $label = $categoryDescription->getDecorator('Label');
     $label->setOption('class', $this->_labelCSS);
     $this->addElement($categoryDescription);
     $views = Cible_FunctionsCategories::getCategoryViews($moduleID);
     foreach ($views as $view) {
         $pickerName = $view['MV_Name'];
         $controllerName = new Zend_Form_Element_Text("{$pickerName}_controllerName");
         $controllerName->setLabel($this->getView()->getCibleText("form_select_option_view_{$moduleName}_{$pickerName}"))->setAttrib('onfocus', "openPagePicker('page-picker-{$pickerName}');");
         $this->addElement($controllerName);
         $pagePicker = new Cible_Form_Element_PagePicker("{$pickerName}_pageID", array('associatedElement' => "{$pickerName}_controllerName", 'onclick' => "javascript:closePagePicker(\"page-picker-{$pickerName}\")"));
         $pagePicker->setLabel($this->_view->getCibleText('form_category_associated_page_label'));
         $pagePicker->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => "page-picker", 'id' => "page-picker-{$pickerName}"))));
         $this->addElement($pagePicker);
     }
     // Check if want to put that category in the RSS Feed
     $showInRss = new Zend_Form_Element_Checkbox('ShowInRss');
     $showInRss->setValue(1);
     $showInRss->setLabel($this->_view->getCibleText('form_category_add_to_rss_label'));
     $showInRss->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox'))));
     $this->addElement($showInRss);
     // How many last news in the RSS Feed
     $rssItemsCount = new Zend_Form_Element_Text('RssItemsCount');
     $rssItemsCount->setLabel($this->getView()->getCibleText('form_category_how_many_items_for_rss_label'))->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->_view->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'shortTextInput');
     $this->addElement($rssItemsCount);
     $module = new Zend_Form_Element_Hidden('ModuleID');
     $module->setValue($moduleID)->removeDecorator('label')->removeDecorator('DtDdWrapper');
     $this->addElement($module);
 }
开发者ID:anunay,项目名称:stentors,代码行数:45,代码来源:FormCategory.php


注:本文中的Zend_Form_Element_Checkbox::setDecorators方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。