public static function getListItemForVideo(VideoObject $video, $section) {

        $desc = $video->getDescription();

        return array(
            'title'=>$video->getTitle(),
            'subtitle'=> "(" . VideoModuleUtils::getDuration($video->getDuration()) . ") " . $desc,
            'imgWidth'=>120,  
            'imgHeight'=>100,  
            'img'=>$video->getImage()
            );
    }
	function RealVideoObject ($pagename, $fname, $attr) {
		VideoObject::VideoObject($pagename, $fname, $attr);
	}
Exemplo n.º 3
0
 public function editAction()
 {
     $videos = new VideoObject();
     $listVideo = array();
     $listVideo = $videos->getVideosList();
     //$this->view->videos = $listVideo;
     $recordID = $this->_getParam($this->_paramId);
     $page = $this->_getParam('page');
     $returnAction = $this->_getParam('return');
     $baseDir = $this->view->baseUrl();
     $lang = $this->_getParam('lang');
     $langId = $this->_registry->currentEditLanguage;
     if ($this->view->aclIsAllowed($this->_moduleTitle, 'edit', true)) {
         $cancelUrl = $baseDir . "/" . $this->_moduleTitle . "/" . $this->_name . "/" . $this->_defaultAction . "/";
         if ($returnAction) {
             $returnUrl = $this->_moduleTitle . "/" . $this->_name . "/" . $returnAction;
         } else {
             $returnUrl = $this->_moduleTitle . "/" . $this->_name . "/edit/" . $this->_paramId . "/" . $recordID;
         }
         if (!empty($page)) {
             $returnUrl .= "page/" . $page . '/';
             $cancelUrl .= "page/" . $page . '/';
         }
         // get event details
         $oData = new BannerFeaturedObject();
         $record = $oData->loadData($recordID, $langId);
         $imageSrc = array();
         $isNewImage = array();
         for ($x = 1; $x <= $this->_imgFeatureNumber; $x++) {
             $imageSource = $this->_setImageSrc($record, 'IF_Img' . $x, $recordID);
             //echo $imageSource['imageSrc'];
             $imageSrc[$x] = $imageSource['imageSrc'];
             $isNewImage[$x] = $imageSource['isNewImage'];
         }
         // generate the form
         $form = new FormBannerFeatured(array('moduleName' => $this->_moduleTitle . '/' . $this->_name, 'baseDir' => $baseDir, 'cancelUrl' => $cancelUrl, 'dataId' => $recordID, 'isNewImage' => $isNewImage, 'filePath' => $this->_rootFilePath, 'imageSrc' => $imageSrc, 'numberImageFeature' => $this->_imgFeatureNumber), $listVideo);
         $this->view->form = $form;
         if (!$this->_request->isPost()) {
             $form->populate($record);
         } else {
             $formData = $this->_request->getPost();
             if ($form->isValid($formData)) {
                 $newData = $formData;
                 // Save image data for this banner
                 $this->_saveImgData($formData, $recordID, 'edit');
                 for ($x = 1; $x <= $this->_imgFeatureNumber; $x++) {
                     if ($newData['IF_Img' . $x] != '') {
                         $this->_setImage('IF_Img' . $x, $form, $newData, $recordID);
                     }
                 }
                 $oData->save($recordID, $newData, $langId);
                 if (!empty($pageID)) {
                     $this->_redirect($this->_moduleTitle . "/" . $this->_name . "/" . $this->_defaultAction . "/blockID/{$blockID}/pageID/{$pageID}");
                 } else {
                     $this->_redirect($returnUrl);
                 }
             }
         }
     }
 }
Exemplo n.º 4
0
    protected function getListItemForVideo(VideoObject $video, $section) {
        // FIXME proper fix is either determine if desktop or adjust in javascript 
        $desc = $video->getDescription();
        if (strlen($video->getTitle())>30) {             	
            if (strlen($desc)) {
                $desc = substr($desc,0,30) . "...";
            }
        }
        
        if (strlen($desc)>75) {
            $desc = substr($desc,0,75) . "...";
        }

        return array(
            'title'=>$video->getTitle(),
            'subtitle'=>$desc . "<br />" . $this->getDuration($video->getDuration()),
            'imgWidth'=>120,  
            'imgHeight'=>100,  
            'img'=>$video->getImage(),
            'url'=>$this->buildBreadcrumbURL('detail', array(
                'section'=>$section,
                'videoid'=>$video->getID()
            )));
    }
Exemplo n.º 5
0
 private function mediaListVideoMaker()
 {
     $videoObject = new VideoObject();
     $objVideo = $videoObject->getVideosList();
     //var_dump($objVideo);
     //exit;
     $x = 0;
     $baseUrlVideo = $this->view->baseUrl();
     $pos = strripos($baseUrlVideo, "/");
     $baseUrlVideo = substr($baseUrlVideo, 0, $pos);
     $baseUrlVideo .= "/data/files/videos/";
     //echo $baseUrlVideo;
     // exit;
     $stringData = 'var tinyMCEMediaList = new Array(';
     foreach ($objVideo as $video) {
         if ($x > 0) {
             $stringData .= ",";
         }
         $stringData .= "[";
         $stringData .= '"' . $video['V_Alias'] . '",';
         $stringData .= "[";
         $stringData .= '["VI_WEBM", "' . $baseUrlVideo . $video['VI_WEBM'] . '"],';
         $stringData .= '["VI_MP4", "' . $baseUrlVideo . $video['VI_MP4'] . '"],';
         $stringData .= '["VI_OGG", "' . $baseUrlVideo . $video['VI_OGG'] . '"],';
         $stringData .= '["V_Autoplay",' . $video['V_Autoplay'] . '],';
         $stringData .= '["V_Width",' . $video['V_Width'] . '],';
         $stringData .= '["V_Height",' . $video['V_Height'] . '],';
         $stringData .= '["VI_Name",' . $video['VI_Name'] . '],';
         $stringData .= '["VI_Poster", "' . $baseUrlVideo . $video['VI_Poster'] . '"]';
         $stringData .= ']';
         $stringData .= ']';
     }
     $stringData .= ');';
     $dataFilePath = "../../" . $this->_config->document_root . "/data/files/videos/media_list.js";
     $fh = fopen($dataFilePath, 'w');
     fwrite($fh, $stringData);
     fclose($fh);
     //echo $stringData;
     // exit;
 }
Exemplo n.º 6
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;
     }
 }