本文整理汇总了PHP中Zend_Form_Element_Text::getDecorator方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Text::getDecorator方法的具体用法?PHP Zend_Form_Element_Text::getDecorator怎么用?PHP Zend_Form_Element_Text::getDecorator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Text
的用法示例。
在下文中一共展示了Zend_Form_Element_Text::getDecorator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($options = null)
{
parent::__construct($options);
if (empty($this->tableName)) {
throw new Exception('You need to set the $tableName protected variable in your Form instance');
}
$baseDir = $options['baseDir'];
Zend_Registry::set('baseUrl', $baseDir);
$cancel_url = $options['cancelUrl'];
// Title
$title = new Zend_Form_Element_Text($this->tableFieldPrefix . 'Title');
$title->setLabel(Cible_Translation::getCibleText('form_label_title'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => Cible_Translation::getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput');
$label = $title->getDecorator('Label');
$label->setOption('class', $this->_labelCSS);
$this->addElement($title);
// Status
$status = new Zend_Form_Element_Select($this->tableFieldPrefix . 'Status');
$status->setLabel(Cible_Translation::getCibleText('form_label_status'))->setAttrib('class', 'stdSelect');
$db = $this->_db;
$sql = 'SELECT * FROM Status';
$status_options = $db->fetchAll($sql);
foreach ($status_options as $_option) {
$status->addMultiOption($_option['S_ID'], Cible_Translation::getCibleText("status_{$_option['S_Code']}"));
}
$this->addElement($status);
}
示例2: init
public function init()
{
$this->setMethod("POST");
$category = new Zend_Form_Element_Text("name");
$category->setRequired();
$category->setLabel("category Name:");
$category->setAttrib("placeholder", "Enter Category Name");
$category->addValidator(new Zend_Validate_Alnum("true"));
$category->setAttrib("class", "form-control");
$category->getDecorator("Label")->setOption("class", "control-label");
$category->getDecorator("Errors")->setOption("class", "alert alert-danger");
$category->getDecorator("Errors")->setOption("role", "alert");
$category->getDecorator("Errors")->setOption("style", " list-style-type:none");
$description = new Zend_Form_Element_Textarea("description");
$description->setLabel('Description:');
$description->setRequired();
$description->setAttrib("rows", "10");
$description->setAttrib("class", "form-control");
$description->getDecorator("Label")->setOption("class", "control-label");
$description->getDecorator("Errors")->setOption("class", "alert alert-danger");
$description->getDecorator("Errors")->setOption("style", " list-style-type:none");
$submit = new Zend_Form_Element_Submit("submit");
$submit->setAttrib("class", "btn btn-xl center-block");
// $submit->setAttrib("class", "btn");
$this->addElements(array($category, $description, $submit));
}
示例3: init
public function init()
{
/* Form Elements & Other Definitions Here ... */
$this->setMethod("POST");
$uid = new Zend_Form_Element_Hidden("user_id");
//add firstname
$f_name = new Zend_Form_Element_Text("f_name");
$f_name->setRequired();
$f_name->setLabel("first Name:");
$f_name->setAttrib("placeholder", "Enter Your first Name");
$f_name->addValidator(new Zend_Validate_Alnum("true"));
$f_name->setAttrib("class", "form-control");
$f_name->getDecorator("Label")->setOption("class", "control-label");
$f_name->getDecorator("Errors")->setOption("class", "alert alert-danger");
$f_name->getDecorator("Errors")->setOption("style", " list-style-type:none");
//add lastname
$l_name = new Zend_Form_Element_Text("l_name");
$l_name->setRequired();
$l_name->setLabel("Last Name");
$l_name->setAttrib("placeholder", "Enter Your last Name");
$l_name->addValidator(new Zend_Validate_Alnum("true"));
$l_name->setAttrib("class", "form-control");
$l_name->getDecorator("Label")->setOption("class", "control-label");
$l_name->getDecorator("Errors")->setOption("class", "alert alert-danger");
$l_name->getDecorator("Errors")->setOption("style", " list-style-type:none");
//add mail
$username = new Zend_Form_Element_Text("username");
$username->setRequired();
$username->setLabel("E-Mail");
$username->setAttrib("placeholder", "Enter Your E-Mail");
$username->addValidator(new Zend_Validate_EmailAddress());
$username->getDecorator("Label")->setOption("class", "control-label");
$username->getDecorator("Errors")->setOption("class", "alert alert-danger");
$username->getDecorator("Errors")->setOption("style", " list-style-type:none");
$password = new Zend_Form_Element_Password("password");
$password->setRequired();
$password->setLabel("Password");
$password->setAttrib("placeholder", "Enter Your Password");
$password->setAttrib("class", "form-control");
$password->getDecorator("Label")->setOption("class", "control-label");
$password->getDecorator("Errors")->setOption("class", "alert alert-danger");
$password->getDecorator("Errors")->setOption("style", " list-style-type:none");
$re_password = new Zend_Form_Element_Password("re_password");
$re_password->setRequired();
$re_password->setLabel("Retype Your Password");
$re_password->addValidator('identical', false, array('token' => 'password'));
$re_password->setAttrib("placeholder", "Re-enter Your Password");
$re_password->setAttrib("class", "form-control");
$re_password->getDecorator("Label")->setOption("class", "control-label");
$re_password->getDecorator("Errors")->setOption("class", "alert alert-danger");
$re_password->getDecorator("Errors")->setOption("style", " list-style-type:none");
$submit = new Zend_Form_Element_Submit("submit");
$submit->setAttrib("class", "btn btn-xl center-block");
$this->addElements(array($uid, $f_name, $l_name, $username, $password, $re_password, $submit));
}
示例4: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setMethod('post');
$title = new Zend_Form_Element_Text(array('name' => 'title', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array('length' => array('validator' => 'StringLength', 'options' => array('min' => 4, 'max' => 200)), 'content' => array('validator' => 'Regex', 'options' => array('pattern' => '/^[^\\p{C}]+$/u'))), 'label' => 'Post Title'));
$tags = new Zend_Form_Element_Text(array('name' => 'tags', 'required' => false, 'filters' => array('StringTrim'), 'validators' => array('content' => array('validator' => 'Regex', 'options' => array('pattern' => '/^[\\p{L}\\p{M}\\p{N}_\\-, ]+$/u'))), 'label' => 'Tags', 'description' => 'Comma separated list of tags for this post', 'size' => 40));
$location = new Zend_Form_Element_Text(array('name' => 'location', 'required' => false, 'filters' => array('StringTrim'), 'validators' => array('content' => array('validator' => 'Regex', 'options' => array('pattern' => '/^[\\p{L}\\p{M}\\p{N}_\\-,\\. ]+$/u'))), 'label' => 'Location', 'description' => 'Your current location', 'size' => 40));
$text = new Zend_Form_Element_Textarea(array('name' => 'content', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array('length' => array('validator' => 'StringLength', 'options' => array('min' => 10)), 'content' => array('validator' => 'Regex', 'options' => array('pattern' => '/^(?:[^\\p{C}]|\\s)+$/u'))), 'label' => 'Content'));
$submit = new Zend_Form_Element_Submit(array('name' => 'submit', 'label' => 'Create Post', 'class' => 'button-big'));
$title->getDecorator('Label')->setOption('class', 'input-big');
$title->getDecorator('HtmlTag')->setOption('class', 'input-big');
$this->addElement($title)->addElement($text)->addElement($tags)->addElement($location)->addElement($submit);
}
示例5: init
public function init()
{
/* Form Elements & Other Definitions Here ... */
$this->setMethod("POST");
//$this->setAttrib("class", "form-group has-success ");
//$this->setAttrib("role","form")
$course_name = new Zend_Form_Element_Text("name");
$course_name->setRequired();
$course_name->setLabel("course name:");
$course_name->setAttrib("placeholder", "Enter course name");
$course_name->addValidator(new Zend_Validate_Alnum("true"));
$course_name->setAttrib("class", "form-control");
$course_name->getDecorator("Label")->setOption("class", "control-label");
$course_name->getDecorator("Errors")->setOption("class", "alert alert-danger");
$course_name->getDecorator("Errors")->setOption("role", "alert");
$course_name->getDecorator("Errors")->setOption("style", " list-style-type:none");
$category = new Zend_Form_Element_Select('catid');
$category->setLabel('category:');
//$category ->setMultiOptions(array( '1'=>'programing languages','2'=>'graphics'));
$category->setRequired(true)->addValidator('NotEmpty', true);
$category->setAttrib("class", "form-control");
$category->getDecorator("Label")->setOption("class", "control-label");
//$category->getDecorator("Label")->setOption("class", "color-org");
$category->getDecorator("Errors")->setOption("class", "alert alert-danger");
$category->getDecorator("Errors")->setOption("style", " list-style-type:none");
$hours = new Zend_Form_Element_Text("hours");
$hours->setRequired();
$hours->setLabel("hours:");
$hours->setAttrib("placeholder", "Enter Course hours");
$hours->setAttrib("class", "form-control");
$validator = $hours->addValidator(new Zend_Validate_Digits("true"));
$hours->getDecorator("Label")->setOption("class", "control-label");
$hours->getDecorator("Errors")->setOption("class", "alert alert-danger");
$hours->getDecorator("Errors")->setOption("style", " list-style-type:none");
$description = new Zend_Form_Element_Textarea("description");
$description->setLabel('Description:');
$description->setRequired();
$description->setAttrib("rows", "10");
$description->setAttrib("class", "form-control");
$description->getDecorator("Label")->setOption("class", "control-label");
$description->getDecorator("Errors")->setOption("class", "alert alert-danger");
$description->getDecorator("Errors")->setOption("style", " list-style-type:none");
//$catid = new Zend_Form_Element_Hidden("catid");
$submit = new Zend_Form_Element_Submit("submit");
$submit->setAttrib("class", "btn btn-xl center-block");
//$submit->setAttrib("class", "btn");
$this->addElements(array($course_name, $category, $hours, $description, $submit));
}
示例6: __construct
public function __construct($options = null)
{
$baseDir = $options['baseDir'];
$pageID = $options['pageID'];
parent::__construct($options);
/****************************************/
// PARAMETERS
/****************************************/
// Link of the RSS
$link = new Zend_Form_Element_Text('Param1');
$link->setLabel($this->getView()->getCibleText('form_label_rss_reader_link'))->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' => 'link'))))->setAttrib('class', 'stdTextInput ');
$label = $link->getDecorator('Label');
$label->setOption('class', $this->_labelCSS);
$this->addElement($link);
// Lien en anglais
$link_en = new Zend_Form_Element_Text('Param2');
$link_en->setLabel($this->getView()->getCibleText('form_label_rss_reader_link_en'))->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'link_en'))))->setAttrib('class', 'stdTextInput ');
$label = $link_en->getDecorator('Label');
$label->setOption('class', $this->_labelCSS);
$this->addElement($link_en);
// number of rss link to show in front-end (maxLink)
$blockRssMax = new Zend_Form_Element_Text('Param3');
$blockRssMax->setLabel($this->getView()->getCibleText('form_label_rss_reader_link_max'))->setAttrib('class', 'smallTextInput');
$this->addElement($blockRssMax);
$this->removeDisplayGroup('parameters');
$this->addDisplayGroup(array('Param3', 'Param1', 'Param2', 'Param999'), 'parameters');
$parameters = $this->getDisplayGroup('parameters');
}
示例7: init
public function init()
{
$this->setMethod("POST");
$type = new Zend_Form_Element_Text("type_name");
$type->setRequired();
$type->setLabel("Material Type Name:");
$type->setAttrib("placeholder", "Enter Material Type Name");
$type->addValidator(new Zend_Validate_Alnum("true"));
$type->setAttrib("class", "form-control");
$type->setAttrib("class", "form-control");
$type->getDecorator("Label")->setOption("class", "control-label");
$type->getDecorator("Errors")->setOption("class", "alert alert-danger");
$type->getDecorator("Errors")->setOption("style", " list-style-type:none");
$submit = new Zend_Form_Element_Submit("submit");
$submit->setAttrib("class", "btn btn-xl center-block");
// $submit->setAttrib("class", "btn");
$this->addElements(array($type, $submit));
}
示例8: __construct
/**
* Class constructor
*
* @return void
*/
public function __construct($options)
{
parent::__construct($options);
$imageSrc = $options['imageSrc'];
if (isset($options['imgField'])) {
$imgField = $options['imgField'];
}
$dataId = $options['dataId'];
$isNewImage = $options['isNewImage'];
$moduleName = $options['moduleName'];
if ($dataId == '') {
$pathTmp = "../../../../../data/images/" . $moduleName . "/tmp";
} else {
$pathTmp = "../../../../../data/images/" . $moduleName . "/" . $dataId . "/tmp";
}
$config = Zend_Registry::get('config');
// hidden specify if new image for the news
$newImage = new Zend_Form_Element_Hidden('isNewImage', array('value' => $isNewImage));
$newImage->removeDecorator('Label');
$this->addElement($newImage);
// Name of the product line
$name = new Zend_Form_Element_Text('CCI_Name');
$name->setLabel($this->getView()->getCibleText('form_category_name_label'))->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('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput ');
$label = $name->getDecorator('Label');
$label->setOption('class', $this->_labelCSS);
$this->addElement($name);
if (!empty($imgField)) {
// Image for the category
$imageTmp = new Zend_Form_Element_Hidden($imgField . '_tmp');
$imageTmp->removeDecorator('Label');
$this->addElement($imageTmp);
$imageOrg = new Zend_Form_Element_Hidden($imgField . '_original');
$imageOrg->removeDecorator('Label');
$this->addElement($imageOrg);
$imageView = new Zend_Form_Element_Image($imgField . '_preview', array('onclick' => 'return false;'));
$imageView->setImage($imageSrc);
$this->addElement($imageView);
$imagePicker = new Cible_Form_Element_ImagePicker($imgField, array('onchange' => "document.getElementById('imageView').src = document.getElementById('" . $imgField . "').value", 'associatedElement' => $imgField . '_preview', 'pathTmp' => $pathTmp, 'contentID' => $dataId));
$imagePicker->setLabel($this->getView()->getCibleText('form_category_logo_label'));
$this->addElement($imagePicker);
}
// ImageSrc
$imageBanner = new Zend_Form_Element_Select('C_BannerGroupID');
$imageBanner->setLabel($this->getView()->getCibleText('form_banner_image_group_extranet'))->setAttrib('class', 'stdSelect');
$imageBanner->addMultiOption('', 'Sans image');
$group = new GroupObject();
$groupArray = $group->groupCollection();
foreach ($groupArray as $group1) {
$imageBanner->addMultiOption($group1['BG_ID'], $group1['BG_Name']);
}
$this->addElement($imageBanner);
// id of the associated meta data
$metaTagId = new Zend_Form_Element_Hidden('CCI_MetaId');
$metaTagId->removeDecorator('Label');
$this->addElement($metaTagId);
}
示例9: init
public function init()
{
/* Form Elements & Other Definitions Here ... */
$this->setMethod("POST");
$name = new Zend_Form_Element_Text("name");
$name->setRequired();
$name->setLabel("material name:");
$name->setAttrib("placeholder", "Enter material name");
$name->addValidator(new Zend_Validate_Alnum("true"));
$name->setAttrib("class", "form-control");
$name->getDecorator("Label")->setOption("class", "control-label");
$name->getDecorator("Errors")->setOption("class", "alert alert-danger");
$name->getDecorator("Errors")->setOption("style", " list-style-type:none");
$path = new Zend_Form_Element_File('path');
$path->setLabel('Select File:');
$path->setRequired();
$path->setAttrib("class", "form-control");
$path->setAttrib("class", "file-loading");
$path->getDecorator("Label")->setOption("class", "control-label");
$path->getDecorator("Errors")->setOption("class", "alert alert-danger");
$path->getDecorator("Errors")->setOption("style", " list-style-type:none");
$course = new Zend_Form_Element_Select('cid');
$course->setLabel('Course Name:');
//$course ->setMultiOptions(array( '5'=>'a','6'=>'c'));
$course->setRequired(true)->addValidator('NotEmpty', true);
$course->setAttrib("class", "form-control");
$course->getDecorator("Label")->setOption("class", "control-label");
$course->getDecorator("Errors")->setOption("class", "alert alert-danger");
$course->getDecorator("Errors")->setOption("style", " list-style-type:none");
$type = new Zend_Form_Element_Select('tid');
$type->setLabel('Material Type:');
//$type->setMultiOptions(array( '1'=>'pdf','2'=>'ppt'));
$type->setRequired(true)->addValidator('NotEmpty', true);
$type->setAttrib("class", "form-control");
$type->getDecorator("Label")->setOption("class", "control-label");
$type->getDecorator("Errors")->setOption("class", "alert alert-danger");
$type->getDecorator("Errors")->setOption("style", " list-style-type:none");
$mdate = new Zend_Form_Element_Hidden("mdate");
$submit = new Zend_Form_Element_Submit("submit");
$submit->setAttrib("class", "btn btn-xl center-block");
//$submit->setAttrib("class", "btn");
$this->addElements(array($name, $path, $course, $type, $mdate, $submit));
}
示例10: __construct
public function __construct($options = null)
{
parent::__construct($options);
$imageSrc = $options['imageSrc'];
$dataId = $options['dataId'];
$imgField = $options['imgField'];
$isNewImage = $options['isNewImage'];
$moduleName = $options['moduleName'];
if ($dataId == '') {
$pathTmp = "../../../../../data/images/" . $moduleName . "/tmp";
} else {
$pathTmp = "../../../../../data/images/" . $moduleName . "/" . $dataId . "/tmp";
}
// hidden specify if new image for the news
$newImage = new Zend_Form_Element_Hidden('isNewImage', array('value' => $isNewImage));
$newImage->removeDecorator('Label');
$this->addElement($newImage);
// Image for the product line
$imageTmp = new Zend_Form_Element_Hidden($imgField . '_tmp');
$imageTmp->removeDecorator('Label');
$this->addElement($imageTmp);
$imageOrg = new Zend_Form_Element_Hidden($imgField . '_original');
$imageOrg->removeDecorator('Label');
$this->addElement($imageOrg);
// Name of the group of banner
// Set the texte for the image
$textDescription = new Zend_Form_Element_Textarea('BII_Text');
$textDescription->setLabel($this->_view->getCibleText('form_banner_image_text_label'))->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'stdTextarea');
$label = $textDescription->getDecorator('Label');
$label->setOption('class', $this->_labelCSS);
$textUrl = new Zend_Form_Element_Text('BII_Url');
$textUrl->setLabel($this->_view->getCibleText('form_banner_image_texturl_label'))->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'stdText');
$label = $textUrl->getDecorator('Label');
$label->setOption('class', $this->_labelCSS);
$groupImage = new Zend_Form_Element_Select('BI_GroupID');
$groupImage->setLabel($this->_view->getCibleText('form_banner_image_group'))->setAttrib('class', 'largeSelect');
$group = new GroupObject();
$groupArray = $group->groupCollection();
foreach ($groupArray as $group1) {
$groupImage->addMultiOption($group1['BG_ID'], $group1['BG_Name']);
}
$label = $groupImage->getDecorator('Label');
$label->setOption('class', $this->_labelCSS);
// Image for the product line
$imageView = new Zend_Form_Element_Image($imgField . '_preview', array('onclick' => 'return false;'));
$imageView->setImage($imageSrc);
$imagePicker = new Cible_Form_Element_ImagePicker($imgField, array('onchange' => "document.getElementById('imageView').src = document.getElementById('" . $imgField . "').value", 'associatedElement' => $imgField . '_preview', 'pathTmp' => $pathTmp, 'contentID' => $dataId));
$imagePicker->removeDecorator('Label');
$this->addElement($imageView);
$this->addElement($imagePicker);
$this->addElement($groupImage);
$this->addElement($textDescription);
$this->addElement($textUrl);
}
示例11: init
public function init()
{
$this->setMethod("POST");
$username = new Zend_Form_Element_Text("username");
$username->setRequired();
$username->setLabel("User Name:");
$username->setAttrib("placeholder", "Enter Your E-Mail");
$username->addValidator(new Zend_Validate_EmailAddress());
$username->setAttrib("class", "form-control");
$username->getDecorator("Label")->setOption("class", "control-label");
$username->getDecorator("Errors")->setOption("class", "alert alert-danger");
$username->getDecorator("Errors")->setOption("style", " list-style-type:none");
$password = new Zend_Form_Element_Password("password");
$password->setRequired();
$password->setLabel("Password:");
$password->setAttrib("placeholder", "Enter Your Password");
$password->setAttrib("class", "form-control");
$password->getDecorator("Label")->setOption("class", "control-label");
$password->getDecorator("Errors")->setOption("class", "alert alert-danger");
$password->getDecorator("Errors")->setOption("style", " list-style-type:none");
$submit = new Zend_Form_Element_Submit("submit");
$submit->setAttrib("class", "btn btn-xl center-block");
$this->addElements(array($username, $password, $submit));
}
示例12: setUp
/**
* See {@link PHPUnit_Framework_TestCase::setUp()} for details.
*/
protected function setUp()
{
parent::setUp();
// Usually a captcha element is rendered by the decorator,
// but for testing a text field is just as well.
// Using a text field avoids a dependency to the session.
$element = new Zend_Form_Element_Text('my_captcha');
$element->setAttrib('id', 'my-id');
// Simulate a HtmlTag ID that is based on the element name (as configured
// in the loadDefaultDecorators() mthod of the captcha element).
$element->getDecorator('HtmlTag')->setOption('id', $element->getName() . '-element');
$element->setView(new Zend_View());
$this->decorator = new Mol_Form_Decorator_Captcha_Word();
$this->decorator->setElement($element);
}
示例13: __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);
}
示例14: __construct
/**
* Class constructor
*
* @return void
*/
public function __construct($options)
{
parent::__construct($options);
$imageSrc = $options['imageSrc'];
$dataId = $options['dataId'];
$isNewImage = $options['isNewImage'];
$moduleName = $options['moduleName'];
if ($dataId == '') {
$pathTmp = "../../../../../data/images/" . $moduleName . "/tmp";
} else {
$pathTmp = "../../../../../data/images/" . $moduleName . "/" . $dataId . "/tmp";
}
$config = Zend_Registry::get('config');
// Name of the product line
$name = new Zend_Form_Element_Text('SCI_Name');
$name->setLabel($this->getView()->getCibleText('form_subcategory_name_label'))->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('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput ');
$label = $name->getDecorator('Label');
$label->setOption('class', $this->_labelCSS);
$this->addElement($name);
$oCategories = new CatalogCategoriesObject();
$listCat = $oCategories->getAll(Zend_Registry::get('currentEditLanguage'));
$categories = new Zend_Form_Element_Select('SC_CategoryID');
$categories->setLabel($this->getView()->getCibleText('form_select_category_label'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'largeSelect');
$categories->addMultiOption('', $this->getView()->getCibleText('form_select_default_label'));
foreach ($listCat as $data) {
$categories->addMultiOption($data['CC_ID'], $data['CCI_Name']);
}
$this->addElement($categories);
// ImageSrc
$imageBanner = new Zend_Form_Element_Select('SC_BannerGroupID');
$imageBanner->setLabel($this->getView()->getCibleText('form_banner_image_group_extranet'))->setAttrib('class', 'stdSelect');
$imageBanner->addMultiOption('', 'Sans image');
$group = new GroupObject();
$groupArray = $group->groupCollection();
foreach ($groupArray as $group1) {
$imageBanner->addMultiOption($group1['BG_ID'], $group1['BG_Name']);
}
$this->addElement($imageBanner);
// id of the associated meta data
$metaTagId = new Zend_Form_Element_Hidden('SCI_MetaId');
$metaTagId->removeDecorator('Label');
$this->addElement($metaTagId);
}
示例15: __construct
public function __construct($options = null)
{
parent::__construct($options);
$labelCSS = Cible_FunctionsGeneral::getLanguageLabelColor($options);
$imageSrc = $options['imageSrc'];
$dataId = $options['dataId'];
$imgField = $options['imgField'];
$isNewImage = $options['isNewImage'];
$moduleName = $options['moduleName'];
if ($dataId == '') {
$pathTmp = "../../../../../data/images/" . $moduleName . "/tmp";
} else {
$pathTmp = "../../../../../data/images/" . $moduleName . "/" . $dataId . "/tmp";
}
// hidden specify if new image for the news
// $newImage = new Zend_Form_Element_Hidden('isNewImage', array('value' => $isNewImage));
// $newImage->removeDecorator('Label');
// $this->addElement($newImage);
// Value of the reference
$value = new Zend_Form_Element_Text('RI_Value');
$value->setLabel($this->getView()->getCibleText('form_reference_value_label'))->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('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput');
$label = $value->getDecorator('Label');
$label->setOption('class', $this->_labelCSS);
$this->addElement($value);
// List of Type
$type = new Zend_Form_Element_Select('R_TypeRef');
$type->setLabel($this->getView()->getCibleText('form_reference_type_label'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdSelect')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))));
$oRef = new ReferencesObject();
$enums = $oRef->getEnum('R_TypeRef');
$multiOptions = array();
foreach ($enums as $enum) {
$multiOptions[$enum] = $this->getView()->getCibleText('form_enum_' . $enum);
}
$type->addMultiOptions($multiOptions);
$this->addElement($type);
// Value of the reference
$seq = new Zend_Form_Element_Text('RI_Seq');
$seq->setLabel($this->getView()->getCibleText('form_reference_seq_label'))->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('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput');
$label = $seq->getDecorator('Label');
$label->setOption('class', $this->_labelCSS);
$this->addElement($seq);
}