mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
Media-picker styling.
This commit is contained in:
@@ -1276,6 +1276,20 @@ class e_media
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function browserCarouselItemSelector($data)
|
||||||
|
{
|
||||||
|
$close = (E107_DEBUG_LEVEL > 0) ? "" : " data-close='true' "; //
|
||||||
|
$select = (E107_DEBUG_LEVEL > 0) ? '' : " e-dialog-save e-dialog-close";
|
||||||
|
$style = varset($data['style'],'float:left');
|
||||||
|
$class = varset($data['class'],'');
|
||||||
|
$dataPreview = !empty($data['previewHtml']) ? base64_encode($data['previewHtml']) : $data['previewUrl'];
|
||||||
|
|
||||||
|
$linkTag = "<a data-toggle='context' class='e-media-select e-tip".$select." ".$class."' ".$close." data-id='".$data['id']."' data-width='".$data['width']."' data-height='".$data['height']."' data-src='".$data['previewUrl']."' data-type='".$data['type']."' data-bbcode='".$data['bbcode']."' data-target='".$data['tagid']."' data-path='".$data['saveValue']."' data-preview='".$dataPreview."' title=\"".$data['title']."\" style='".$style."' href='#' >";
|
||||||
|
|
||||||
|
return $linkTag;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function browserCarouselItem($row = array())
|
function browserCarouselItem($row = array())
|
||||||
{
|
{
|
||||||
@@ -1307,8 +1321,7 @@ class e_media
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$close = (E107_DEBUG_LEVEL > 0) ? "" : " data-close='true' "; //
|
|
||||||
$select = (E107_DEBUG_LEVEL > 0) ? '' : " e-dialog-save e-dialog-close";
|
|
||||||
|
|
||||||
$text = "\n\n<!-- Start Item -->
|
$text = "\n\n<!-- Start Item -->
|
||||||
|
|
||||||
@@ -1316,44 +1329,38 @@ class e_media
|
|||||||
|
|
||||||
<div class='well clearfix'>\n";
|
<div class='well clearfix'>\n";
|
||||||
|
|
||||||
$dataPreview = !empty($data['previewHtml']) ? base64_encode($data['previewHtml']) : $data['previewUrl'];
|
|
||||||
|
|
||||||
$linkTag = "<a data-toggle='context' class='e-media-select e-tip".$select."' ".$close." data-id='".$data['id']."' data-width='".$data['width']."' data-height='".$data['height']."' data-src='".$data['previewUrl']."' data-type='".$data['type']."' data-bbcode='".$data['bbcode']."' data-target='".$data['tagid']."' data-path='".$data['saveValue']."' data-preview='".$dataPreview."' title=\"".$data['title']."\" style='float:left' href='#' >";
|
|
||||||
|
$linkTag = $this->browserCarouselItemSelector($data);
|
||||||
|
|
||||||
|
|
||||||
switch($data['type'])
|
switch($data['type'])
|
||||||
{
|
{
|
||||||
case "video":
|
case "video":
|
||||||
// $mime = vartrue($data['mime'],"video/mp4");
|
|
||||||
|
|
||||||
$text .= $tp->toVideo($data['thumbUrl'], array('w'=>$data['width'],'h'=>'', 'mime'=>$data['mime']));
|
|
||||||
/* $text .= '<video width="'.$data['width'].'" height="'.$data['height'].'" controls >
|
|
||||||
<source src="'.$data['thumbUrl'].'" type="'.$mime.'">
|
|
||||||
Your browser does not support the video tag.
|
|
||||||
</video>';*/
|
|
||||||
|
|
||||||
$text .= "<div><small class='media-carousel-item-caption'>";
|
|
||||||
|
|
||||||
$text .= $linkTag;
|
|
||||||
$text .= "\n".$data['title'];
|
|
||||||
$text .= "\n</a></small></div>\n\n";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "audio":
|
case "audio":
|
||||||
// $mime = vartrue($data['mime'],"audio/mpeg");
|
|
||||||
|
|
||||||
|
if($data['type'] === 'video') // video
|
||||||
|
{
|
||||||
|
$text .= $tp->toVideo($data['thumbUrl'], array('w'=>$data['width'],'h'=>'', 'mime'=>$data['mime']));
|
||||||
|
}
|
||||||
|
else // audio
|
||||||
|
{
|
||||||
$text .= $tp->toAudio($data['thumbUrl'], array('mime'=>$data['mime']));
|
$text .= $tp->toAudio($data['thumbUrl'], array('mime'=>$data['mime']));
|
||||||
/* $text .= '<audio controls>
|
}
|
||||||
<source src="'.$data['thumbUrl'].'" type="'.$mime.'">
|
|
||||||
|
|
||||||
Your browser does not support the audio tag.
|
$text .= "<div class='row' style='margin-top:5px'>
|
||||||
</audio>';*/
|
<div class='col-md-8'><small class='media-carousel-item-caption'>";
|
||||||
|
|
||||||
$text .= "<div><small class='media-carousel-item-caption'>";
|
$text .= $this->browserCarouselItemSelector($data);
|
||||||
|
|
||||||
$text .= $linkTag;
|
|
||||||
$text .= "\n".$data['title'];
|
$text .= "\n".$data['title'];
|
||||||
$text .= "\n</a></small></div>\n\n";
|
$text .= "\n</a></small></div>";
|
||||||
|
|
||||||
|
$data['style'] = 'float:right';
|
||||||
|
|
||||||
|
$text .= "<div class='col-md-4 text-right'>".
|
||||||
|
$this->browserCarouselItemSelector($data).
|
||||||
|
"<button class='btn btn-xs btn-primary' style='margin-top:7px'>Select</button></a></div>
|
||||||
|
</div>\n\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user