예제 #1
0
 public function loadData($recordID, $langId)
 {
     $oBannerImgFeat = new BannerFeaturedImageObject();
     $record = $this->populate($recordID, $langId);
     $tmpData = $oBannerImgFeat->getData($langId, $recordID);
     foreach ($tmpData as $imgData) {
         foreach ($imgData as $key => $value) {
             $recordKey = $key . $imgData['IF_ImgID'];
             $record[$recordKey] = $value;
         }
     }
     return $record;
 }
예제 #2
0
 private function _saveImgData($formData, $recordID, $action)
 {
     $imgId = 0;
     $tmpId = 0;
     foreach ($formData as $key => $value) {
         if (preg_match('/^IF_Img/', $key)) {
             $imgId = preg_replace('/[a-zA-Z]*_[a-zA-Z]*/', '', $key);
         }
         if (preg_match('/IF_Img[0-9]*$/', $key) || preg_match('/IFI_[a-zA-Z]*[0-9]*$/', $key) || preg_match('/IF_Style[0-9]*$/', $key) || preg_match('/IFI_TextA[0-9]*$/', $key) || preg_match('/IFI_TextB[0-9]*$/', $key)) {
             $dbField = preg_replace('/[0-9]*$/', '', $key);
             $imgData[$imgId]['IF_ImgID'] = $imgId;
             $imgData[$imgId]['IF_DataID'] = $recordID;
             $imgData[$imgId][$dbField] = $value;
         }
         if ($tmpId != $imgId) {
             $tmpId = $imgId;
         }
     }
     //exit;
     $oBannerImgFeat = new BannerFeaturedImageObject();
     if ($action == 'add') {
         foreach ($imgData as $imgFeat) {
             $oBannerImgFeat->insert($imgFeat, $this->_defaultEditLanguage);
         }
     }
     if ($action == 'edit') {
         $tmpData = $oBannerImgFeat->getData($this->_defaultEditLanguage, $recordID);
         foreach ($tmpData as $data) {
             $index = $data['IF_ID'];
             $imgFeat = $imgData[$data['IF_ImgID']];
             $oBannerImgFeat->save($index, $imgFeat, $this->_currentEditLanguage);
         }
     }
 }
예제 #3
0
 /**
  * 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;
     }
 }