コード例 #1
0
ファイル: IndexController.php プロジェクト: anunay/stentors
 /**
  * Display the list
  *
  *
  *
  * @return void
  */
 public function featuredAction()
 {
     $langId = Zend_Registry::get('languageID');
     $blockID = $this->_request->getParam('BlockID');
     if ($blockID) {
         $this->_blockID = $blockID;
         $params = Cible_FunctionsBlocks::getBlockParameters($blockID);
         $groupId = 0;
         $autoPlay = 0;
         $delais = 0;
         $transition = 0;
         $navi = 0;
         $effect = 0;
         foreach ($params as $param) {
             $blockParams[$param['P_Number']] = $param['P_Value'];
         }
         $videos = new VideoObject();
         $listVideo = array();
         $listVideo = $videos->getVideosList();
         // var_dump($listVideo);
         $groupId = str_replace('_f', '', $blockParams[1]);
         $this->view->autoPlay = $blockParams[2];
         $this->view->delais = $blockParams[3];
         $this->view->transition = $blockParams[4];
         $this->view->navi = $blockParams[5];
         $this->view->effect = $blockParams[6];
         $oBannerFeat = new BannerFeaturedObject();
         $oImageFeat = new BannerFeaturedImageObject();
         $banner = $oBannerFeat->populate($groupId, $langId);
         $imgBanner = $oImageFeat->getData($langId, $groupId);
         //var_dump($imgBanner);
         //exit;
         $config = Zend_Registry::get('config');
         $cfgBanner = $config->banners->imagefeat->toArray();
         $this->view->imgCfg = $cfgBanner;
         $this->view->imgFeat = $imgBanner;
         $this->view->imgPath = $this->_imagesFolder . 'featured/' . $groupId . '/';
         $this->view->videoPath = $this->_rootVideoPath;
         //$this->view->listVideos = $listVideo;
     }
 }
コード例 #2
0
 public function listAction()
 {
     if ($this->view->aclIsAllowed($this->_moduleTitle, 'edit', true)) {
         $tables = array('BannerFeaturedData' => array('BF_ID'), 'BannerFeaturedIndex' => array('BFI_DataID', 'BFI_LanguageID', 'BFI_Label'));
         $field_list = array('BF_ID' => array('width' => '50px'), 'BF_Name' => array('width' => '300px'));
         $this->view->params = $this->_getAllParams();
         $pageID = $this->_getParam('pageID');
         $langId = $this->_defaultInterfaceLanguage;
         $lines = new BannerFeaturedObject();
         $select = $lines->getAll($langId, false);
         $options = array('commands' => array($this->view->link($this->view->url(array('controller' => $this->_name, 'action' => 'add')), $this->view->getCibleText('button_add_featured'), array('class' => 'action_submit add'))), 'disable-export-to-excel' => 'true', 'action_panel' => array('width' => '50', 'actions' => array('edit' => array('label' => $this->view->getCibleText('button_edit'), 'url' => $this->view->baseUrl() . "/" . $this->_moduleTitle . "/" . $this->_name . "/edit/" . $this->_paramId . "/%ID%", 'findReplace' => array('search' => '%ID%', 'replace' => 'BF_ID')), 'delete' => array('label' => $this->view->getCibleText('button_delete'), 'url' => $this->view->baseUrl() . "/" . $this->_moduleTitle . "/" . $this->_name . "/delete/" . $this->_paramId . "/%ID%/" . $pageID, 'findReplace' => array('search' => '%ID%', 'replace' => 'BF_ID')))));
         $mylist = new Cible_Paginator($select, $tables, $field_list, $options);
         $this->view->assign('mylist', $mylist);
     }
 }
コード例 #3
0
ファイル: FormBlockBanners.php プロジェクト: anunay/stentors
    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());
    }