/** * 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); }
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); }
public function __construct($options = null) { parent::__construct($options); $newsletterID = $options['newsletterID']; $imageSrc = $options['imageSrc']; $isNewImage = $options['isNewImage']; // Title $title = new Zend_Form_Element_Text('NA_Title'); $title->setLabel($this->getView()->getCibleText('form_label_title'))->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput'); $this->addElement($title); // article image if ($newsletterID == '') { $pathTmp = "../../../../../data/images/newsletter/tmp"; } else { $pathTmp = "../../../../../data/images/newsletter/{$newsletterID}/tmp"; } // hidden specify if new image for the news $newImage = new Zend_Form_Element_Hidden('isNewImage', array('value' => $isNewImage)); $newImage->removeDecorator('Label'); //$newImage->setDecorators(array('ViewHelper')); $this->addElement($newImage); $imageTmp = new Zend_Form_Element_Hidden('ImageSrc_tmp'); $imageTmp->removeDecorator('Label'); $this->addElement($imageTmp); $imageOrg = new Zend_Form_Element_Hidden('ImageSrc_original'); $imageOrg->removeDecorator('Label'); $this->addElement($imageOrg); $imageView = new Zend_Form_Element_Image('ImageSrc_preview', array('onclick' => 'return false;')); $imageView->setImage($imageSrc); $this->addElement($imageView); $imagePicker = new Cible_Form_Element_ImagePicker('ImageSrc', array('onchange' => "document.getElementById('imageView').src = document.getElementById('ImageSrc').value", 'associatedElement' => 'ImageSrc_preview', 'pathTmp' => $pathTmp, 'contentID' => $newsletterID)); $imagePicker->removeDecorator('Label'); $this->addElement($imagePicker); $imageAlt = new Zend_Form_Element_Text("NA_ImageAlt"); $imageAlt->setLabel($this->getView()->getCibleText('form_label_description_image'))->setAttrib('class', 'stdTextInput'); $this->addElement($imageAlt); // resume text $resume = new Cible_Form_Element_Editor('NA_Resume', array('mode' => Cible_Form_Element_Editor::ADVANCED)); $resume->setLabel($this->getView()->getCibleText('form_label_short_text'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => Cible_Translation::getCibleText('validation_message_empty_field')))); $resume->setAttrib('class', 'largeEditor'); $this->addElement($resume); $optionText = new Zend_Form_Element_Radio('NA_TextLink'); $optionText->setRequired(true)->addMultiOption('1', $this->getView()->getCibleText('extranet_newsletter_option_text_url_text'))->addMultiOption('2', $this->getView()->getCibleText('extranet_newsletter_option_text_url_url'))->addMultiOption('3', $this->getView()->getCibleText('extranet_newsletter_option_text_url_nothing')); // Text $text = new Cible_Form_Element_Editor('NA_Text', array('mode' => Cible_Form_Element_Editor::ADVANCED, 'class' => 'textAreaToMoveUp')); $text->setLabel($this->getView()->getCibleText('form_label_text'))->setAttrib('class', 'largeEditor'); $this->addElement($text); $url = new Zend_Form_Element_Text('NA_URL'); $url->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'stdTextInputNewsletterURL'); $this->addElement($optionText); $this->addElement($url); $this->addDisplayGroup(array('NA_TextLink', 'NA_URL'), 'linkTo', array('legend' => $this->getView()->getCibleText('extranet_newsletter_text_url'))); }
/** * Class constructor * * @return void */ public function __construct($options) { $this->_addSubmitSaveClose = true; parent::__construct($options); $imageSrc = $options['imageSrc']; $dataId = $options['dataId']; $imgField = $options['imgField']; $isNewImage = $options['isNewImage']; $moduleName = $options['moduleName']; $productFormLeft = new Zend_Form_SubForm(); $productFormRight = new Zend_Form_SubForm(); $productFormBotPub = new Zend_Form_SubForm(); $productFormBotPro = new Zend_Form_SubForm(); 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'); $productFormRight->addElement($newImage); // Name of the product line $name = new Zend_Form_Element_Text('PI_Name'); $name->setLabel($productFormLeft->getView()->getCibleText('product_label_name') . "<span class='field_required'>*</span>")->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $productFormLeft->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); $productFormLeft->addElement($name); // List of sub categories $oSubCategories = new SubCategoriesObject(); $listSubCat = $oSubCategories->subcatCollection(Zend_Registry::get('currentEditLanguage')); $subCategories = new Zend_Form_Element_Select('P_SubCategoryID'); $subCategories->setLabel($productFormLeft->getView()->getCibleText('form_products_subcat_label') . "<span class='field_required'>*</span>")->setAttrib('class', 'largeSelect')->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $productFormLeft->getView()->getCibleText('validation_message_empty_field')))); $subCategories->addMultiOption('', $this->getView()->getCibleText('form_select_default_label')); $subCategories->addMultiOptions($listSubCat); $productFormLeft->addElement($subCategories); // Checkbox for new product $isNewProd = new Zend_Form_Element_Checkbox('P_New'); $isNewProd->setLabel($productFormLeft->getView()->getCibleText('form_product_isnew_label')); $isNewProd->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $productFormLeft->addElement($isNewProd); // id of the associated meta data $metaTagId = new Zend_Form_Element_Hidden('PI_MetaId'); $metaTagId->removeDecorator('Label'); $productFormLeft->addElement($metaTagId); // Image for the product line $imageTmp = new Zend_Form_Element_Hidden($imgField . '_tmp'); $imageTmp->removeDecorator('Label'); $productFormRight->addElement($imageTmp); $imageOrg = new Zend_Form_Element_Hidden($imgField . '_original'); $imageOrg->removeDecorator('Label'); $productFormRight->addElement($imageOrg); $imageView = new Zend_Form_Element_Image($imgField . '_preview', array('onclick' => 'return false;')); $imageView->setImage($imageSrc); $productFormRight->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->removeDecorator('Label'); $productFormRight->addElement($imagePicker); //Keywords field $keywords = new Zend_Form_Element_Text('PI_MotsCles'); $keywords->setLabel($productFormLeft->getView()->getCibleText('form_product_keywords_label'))->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline marginTop30', 'id' => 'title'))))->setAttrib('class', 'largeTextInput'); $label = $keywords->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $productFormLeft->addElement($keywords); // Description of the product $descrPublic = new Cible_Form_Element_Editor('PI_DescriptionPublic', array('mode' => Cible_Form_Element_Editor::ADVANCED, 'subFormID' => 'productFormBotPub')); $descrPublic->setLabel($this->getView()->getCibleText('product_label_descriptionPublic'))->setAttrib('class', 'largeEditor'); $label = $descrPublic->getDecorator('label'); $label->setOption('class', $this->_labelCSS); $productFormBotPub->addElement($descrPublic); // Technical specs of the product for public. $urlTechFile = new Zend_Form_Element_Hidden('PI_FicheTechniquePublicPDF'); $urlTechFile->removeDecorator('Label'); $productFormBotPub->addElement($urlTechFile); $techfile = new Zend_Form_Element_Hidden('technicalSpecsName'); $techfile->removeDecorator('Label'); $productFormBotPub->addElement($techfile); // Technical specs of the product. $technicalSpecs = new Cible_Form_Element_FileManager('PI_FicheTechniquePublicPDF', array('associatedElement' => 'productFormBotPub', 'displayElement' => 'technicalSpecsName', 'pathTmp' => $this->_filePath, 'contentID' => $this->_dataId, 'setInit' => true)); $technicalSpecs->setLabel($productFormBotPub->getView()->getCibleText('product_label_technical_specs'))->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $label = $technicalSpecs->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $productFormBotPub->addElement($technicalSpecs); //----------------------------------------------------- // Description of the product for pro $descrPro = new Cible_Form_Element_Editor('PI_DescriptionPro', array('mode' => Cible_Form_Element_Editor::ADVANCED, 'subFormID' => 'productFormBotPro')); $descrPro->setLabel($this->getView()->getCibleText('product_label_descriptionPro'))->setAttrib('class', 'largeEditor'); $label = $descrPro->getDecorator('label'); $label->setOption('class', $this->_labelCSS); $productFormBotPro->addElement($descrPro); // Technical specs of the product for pro. $urlTechFile = new Zend_Form_Element_Hidden('PI_FicheTechniqueProPDF'); $urlTechFile->removeDecorator('Label'); $productFormLeft->addElement($urlTechFile); $techfile = new Zend_Form_Element_Hidden('technicalSpecsPro'); $techfile->removeDecorator('Label'); $productFormBotPro->addElement($techfile); // Technical specs of the product. $technicalSpecsPro = new Cible_Form_Element_FileManager('PI_FicheTechniqueProPDF', array('associatedElement' => 'productFormBotPro', 'displayElement' => 'technicalSpecsPro', 'pathTmp' => $this->_filePath, 'contentID' => $this->_dataId, 'setInit' => true)); $technicalSpecsPro->setLabel($productFormBotPro->getView()->getCibleText('product_label_technical_specs'))->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $label = $technicalSpecsPro->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $productFormBotPro->addElement($technicalSpecsPro); $productFormBotPub->setLegend($this->getView()->getCibleText('subform_public_legend')); $productFormBotPub->setAttrib('class', 'fieldsetBorder'); $productFormBotPro->setLegend($this->getView()->getCibleText('subform_professional_legend')); $productFormBotPro->setAttrib('class', 'fieldsetBorder'); $this->addSubForm($productFormLeft, 'productFormLeft'); $this->addSubForm($productFormRight, 'productFormRight'); $this->addSubForm($productFormBotPub, 'productFormBotPub'); $this->addSubForm($productFormBotPro, 'productFormBotPro'); }
public function __construct($options = null) { $this->_addSubmitSaveClose = true; parent::__construct($options); $this->setName('page'); $imageSrc = $options['imageSrc']; $isNewImage = $options['isNewImage']; $menuId = $options['menuId']; if ($menuId == '') { $pathTmp = "../../../../../data/images/menu/tmp"; } else { $pathTmp = "../../../../../data/images/menu/{$menuId}/tmp"; } // input text for the title of the page $title = new Zend_Form_Element_Text('MenuTitle'); $title->setLabel(Cible_Translation::getCibleText('form_label_menu_title'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => Cible_Translation::getCibleText('error_field_required')))->setAttrib('class', 'stdTextInput'); $this->addElement($title); $menuItemType = new Zend_Form_Element_Radio('menuItemType'); $menuItemType->setLabel(Cible_Translation::getCibleText('form_label_menu_type'))->addMultiOption('page', Cible_Translation::getCibleText('form_label_menu_type_page'))->addMultiOption('placeholder', Cible_Translation::getCibleText('form_label_menu_type_placeholder'))->addMultiOption('external', Cible_Translation::getCibleText('form_label_menu_type_external'))->setValue('page')->setAttrib('onclick', 'javascript:openTypePanel(this.value)')->setSeparator(''); $this->addElement($menuItemType); $menuItemSecured = new Zend_Form_Element_Radio('menuItemSecured'); $menuItemSecured->setLabel(Cible_Translation::getCibleText('manage_block_secured_menu_status'))->addMultiOption('0', Cible_Translation::getCibleText('button_no'))->addMultiOption('1', Cible_Translation::getCibleText('button_yes'))->setValue('0')->setSeparator(''); $this->addElement($menuItemSecured); $controllerName = new Zend_Form_Element_Text('ControllerName'); $controllerName->setLabel(Cible_Translation::getCibleText('form_label_menu_destination_page'))->setAttrib('onfocus', "openPagePicker('page-picker-pagePicker');")->setRequired(true)->addValidator('NotEmpty', true, array('messages' => Cible_Translation::getCibleText('error_field_required')))->setAttrib('class', 'stdTextInput'); $this->addElement($controllerName); $pagePicker = new Cible_Form_Element_PagePicker('pagePicker', array('menu' => 'Principal', 'associatedElement' => 'ControllerName', 'onclick' => "javascript:closePagePicker(\"page-picker-pagePicker\")")); $pagePicker->setLabel(Cible_Translation::getCibleText('form_label_page_picker'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => Cible_Translation::getCibleText('error_page_selection_required'))); $pagePicker->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => "page-picker", 'id' => "page-picker-pagePicker")))); $this->addElement($pagePicker); $this->addDisplayGroup(array('ControllerName', 'pagePicker'), 'pageSelectionGroup'); $this->getDisplayGroup('pageSelectionGroup')->setAttrib('class', 'pageSelectionGroup')->removeDecorator('DtDdWrapper'); $link = new Zend_Form_Element_Text('MenuLink'); $link->setLabel(Cible_Translation::getCibleText('form_label_menu_destination_link'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => Cible_Translation::getCibleText('error_field_required')))->addPrefixPath('Cible', 'Cible')->setAttrib('class', 'stdTextInput'); $this->addElement($link); // input text for the css li $style = new Zend_Form_Element_Text('MenuTitleStyle'); $style->setLabel(Cible_Translation::getCibleText('form_label_menu_title_style'))->setAttrib('class', 'stdTextInput'); $this->addElement($style); $this->addDisplayGroup(array('MenuLink'), 'externalLinkSelectionGroup'); $this->getDisplayGroup('externalLinkSelectionGroup')->setAttrib('class', 'externalLinkSelectionGroup')->setAttrib('style', 'display: none')->removeDecorator('DtDdWrapper'); // Uses image $loadImage = new Zend_Form_Element_Checkbox('loadImage'); $loadImage->setLabel($this->getView()->getCibleText('form_label_menu_load_image')); $loadImage->removeDecorator('DtDdWrapper'); $loadImage->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); // Show this menu item $MID_Show = new Zend_Form_Element_Checkbox('MID_Show'); $MID_Show->setValue(1); $MID_Show->setLabel($this->getView()->getCibleText('form_label_menu_show_item')); $MID_Show->removeDecorator('DtDdWrapper'); $MID_Show->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $this->addElement($MID_Show); $this->addElement($loadImage); // hidden specify if new image for the news $newImage = new Zend_Form_Element_Hidden('isNewImage', array('value' => $isNewImage)); $newImage->removeDecorator('Label'); $this->addElement($newImage); // To allow to display title and image $imgTitle = new Zend_Form_Element_Checkbox('menuImgAndTitle'); $imgTitle->setLabel($this->getView()->getCibleText('form_label_menu_display_image_and_title')); $imgTitle->removeDecorator('DtDdWrapper'); $imgTitle->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $this->addElement($imgTitle); // IMAGE $imageTmp = new Zend_Form_Element_Hidden('menuImage_tmp'); $imageTmp->removeDecorator('Label'); $this->addElement($imageTmp); $imageOrg = new Zend_Form_Element_Hidden('menuImage_original'); $imageOrg->removeDecorator('Label'); $this->addElement($imageOrg); $imageView = new Zend_Form_Element_Image('menuImage_preview', array('onclick' => 'return false;')); $imageView->setImage($imageSrc)->removeDecorator('DtDdWrapper'); $this->addElement($imageView); $imagePicker = new Cible_Form_Element_ImagePicker('menuImage', array('onchange' => "document.getElementById('imageView').src = document.getElementById('menuImage').value", 'associatedElement' => 'menuImage_preview', 'pathTmp' => $pathTmp, 'contentID' => $menuId)); $imagePicker->removeDecorator('Label'); $this->addElement($imagePicker); $this->addDisplayGroup(array('menuImgAndTitle', 'isNewImage', 'menuImage_tmp', 'menuImage_original', 'menuImage_preview', 'menuImage'), 'imageGroup'); $this->getDisplayGroup('imageGroup')->setAttrib('class', 'imageGroup')->setAttrib('style', 'display: none')->removeDecorator('DtDdWrapper'); }
public function __construct($options = null) { $this->_addSubmitSaveClose = true; parent::__construct($options); $imageSrc = $options['imageSrc']; $newsID = $options['newsID']; $isNewImage = $options['isNewImage']; $catagoryID = ""; if (isset($options['catagoryID'])) { $catagoryID = $options['catagoryID']; } if ($newsID == '') { $pathTmp = "../../../../../data/images/news/tmp"; } else { $pathTmp = "../../../../../data/images/news/{$newsID}/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); // Title $title = new Zend_Form_Element_Text('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'); $label = $title->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($title); if (isset($options['categoriesList']) && $options['categoriesList'] == 'true') { // select box category (Parameter #1) $categoryNews = new Zend_Form_Element_Select('Param1'); $categoryNews->setLabel($this->getView()->getCibleText('form_label_news_category'))->setValue($catagoryID)->setAttrib('class', 'largeSelect'); $categories = new Categories(); $select = $categories->select()->setIntegrityCheck(false)->from('Categories')->join('CategoriesIndex', 'C_ID = CI_CategoryID')->where('C_ModuleID = ?', 2)->where('CI_LanguageID = ?', Zend_Registry::get("languageID"))->order('CI_Title'); $categoriesArray = $categories->fetchAll($select); foreach ($categoriesArray as $category) { $categoryNews->addMultiOption($category['C_ID'], $category['CI_Title']); } $this->addElement($categoryNews); } // Date picker $date = new Cible_Form_Element_DatePicker('Date', array('jquery.params' => array('changeYear' => true, 'changeMonth' => true))); $date->setLabel($this->getView()->getCibleText('form_label_date'))->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($date); // Date picker $datePicker = new Cible_Form_Element_DatePicker('ReleaseDate', array('jquery.params' => array('changeYear' => true, 'changeMonth' => true))); $datePicker->setLabel($this->getView()->getCibleText('form_extranet_news_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); // Status $status = new Zend_Form_Element_Checkbox('Status'); $status->setLabel('Nouvelle en ligne'); $status->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $this->addElement($status); // IMAGE $imageTmp = new Zend_Form_Element_Hidden('ImageSrc_tmp'); $imageTmp->removeDecorator('Label'); $this->addElement($imageTmp); $imageOrg = new Zend_Form_Element_Hidden('ImageSrc_original'); $imageOrg->removeDecorator('Label'); $this->addElement($imageOrg); $imageView = new Zend_Form_Element_Image('ImageSrc_preview', array('onclick' => 'return false;')); $imageView->setImage($imageSrc); $this->addElement($imageView); $imagePicker = new Cible_Form_Element_ImagePicker('ImageSrc', array('onchange' => "document.getElementById('imageView').src = document.getElementById('ImageSrc').value", 'associatedElement' => 'ImageSrc_preview', 'pathTmp' => $pathTmp, 'contentID' => $newsID)); $imagePicker->removeDecorator('Label'); $this->addElement($imagePicker); $imageAlt = new Zend_Form_Element_Text("ImageAlt"); $imageAlt->setLabel($this->getView()->getCibleText('form_label_description_image'))->setAttrib('class', 'stdTextInput'); $this->addElement($imageAlt); // Breif text $breif = new Cible_Form_Element_Editor('Brief', array('mode' => Cible_Form_Element_Editor::ADVANCED)); $breif->setLabel($this->getView()->getCibleText('form_label_short_text'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => Cible_Translation::getCibleText('validation_message_empty_field'))))->setAttrib('class', 'mediumEditor'); $breif->setDecorators(array('ViewHelper', array('Errors', array('placement' => 'prepend')), array('label', array('placement' => 'prepend')))); $label = $breif->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($breif); // Text $text = new Cible_Form_Element_Editor('Text', array('mode' => Cible_Form_Element_Editor::ADVANCED)); $text->setLabel($this->getView()->getCibleText('form_label_text'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => Cible_Translation::getCibleText('validation_message_empty_field'))))->setAttrib('class', 'mediumEditor')->setDecorators(array('ViewHelper', array('Errors', array('placement' => 'prepend')), array('label', array('placement' => 'prepend')))); $label = $text->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($text); $categoryID = new Zend_Form_Element_Hidden('CategoryID'); $this->addElement($categoryID); }
public function __construct($options = null) { $this->tableFieldPrefix = ''; $this->tableName = 'EventsData'; parent::__construct($options); $imageSrc = $options['imageSrc']; $eventID = $options['eventID']; $isNewImage = $options['isNewImage']; if ($eventID == '') { $pathTmp = "../../../../../data/images/event/tmp"; } else { $pathTmp = "../../../../../data/images/event/{$eventID}/tmp"; } // hidden specify if new image for the events $newImage = new Zend_Form_Element_Hidden('isNewImage', array('value' => $isNewImage)); $newImage->removeDecorator('Label'); $this->addElement($newImage); if (isset($options['categoriesList']) && $options['categoriesList'] == 'true') { // select box category (Parameter #1) $categoryEvents = new Zend_Form_Element_Select('Param1'); $categoryEvents->setLabel('Catégorie de l\'événement')->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) { $categoryEvents->addMultiOption($category['C_ID'], $category['CI_Title']); } $this->addElement($categoryEvents); } // Date picker $datePicker = new Cible_Form_Element_DateRangePicker('DateRange'); $datePicker->setLabel('Dates de l\'événement :')->setRequired()->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => Cible_Translation::getCibleText('validation_message_invalid_date')))); $this->addElement($datePicker); // Status $status = new Zend_Form_Element_Checkbox('Status'); $status->setLabel('événement en ligne'); $status->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $this->addElement($status); // IMAGE $imageTmp = new Zend_Form_Element_Hidden('ImageSrc_tmp'); $imageTmp->removeDecorator('Label'); $this->addElement($imageTmp); $imageOrg = new Zend_Form_Element_Hidden('ImageSrc_original'); $imageOrg->removeDecorator('Label'); $this->addElement($imageOrg); $imageView = new Zend_Form_Element_Image('ImageSrc_preview', array('onclick' => 'return false;')); $imageView->setImage($imageSrc); $this->addElement($imageView); $imagePicker = new Cible_Form_Element_ImagePicker('ImageSrc', array('onchange' => "document.getElementById('imageView').src = document.getElementById('ImageSrc').value", 'associatedElement' => 'ImageSrc_preview', 'pathTmp' => $pathTmp, 'contentID' => $eventID)); $imagePicker->removeDecorator('Label'); $this->addElement($imagePicker); $imageAlt = new Zend_Form_Element_Text("ImageAlt"); $imageAlt->setLabel($this->getView()->getCibleText('form_label_description_image'))->setAttrib('class', 'stdTextInput'); $this->addElement($imageAlt); // Breif text $breif = new Cible_Form_Element_Editor('Brief', array('mode' => Cible_Form_Element_Editor::ADVANCED)); $breif->setLabel('Lieu *')->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => Cible_Translation::getCibleText('validation_message_invalid_text'))))->setAttrib('class', 'mediumEditor'); $label = $breif->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($breif); // Text $text = new Cible_Form_Element_Editor('Text', array('mode' => Cible_Form_Element_Editor::ADVANCED)); $text->setLabel('Texte *')->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => Cible_Translation::getCibleText('validation_message_invalid_text'))))->setAttrib('class', 'mediumEditor'); $label = $text->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($text); $categoryID = new Zend_Form_Element_Hidden('CategoryID'); $this->addElement($categoryID); }
public function __construct($options = null) { //exit; $this->_addSubmitSaveClose = true; parent::__construct($options); //var_dump($options); // exit; /*$addAction = $options['addAction']; $lang = $options['lang']; $baseDir = $options['baseDir']; $cancelUrl = $options['cancelUrl']; $VI_ID = $options['VI_ID']; $V_Autoplay = $options['V_Autoplay']; $isNewPoster = $options['isNewPoster']; $isNewMP4 = $options['isNewMP4']; $isNewWEBM = $options['isNewWEBM']; $isNewOGG = $options['isNewOGG']; $V_Alias = $options['V_Alias']; $VI_Name = $options['VI_Name']; $V_Width = $options['V_Width']; $V_Height = $options['V_Height']; $VI_Description = $options['VI_Description']; $VI_Poster = $options['VI_Poster']; $VI_MP4 = $options['VI_MP4']; $VI_WEBM = $options['VI_WEBM']; $VI_OGG = $options['VI_OGG'];*/ $imageSrc = $options['imageSrc']; $pathTmp = "../../../../../data/images/tmp"; $VI_ID = new Zend_Form_Element_Hidden('VI_ID'); $VI_ID->removeDecorator('Label'); $this->addElement($VI_ID); $newPoster = new Zend_Form_Element_Hidden('isNewPoster', array('value' => $options['isNewPoster'])); $newPoster->removeDecorator('Label'); $this->addElement($newPoster); $newMP4 = new Zend_Form_Element_Hidden('isNewMP4', array('value' => $options['isNewMP4'])); $newMP4->removeDecorator('Label'); $this->addElement($newMP4); $newWEBM = new Zend_Form_Element_Hidden('isNewWEBM', array('value' => $options['isNewWEBM'])); $newWEBM->removeDecorator('Label'); $this->addElement($newWEBM); $newOGG = new Zend_Form_Element_Hidden('isNewOGG', array('value' => $options['isNewOGG'])); $newOGG->removeDecorator('Label'); $this->addElement($newOGG); $V_Autoplay = new Zend_Form_Element_Checkbox('V_Autoplay'); $V_Autoplay->setLabel($this->getView()->getCibleText('form_label_video_autoplay')); $V_Autoplay->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $this->addElement($V_Autoplay); // Title $V_Alias = new Zend_Form_Element_Text('V_Alias'); $V_Alias->setLabel($this->getView()->getCibleText('form_label_video_alias'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput'); $label = $V_Alias->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($V_Alias); // Title $VI_Name = new Zend_Form_Element_Text('VI_Name'); $VI_Name->setLabel($this->getView()->getCibleText('form_label_video_name'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput'); $label = $VI_Name->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($VI_Name); // Title $V_Width = new Zend_Form_Element_Text('V_Width'); $V_Width->setLabel($this->getView()->getCibleText('form_label_video_width'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput'); $label = $V_Width->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($V_Width); // Title $V_Height = new Zend_Form_Element_Text('V_Height'); $V_Height->setLabel($this->getView()->getCibleText('form_label_video_height'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput'); $label = $V_Height->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($V_Height); $VI_Poster_tmp = new Zend_Form_Element_Hidden('VI_Poster_tmp'); $VI_Poster_tmp->removeDecorator('Label'); $this->addElement($VI_Poster_tmp); $imageOrg = new Zend_Form_Element_Hidden('VI_Poster_original'); $imageOrg->removeDecorator('Label'); $this->addElement($imageOrg); $imageOrg = new Zend_Form_Element_Hidden('VI_Poster_original'); $imageOrg->removeDecorator('Label'); $this->addElement($imageOrg); $VI_WEBM_tmp = new Zend_Form_Element_Hidden('VI_WEBM_tmp'); $VI_WEBM_tmp->removeDecorator('Label'); $this->addElement($VI_WEBM_tmp); $VI_OGG_tmp = new Zend_Form_Element_Hidden('VI_OGG_tmp'); $VI_OGG_tmp->removeDecorator('Label'); $this->addElement($VI_OGG_tmp); // Image for the product line $imageView = new Zend_Form_Element_Image('VI_Poster_preview', array('onclick' => 'return false;')); $imageView->setAttrib('width', $options['V_Width']); $imageView->setAttrib('height', $options['V_Height']); $imageView->setImage($imageSrc); $this->addElement($imageView); $imagePickerPoster = new Cible_Form_Element_ImagePicker('VI_Poster', array('onchange' => "document.getElementById('imageView').src = document.getElementById('VI_Poster').value", 'associatedElement' => 'VI_Poster_preview', 'pathTmp' => $pathTmp, 'contentID' => $options['VI_ID'])); $imagePickerPoster->removeDecorator('Label'); $this->addElement($imagePickerPoster); $VI_MP4_tmpt = new Zend_Form_Element_Hidden('VI_MP4', array('value' => $options['VI_MP4'])); $VI_MP4_tmpt->removeDecorator('Label'); $this->addElement($VI_MP4_tmpt); $VI_MP4_Name_tmp = new Zend_Form_Element_Hidden('VI_MP4_Name'); $VI_MP4_Name_tmp->removeDecorator('Label'); $this->addElement($VI_MP4_Name_tmp); // Technical specs of the product. $video1 = new Cible_Form_Element_FileManager('VI_MP4', array('displayElement' => 'video1', 'pathTmp' => "/videos", 'contentID' => $this->_dataId, 'setInit' => true)); $video1->setLabel($this->getView()->getCibleText('form_label_video_VI_MP4'))->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $label = $video1->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($video1); $VI_WEBM_tmpt = new Zend_Form_Element_Hidden('VI_WEBM', array('value' => $options['VI_WEBM'])); $VI_WEBM_tmpt->removeDecorator('Label'); $this->addElement($VI_WEBM_tmpt); $VI_WEBM_Name_tmp = new Zend_Form_Element_Hidden('VI_WEBM_Name'); $VI_WEBM_Name_tmp->removeDecorator('Label'); $this->addElement($VI_WEBM_Name_tmp); // Technical specs of the product. $video2 = new Cible_Form_Element_FileManager('VI_WEBM', array('displayElement' => 'video2', 'pathTmp' => "/videos", 'contentID' => $this->_dataId, 'setInit' => true)); $video2->setLabel($this->getView()->getCibleText('form_label_video_VI_WEBM'))->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $label = $video2->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($video2); $VI_OGG_tmpt = new Zend_Form_Element_Hidden('VI_OGG', array('value' => $options['VI_OGG'])); $VI_OGG_tmpt->removeDecorator('Label'); $this->addElement($VI_OGG_tmpt); $VI_OGG_Name_tmp = new Zend_Form_Element_Hidden('VI_OGG_Name'); $VI_OGG_Name_tmp->removeDecorator('Label'); $this->addElement($VI_OGG_Name_tmp); // Technical specs of the product. $video3 = new Cible_Form_Element_FileManager('VI_OGG', array('displayElement' => 'video3', 'pathTmp' => "/videos", 'contentID' => $this->_dataId, 'setInit' => true)); $video3->setLabel($this->getView()->getCibleText('form_label_video_VI_OGG'))->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $label = $video3->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($video3); $VI_Description = new Cible_Form_Element_Editor('VI_Description', array('mode' => Cible_Form_Element_Editor::ADVANCED, 'value' => $options['VI_Description'])); $VI_Description->setLabel($this->getView()->getCibleText('form_label_video_description')); $label = $VI_Description->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($VI_Description); /* if($options['VI_ID'] == '') $pathTmp = "../../../../../data/images/videos/tmp"; else $pathTmp = "../../../../../data/images/videos/" . $options['VI_ID'] . "/tmp"; $VI_ID = new Zend_Form_Element_Hidden('VI_ID', array('value'=>$VI_ID)); $VI_ID->removeDecorator('Label'); $this->addElement($VI_ID); $newPoster = new Zend_Form_Element_Hidden('isNewPoster', array('value'=>$isNewPoster)); $newPoster->removeDecorator('Label'); $this->addElement($newPoster); $newMP4 = new Zend_Form_Element_Hidden('isNewMP4', array('value'=>$isNewMP4)); $newMP4->removeDecorator('Label'); $this->addElement($newMP4); $newWEBM = new Zend_Form_Element_Hidden('isNewWEBM', array('value'=>$isNewWEBM)); $newWEBM->removeDecorator('Label'); $this->addElement($newWEBM); $newOGG = new Zend_Form_Element_Hidden('isNewOGG', array('value'=>$isNewOGG)); $newOGG->removeDecorator('Label'); $this->addElement($newOGG); $V_Autoplay = new Zend_Form_Element_Checkbox('$V_Autoplay'); $V_Autoplay->setLabel($this->getView()->getCibleText('form_label_video_autoplay')); $V_Autoplay->setDecorators(array( 'ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')), )); $this->addElement($V_Autoplay); // Title $V_Alias = new Zend_Form_Element_Text('V_Alias'); $V_Alias->setLabel($this->getView()->getCibleText('form_label_video_alias')) ->setRequired(true) ->addFilter('StripTags') ->addFilter('StringTrim') ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field')))) ->setAttrib('class','stdTextInput'); $label = $V_Alias->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($V_Alias); // Title $VI_Name = new Zend_Form_Element_Text('VI_Name'); $VI_Name->setLabel($this->getView()->getCibleText('form_label_video_name')) ->setRequired(true) ->addFilter('StripTags') ->addFilter('StringTrim') ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field')))) ->setAttrib('class','stdTextInput'); $label = $VI_Name->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($VI_Name); // Title $V_Width = new Zend_Form_Element_Text('V_Width'); $V_Width->setLabel($this->getView()->getCibleText('form_label_video_width')) ->setRequired(true) ->addFilter('StripTags') ->addFilter('StringTrim') ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field')))) ->setAttrib('class','stdTextInput'); $label = $V_Width->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($V_Width); // Title $V_Height = new Zend_Form_Element_Text('V_Height'); $V_Height->setLabel($this->getView()->getCibleText('form_label_video_height')) ->setRequired(true) ->addFilter('StripTags') ->addFilter('StringTrim') ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field')))) ->setAttrib('class','stdTextInput'); $label = $V_Height->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($V_Height); $VI_Poster_tmp = new Zend_Form_Element_Hidden('VI_Poster_tmp'); $VI_Poster_tmp->removeDecorator('Label'); $this->addElement($VI_Poster_tmp); $VI_MP4_tmp = new Zend_Form_Element_Hidden('VI_MP4_tmp'); $VI_MP4_tmp->removeDecorator('Label'); $this->addElement($VI_MP4_tmp); $VI_WEBM_tmp = new Zend_Form_Element_Hidden('VI_WEBM_tmp'); $VI_WEBM_tmp->removeDecorator('Label'); $this->addElement($VI_WEBM_tmp); $VI_OGG_tmp = new Zend_Form_Element_Hidden('VI_OGG_tmp'); $VI_OGG_tmp->removeDecorator('Label'); $this->addElement($VI_OGG_tmp); $VI_Poster_original = new Zend_Form_Element_Hidden('VI_Poster_original'); $VI_Poster_original->removeDecorator('Label'); $this->addElement($VI_Poster_original); $VIPosterp = new Zend_Form_Element_Image('VI_Poster_preview', array('onclick'=>'return false;')); $VIPosterp->setImage($VI_Poster); $VIPosterp->setLabel($this->getView()->getCibleText('form_label_video_poster')); $this->addElement($VIPosterp); $imagePickerPoster = new Cible_Form_Element_ImagePicker('VI_Poster', array( 'onchange' => "document.getElementById('VI_Poster').src = document.getElementById('VI_Poster_preview').value", 'associatedElement' => 'VI_Poster_preview','pathTmp'=>$pathTmp,'contentID'=>$VI_ID)); $imagePickerPoster->removeDecorator('Label'); $this->addElement($imagePickerPoster); $VI_MP4_original = new Zend_Form_Element_Hidden('VI_MP4_original'); $VI_MP4_original->removeDecorator('Label'); $this->addElement($VI_MP4_original); $VI_MP4p = new Zend_Form_Element_Image('VI_MP4_preview', array('onclick'=>'return false;')); $VI_MP4p->setImage($VI_MP4); $VI_MP4p->setLabel($this->getView()->getCibleText('form_label_video_VI_MP4')); $this->addElement($VI_MP4p); $imagePickerVI_MP4 = new Cible_Form_Element_ImagePicker('VI_MP4', array( 'onchange' => "document.getElementById('VI_MP4').src = document.getElementById('VI_MP4_preview').value;", 'associatedElement' => 'VI_MP4_preview','pathTmp'=>$pathTmp,'contentID'=>$VI_MP4)); $imagePickerVI_MP4->removeDecorator('Label'); $this->addElement($imagePickerVI_MP4); $VI_WEBM_original = new Zend_Form_Element_Hidden('VI_WEBM_original'); $VI_WEBM_original->removeDecorator('Label'); $this->addElement($VI_WEBM_original); $VI_WEBMp = new Zend_Form_Element_Image('VI_WEBM_preview', array('onclick'=>'return false;')); $VI_WEBMp->setImage($VI_WEBM); $VI_WEBMp->setLabel($this->getView()->getCibleText('form_label_video_VI_WEBM')); $this->addElement($VI_WEBMp); $imagePickerVI_WEBM = new Cible_Form_Element_ImagePicker('VI_WEBM', array( 'onchange' => "document.getElementById('VI_WEBM').src = document.getElementById('VI_WEBM_preview').value", 'associatedElement' => 'VI_WEBM_preview','pathTmp'=>$pathTmp,'contentID'=>$VI_WEBM)); $imagePickerVI_WEBM->removeDecorator('Label'); $this->addElement($imagePickerVI_WEBM); $VI_OGG_original = new Zend_Form_Element_Hidden('VI_OGG_original'); $VI_OGG_original->removeDecorator('Label'); $this->addElement($VI_OGG_original); $VI_OGGp = new Zend_Form_Element_Image('VI_OGG_preview', array('onclick'=>'return false;')); $VI_OGGp->setImage($VI_OGG); $VI_OGGp->setLabel($this->getView()->getCibleText('form_label_video_VI_OGG')); $this->addElement($VI_OGGp); $imagePickerVI_OGG = new Cible_Form_Element_ImagePicker('VI_OGG', array( 'onchange' => "document.getElementById('VI_OGG').src = document.getElementById('VI_OGG_preview').value", 'associatedElement' => 'VI_OGG_preview','pathTmp'=>$pathTmp,'contentID'=>$VI_OGG)); $imagePickerVI_OGG->removeDecorator('Label'); $this->addElement($imagePickerVI_OGG); $VI_Description = new Cible_Form_Element_Editor('VI_Description', array('mode' => Cible_Form_Element_Editor::ADVANCED)); $VI_Description->setLabel($this->getView()->getCibleText('form_label_video_description')); $label = $VI_Description->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($VI_Description); */ }
/** * Class constructor * * @return void */ public function __construct($options, $listVideo) { parent::__construct($options); $this->setParameters($options); if ($this->_dataId == '') { $pathTmp = "../../../../../data/images/" . $this->_moduleName . "/tmp"; } else { $pathTmp = "../../../../../data/images/" . $this->_moduleName . "/" . $this->_dataId . "/tmp"; } $this->_filePath = '../../../' . $this->_filePath; // Name of the banner $name = new Zend_Form_Element_Text('BF_Name'); $name->setLabel($this->getView()->getCibleText('form_label_name'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', 'Errors', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $this->addElement($name); $listVideos = array(); for ($xx = 0; $xx < count($listVideo); $xx++) { $listVideos[$listVideo[$xx]['V_ID']] = $listVideo[$xx]['V_Alias']; } for ($x = 1; $x <= $this->_numberImageFeature; $x++) { $isNewImage = 'isNewImage' . $x; $newImage = new Zend_Form_Element_Hidden($isNewImage, array('value' => $this->_isNewImage[$x])); $newImage->removeDecorator('Label'); $this->addElement($newImage); // Image to load $IF_Img_tmp = 'IF_Img' . $x . '_tmp'; $IF_Img_original = 'IF_Img' . $x . '_original'; $IF_Img_preview = 'IF_Img' . $x . '_preview'; $IF_Img = 'IF_Img' . $x; $imageTmp = new Zend_Form_Element_Hidden($IF_Img_tmp); $imageTmp->removeDecorator('Label'); $this->addElement($imageTmp); $imageOrg = new Zend_Form_Element_Hidden($IF_Img_original); $imageOrg->removeDecorator('Label'); $this->addElement($imageOrg); $imageView = new Zend_Form_Element_Image($IF_Img_preview, array('onclick' => 'return false;')); $imageView->setImage($this->_imageSrc[$x])->removeDecorator('Label')->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'alignCenter', 'id' => 'title')))); $this->addElement($imageView); //echo $IF_Img . $pathTmp . "<br />"; $imagePicker = new Cible_Form_Element_ImagePicker($IF_Img, array('onchange' => "document.getElementById('" . $IF_Img . "').src = document.getElementById('" . $IF_Img . "').value", 'associatedElement' => $IF_Img_preview, 'pathTmp' => $pathTmp, 'contentID' => $this->_dataId)); $imagePicker->setLabel('')->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'alignCenter', 'id' => 'title')))); $imagePicker->removeDecorator('Label'); $this->addElement($imagePicker); // label for the image $IFI_Label = 'IFI_Label' . $x; $labelX = new Zend_Form_Element_Text($IFI_Label); $labelX->setLabel($this->getView()->getCibleText('form_label_label'))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $label = $labelX->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($labelX); // label for the link $IFI_UrlVideo = 'IFI_UrlVideo' . $x; $optionUrlVideo = new Zend_Form_Element_Radio($IFI_UrlVideo); $optionUrlVideo->setRequired(false)->addMultiOption('0', $this->getView()->getCibleText('extranet_form_label_url'), 'number1')->addMultiOption('1', $this->getView()->getCibleText('extranet_form_label_video'), 'number2'); $this->addElement($optionUrlVideo); $IFI_Url = 'IFI_Url' . $x; $urlX = new Zend_Form_Element_Text($IFI_Url); $urlX->setLabel($this->getView()->getCibleText('form_label_url'))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline_link', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $label = $urlX->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($urlX); /* $optionUrlVideo = new Zend_Form_Element_Radio($IFI_UrlVideo); $optionUrlVideo->setRequired(false) ->addMultiOption('1', $this->getView()->getCibleText('extranet_newsletter_option_text_url_url')) ; $this->addElement($optionUrlVideo);*/ $IFI_Video = 'IFI_Video' . $x; $video = new Zend_Form_Element_Select($IFI_Video); $video->setLabel($this->getView()->getCibleText('form_label_video'))->setAttrib('class', 'largeSelect'); $video->addMultiOptions($listVideos); $this->addElement($video); $IFI_Text1 = 'IFI_TextA' . $x; $IFI_Text2 = 'IFI_TextB' . $x; $IFI_Text1X = new Zend_Form_Element_Text($IFI_Text1); $IFI_Text1X->setLabel($this->getView()->getCibleText('form_label_text_1'))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $label = $IFI_Text1X->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($IFI_Text1X); $IFI_Text2X = new Zend_Form_Element_Text($IFI_Text2); $IFI_Text2X->setLabel($this->getView()->getCibleText('form_label_text_2'))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $label = $IFI_Text2X->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($IFI_Text2X); $IF_Style = 'IF_Style' . $x; $style = new Zend_Form_Element_Select($IF_Style); $style->setLabel($this->getView()->getCibleText('form_style_label'))->setAttrib('class', 'largeSelect'); $listStyles = array('sec0' => 'Style over 0 secondes', 'sec1' => 'Style over 1 secondes', 'secUp1' => 'Style up 1 secondes'); $style->addMultiOption('', $this->getView()->getCibleText('form_select_default_label')); $style->addMultiOptions($listStyles); $this->addElement($style); $imageDisplay = 'imageDisplay' . $x; $this->addDisplayGroup(array($isNewImage, $IF_Img_tmp, $IF_Img_original, $IF_Img_preview, $IF_Img, $IFI_Label, $IFI_UrlVideo, $IFI_Url, $IFI_Video, $IFI_Text1, $IFI_Text2, $IF_Style), $imageDisplay); $this->getDisplayGroup($imageDisplay)->setLegend('Image ' . $x)->setAttrib('class', 'imageGroup first')->removeDecorator('DtDdWrapper'); } }