public function mediaFileDiv($content = '', $dataSet = array(), $options = array()) { ClassRegistry::init("MediaFile"); $m = $dataSet['MediaFile']; $d = false; $opt = array(); $allowed = array("id", "preroll", "postroll", "media_type"); $ads = Arr::videoAdUrls(false); $adLabels = Arr::adLabels(); $m = MediaFile::formatVideoAdUrls($m); if ($dataSet['Dailyop']) { //$opt['Dailyop'] = $dataSet['Dailyop']; $opt['dailyop_id'] = $options['dailyop_id'] = $dataSet['Dailyop']['id']; } foreach ($m as $k => $v) { if (in_array($k, $allowed)) { $opt['MediaFile'][$k] = $v; } } $options['media_file'] = json_encode($opt); $options['media_type'] = $m['media_type']; $options['media_file_id'] = $m['id']; $options['slide_show'] = $dataSet['Dailyop']['slide_show']; $options['dailyop_section_id'] = $dataSet['Dailyop']['dailyop_section_id']; $options['publish_date'] = $dataSet['Dailyop']['publish_date']; //new parameters //dailyops id isset($dataSet['Dailyop']['id']) ? $options['dailyop_id'] = $dataSet['Dailyop']['id'] : ''; //pass in the session $options['xid'] = CakeSession::id(); return $this->Html->div("dailyop_media_item", $content, $options); }
public function request_html_video($id) { $this->loadModel("MediaFile"); $video = $this->MediaFile->find("first", array("conditions" => array("MediaFile.id" => $id), "contain" => array())); $this->insertMediaHit($id); $video['MediaFile']['limelight_file'] = $this->limelight_uri . $video['MediaFile']['limelight_file']; $video['MediaFile'] = MediaFile::formatVideoAdUrls($video['MediaFile']); die(json_encode($video)); }