|
|
@@ -0,0 +1,102 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
namespace Modules; |
|
|
|
|
|
|
|
class CVideo extends ContentType { |
|
|
|
|
|
|
|
public $keys = array( |
|
|
|
'TARGET' => 'target', |
|
|
|
'STILL' => 'still', |
|
|
|
'STILL2' => 'still2', |
|
|
|
'NAME' => 'name', |
|
|
|
'CAPTION' => 'caption', |
|
|
|
'STYLE' => 'style', |
|
|
|
'RATIO' => 'ratio' |
|
|
|
); |
|
|
|
public $values; |
|
|
|
protected $layout; |
|
|
|
protected $layouts = array( |
|
|
|
'default' => 'view_default', |
|
|
|
'lightbox' => 'view_in_lightbox', |
|
|
|
'audio' => 'view_in_lightbox2' |
|
|
|
); |
|
|
|
|
|
|
|
function __construct($keys,$config) { |
|
|
|
parent::__construct($keys,$config); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function view_in_toc() { |
|
|
|
$v = (object) $this->values; |
|
|
|
return sprintf("<div class=\"location\"><a href=\"/%s\"><h3>%s</h3></a><span>%s</span></div>", |
|
|
|
$this->href, |
|
|
|
$v->name, |
|
|
|
$v->town |
|
|
|
); |
|
|
|
} |
|
|
|
function view_default() { |
|
|
|
$v = (object) $this->values; |
|
|
|
return sprintf("<video style=\"width:300px;\" id=\"asd\" class=\"video-js\" controls preload=\"auto\" " |
|
|
|
."data-setup=\"{}\"><source src=\"%s%s\" /></video>", |
|
|
|
$this->config['path'], |
|
|
|
$v->target |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
function view_in_lightbox1() { |
|
|
|
$v = (object) $this->values; |
|
|
|
$id = "video_".$v->name; |
|
|
|
return sprintf("<div class='video-container %s'><div class=\"media\"><div class=\"video-thumbnail\"><a href=\"%s\" data-featherlight=\"#%s\">" |
|
|
|
."<img class=\"thumbnail\" src=\"%s\" alt=\"video-preview\"/>" |
|
|
|
."<img class=\"play-button\" src=\"%s\" alt=\"play-button\" />" |
|
|
|
."</a></div><div class=\"lightbox\" id=\"%s\" >%s</div></div><div class=\"caption\">%s</div></div>", |
|
|
|
$v->style, |
|
|
|
$v->target, |
|
|
|
$id, |
|
|
|
$v->still->get_src(1200), |
|
|
|
"/rsc/img/play-button.png", |
|
|
|
$id, |
|
|
|
$this->view_default(), |
|
|
|
$v->caption |
|
|
|
); |
|
|
|
} |
|
|
|
function view_in_lightbox() { |
|
|
|
$v = (object) $this->values; |
|
|
|
$id = $v->name; |
|
|
|
$target = $this->config['path'].$v->target; |
|
|
|
return sprintf("<div class='video-container %s'>" |
|
|
|
."<div class=\"media\"><div class=\"video-thumbnail\"><a href=\"%s\" class=\"trigger_video\" data-poster=\"%s\" data-video-url=\"%s\" data-video-name=\"%s\" data-ce-type=\"video\">" |
|
|
|
."<img class=\"thumbnail\" src=\"%s\" alt=\"video-preview\"/>" |
|
|
|
."</a></div><div class=\"lightbox\" id=\"container%s\" ></div></div><div class=\"caption\">%s</div></div>", |
|
|
|
$v->style, |
|
|
|
$target, |
|
|
|
$v->still2, |
|
|
|
$target, |
|
|
|
$id, |
|
|
|
$v->still->get_src(1200), |
|
|
|
$id, |
|
|
|
$v->caption |
|
|
|
); |
|
|
|
} |
|
|
|
function view_in_lightbox2() { |
|
|
|
$v = (object) $this->values; |
|
|
|
$id = $v->name; |
|
|
|
$target = $this->config['path'].$v->target; |
|
|
|
return sprintf("<div class='audio-container %s'>" |
|
|
|
."<div class=\"media\"><div class=\"video-thumbnail\"><a href=\"%s\" class=\"trigger_video\" data-video-url=\"%s\" data-video-name=\"%s\" data-ce-type=\"audio\" data-ratio=\"%s\">" |
|
|
|
."<img class=\"thumbnail\" src=\"%s\" alt=\"video-preview\"/>" |
|
|
|
."</a></div><div class=\"lightbox\" id=\"container%s\" ></div></div><div class=\"caption\">%s</div></div>", |
|
|
|
$v->style, |
|
|
|
$target, |
|
|
|
//$v->still2, |
|
|
|
$target, |
|
|
|
$id, |
|
|
|
$v->ratio, |
|
|
|
$v->still->get_src(1200), |
|
|
|
$id, |
|
|
|
$v->caption |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
} |