Esempio n. 1
0
 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($this->getView()->getCibleText('form_gallery_blockCategory_label'))->setAttrib('class', 'largeSelect')->setOrder(11);
     $categories = new Categories();
     $select = $categories->select()->setIntegrityCheck(false)->from('Categories')->join('CategoriesIndex', 'C_ID = CI_CategoryID')->where('C_ModuleID = ?', 9)->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']);
     }
     $this->addElement($blockCategory);
     $blockGallery = new Zend_Form_Element_Select('Param2');
     $blockGallery->setLabel($this->getView()->getCibleText('form_gallery_blockGallerey_label'))->setAttrib('class', 'largeSelect')->setOrder(12);
     $galleries = new Galleries();
     $selectG = $galleries->select()->setIntegrityCheck(false)->from('Galleries')->join('GalleriesIndex', 'G_ID = GI_GalleryID')->where('G_Online = 1')->where('GI_LanguageID = ?', Zend_Registry::get("languageID"))->order('GI_Title');
     $galleriesArray = $galleries->fetchAll($selectG);
     //echo $selectG;
     $blockGallery->addMultiOption('0', $this->getView()->getCibleText('form_gallery_blockGallerey_None'));
     foreach ($galleriesArray as $gallery) {
         $blockGallery->addMultiOption($gallery['GI_GalleryID'], $gallery['GI_Title']);
     }
     $this->addElement($blockGallery);
     $this->removeDisplayGroup('parameters');
     $this->addDisplayGroup(array('Param999', 'Param1', 'Param2'), 'parameters');
     $parameters = $this->getDisplayGroup('parameters');
 }
Esempio n. 2
0
 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');
 }
Esempio n. 3
0
 public function __construct($options = null)
 {
     $baseDir = $options['baseDir'];
     parent::__construct($options);
     /****************************************/
     // PARAMETERS
     /****************************************/
     // Build the select to choose the associated form (Parameter #1)
     $blockForm = new Zend_Form_Element_Select('Param1');
     $blockForm->setLabel('Formulaire associé à ce bloc')->setAttrib('class', 'largeSelect');
     $forms = new Form();
     $select = $forms->getFormList();
     $formsArray = $forms->fetchAll($select);
     // Set the default value
     $blockForm->addMultiOption('0', 'Choisir un formulaire');
     //Fill the dropdown list
     foreach ($formsArray as $form) {
         $blockForm->addMultiOption($form['F_ID'], $form['FI_Title']);
     }
     // Test if a value has been chosen
     $at_least_one = new Zend_Validate_GreaterThan('0');
     $at_least_one->setMessage('Vous devez choisir un élément dans la liste.');
     $blockForm->addValidator($at_least_one);
     $this->addElements(array($blockForm));
     $this->removeDisplayGroup('parameters');
     $this->addDisplayGroup(array('Param999', 'Param1'), 'parameters');
     $parameters = $this->getDisplayGroup('parameters');
 }
Esempio n. 4
0
 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'));
 }
Esempio n. 5
0
 public function __construct($options = null)
 {
     $baseDir = $options['baseDir'];
     $pageID = $options['pageID'];
     parent::__construct($options);
     $this->removeDisplayGroup('parameters');
     $this->addDisplayGroup(array('Param999', 'Param1'), 'parameters');
     $parameters = $this->getDisplayGroup('parameters');
 }
Esempio n. 6
0
 public function __construct($options = null)
 {
     $baseDir = $options['baseDir'];
     $pageID = $options['pageID'];
     parent::__construct($options);
     /****************************************/
     // PARAMETERS
     /****************************************/
     $regexValidate = new Cible_Validate_Email();
     $regexValidate->setMessage($this->getView()->getCibleText('validation_message_emailAddressInvalid'), 'regexNotMatch');
     // display news date (Parameter #1)
     $recipient = new Zend_Form_Element_Text('Param1');
     $recipient->setLabel('Acheminer à l\'adresse suivante: ')->setOrder(3)->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->addValidator($regexValidate);
     $this->addElement($recipient);
     $this->removeDisplayGroup('parameters');
     $this->addDisplayGroup(array('Param999', 'Param1'), 'parameters');
     $parameters = $this->getDisplayGroup('parameters');
 }
Esempio n. 7
0
 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($this->getView()->getCibleText('label_category_news_bloc'))->setAttrib('class', 'largeSelect')->setOrder(3);
     $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) {
         $blockCategory->addMultiOption($category['C_ID'], $category['CI_Title']);
     }
     $this->addElement($blockCategory);
     // number of news to show in front-end (Parameter #2)
     $blockNewsMax = new Zend_Form_Element_Text('Param2');
     $blockNewsMax->setLabel($this->getView()->getCibleText('label_number_news_show'))->setAttrib('class', 'smallTextInput')->setOrder(4);
     $this->addElement($blockNewsMax);
     // show the breif text in front-end (Parameter #3)
     $blockShowBrief = new Zend_Form_Element_Checkbox('Param3');
     $blockShowBrief->setLabel($this->getView()->getCibleText('label_show_brief_text'))->setOrder(5);
     $blockShowBrief->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox'))));
     $this->addElement($blockShowBrief);
     // display order (Parameter #4)
     $blockOrder = new Zend_Form_Element_Select('Param4');
     $blockOrder->setLabel($this->getView()->getCibleText('label_order_display'))->setAttrib('class', 'largeSelect')->setOrder(6);
     $blockOrder->addMultiOption('ND_Date DESC', $this->getView()->getCibleText('label_date_desc'));
     $blockOrder->addMultiOption('ND_Date ASC', $this->getView()->getCibleText('label_date_asc'));
     $blockOrder->addMultiOption('ND_Title ASC', $this->getView()->getCibleText('label_alpha_asc'));
     $this->addElement($blockOrder);
     // display news date (Parameter #5)
     $blockDate = new Zend_Form_Element_Checkbox('Param5');
     $blockDate->setLabel($this->getView()->getCibleText('label_date_news'))->setOrder(7);
     $blockDate->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox'))));
     $this->addElement($blockDate);
     $this->removeDisplayGroup('parameters');
     $this->addDisplayGroup(array('Param999', 'Param1', 'Param2', 'Param3', 'Param4', 'Param5'), 'parameters');
     $parameters = $this->getDisplayGroup('parameters');
     //$parameters->setLegend($this->_view->getCibleText('form_parameters_fieldset'));
 }
Esempio n. 8
0
 public function __construct($options = null)
 {
     $baseDir = $options['baseDir'];
     $pageID = $options['pageID'];
     parent::__construct($options);
     /****************************************/
     // PARAMETERS
     /****************************************/
     // display news date (Parameter #1)
     $category = new Zend_Form_Element_Select('Param1');
     $category->setLabel($this->_view->getCibleText('form_select_option_rss_choose_category'))->setOrder(3);
     $categories = Cible_FunctionsGeneral::getRssCategories();
     foreach ($categories as $cat) {
         $category->addMultiOption($cat['C_ID'], $cat['CI_Title']);
     }
     $this->addElement($category);
     $this->removeDisplayGroup('parameters');
     $this->addDisplayGroup(array('Param999', 'Param1'), 'parameters');
     $parameters = $this->getDisplayGroup('parameters');
 }
Esempio n. 9
0
 public function __construct($options = null)
 {
     $baseDir = $options['baseDir'];
     $pageID = $options['pageID'];
     $options['cancelUrl'] = "";
     parent::__construct($options);
     /****************************************/
     // PARAMETERS
     /****************************************/
     /****************************************/
     // select newsletters categories (Param #1)
     $categoriesData = $this->getView()->getAllNewsletterCategories();
     $blockCategory = new Zend_Form_Element_Select('Param1');
     $blockCategory->setLabel($this->getView()->getCibleText('form_label_category'))->setAttrib('class', 'largeSelect');
     foreach ($categoriesData as $category) {
         $blockCategory->addMultiOption($category['C_ID'], $category['CI_Title']);
     }
     $this->addElement($blockCategory);
     $this->addDisplayGroup(array('Param999', 'Param1', 'Param2'), 'parameters');
     $parameters = $this->getDisplayGroup('parameters');
     $parameters->setLegend($this->getView()->getCibleText('form_legend_settings'));
 }
Esempio n. 10
0
 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(Cible_Translation::getCibleText('catalog_category_block_page'))->setAttrib('class', 'largeSelect')->setOrder(2);
     $langId = $this->getView()->_defaultEditLanguage;
     $oCategory = new CatalogCategoriesObject();
     $categories = $oCategory->getAll($langId);
     foreach ($categories as $category) {
         $blockCategory->addMultiOption($category['CC_ID'], $category['CCI_Name']);
     }
     $this->addElement($blockCategory);
     $this->removeDisplayGroup('parameters');
     $this->addDisplayGroup(array('Param1', 'Param999'), 'parameters');
     $parameters = $this->getDisplayGroup('parameters');
 }
Esempio n. 11
0
 public function __construct($options = null)
 {
     $baseDir = $options['baseDir'];
     $pageID = $options['pageID'];
     parent::__construct($options);
     /****************************************/
     // PARAMETERS
     /****************************************/
     // display news date (Parameter #1)
     //            $cartType = new Zend_Form_Element_Radio('Param1');// Zend_Form_Element_Checkbox('Param1');
     //            $cartType->setLabel('Type de panier')
     //                           ->setOrder(3);
     //            $cartType->setSeparator('');
     //            $cartType->addMultiOptions(array(
     //                1 => 'Flooring',
     //                2 => 'SheetRubber')
     //            )->setValue(1);
     //
     //            $this->addElement($cartType);
     $this->removeDisplayGroup('parameters');
     $this->addDisplayGroup(array('Param999', 'Param1'), 'parameters');
     $parameters = $this->getDisplayGroup('parameters');
 }
Esempio n. 12
0
 public function __construct($options = null)
 {
     $baseDir = $options['baseDir'];
     $pageID = $options['pageID'];
     parent::__construct($options);
 }
Esempio n. 13
0
    public function __construct($options = null)
    {
        $baseDir = $options['baseDir'];
        $pageID = $options['pageID'];
        parent::__construct($options);
        /****************************************/
        // PARAMETERS
        /****************************************/
        // select box category (Parameter #1)
        $blockBanners = new Zend_Form_Element_Select('Param1');
        $blockBanners->setLabel(Cible_Translation::getCibleText('banners_image_group_block_page'))->setAttrib('class', 'largeSelect');
        $langId = $this->getView()->_defaultEditLanguage;
        $oGroup = new GroupObject();
        $groups = $oGroup->getAll($langId);
        foreach ($groups as $group) {
            $blockBanners->addMultiOption($group['BG_ID'], $group['BG_Name']);
        }
        $oBanner = new BannerFeaturedObject();
        $banners = $oBanner->getAll($langId);
        foreach ($banners as $banner) {
            $id = $banner['BF_ID'] . '_f';
            $blockBanners->addMultiOption($id, $banner['BF_Name']);
        }
        // Status
        $autoPlay = new Zend_Form_Element_Checkbox('Param2');
        $autoPlay->setLabel(Cible_Translation::getCibleText('banners_autoPlay_block_page'));
        $autoPlay->setDecorators(array('ViewHelper', array('label', array('placement' => 'append', 'class' => 'label_checkbox_banniere check_auto_box')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'checkbox_banniere'))));
        // select box category (Parameter #3)
        $blockDelais = new Zend_Form_Element_Text('Param3');
        $blockDelais->setLabel(Cible_Translation::getCibleText('banners_delais_block_page'))->setAttrib('class', 'largeSelect')->setValue(3);
        // select box category (Parameter #4)
        $blockTransition = new Zend_Form_Element_Text('Param4');
        $blockTransition->setLabel(Cible_Translation::getCibleText('banners_transition_block_page'))->setAttrib('class', 'largeSelect')->setValue('1000');
        // Status
        $navi = new Zend_Form_Element_Checkbox('Param5');
        $navi->setLabel(Cible_Translation::getCibleText('banners_navigation_block_page'));
        $navi->setDecorators(array('ViewHelper', array('label', array('placement' => 'append', 'class' => 'label_checkbox_banniere')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'checkbox_banniere'))));
        $blockEffect = new Zend_Form_Element_Select('Param6');
        $blockEffect->setLabel(Cible_Translation::getCibleText('banners_effect_block_page'))->setAttrib('class', 'largeSelect');
        $effects = array('none' => 'Aucun', 'fade' => 'fading', 'scrollHorz' => 'slide');
        $blockEffect->addMultiOptions($effects);
        $this->addElement($blockBanners);
        $this->addElement($blockDelais);
        $this->addElement($blockTransition);
        $this->addElement($navi);
        $this->addElement($autoPlay);
        $this->addElement($blockEffect);
        $this->addDisplayGroup(array('Param1', 'Param2', 'Param3', 'Param4', 'Param5', 'Param6', 'Param999'), 'parameters');
        $parameters = $this->getDisplayGroup('parameters');
        $script = <<<EOS
        \$('#Param999').change(function(){
       // console.log('passe');
            if (\$(this).val() == 'index')
            {
                \$('#Param2').show();
                \$('label[for=Param2]').show();
                \$('#Param3').show();
                \$('label[for=Param3]').show();
                \$('#Param4').show();
                \$('label[for=Param4]').show();
                \$('#Param5').show();
                \$('label[for=Param5]').show();
                \$('#Param6').show();
                \$('label[for=Param6]').show();
            }
            else
            {
                \$('#Param2').hide();
                \$('label[for=Param2]').hide();
                \$('#Param3').hide();
                \$('label[for=Param3]').hide();
                \$('#Param4').hide();
                \$('label[for=Param4]').hide();
                \$('#Param5').hide();
                \$('label[for=Param5]').hide();
                \$('#Param6').hide();
                \$('label[for=Param6]').hide();
            }
        }).change();
EOS;
        $this->getView()->inlineScript()->appendScript($script);
        //var_dump($this->getView()->inlineScript());
    }