diff --git a/e107_handlers/media_class.php b/e107_handlers/media_class.php index c6876e8ae..384254c25 100644 --- a/e107_handlers/media_class.php +++ b/e107_handlers/media_class.php @@ -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 = ""; + + return $linkTag; + + } + 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 @@ -1316,46 +1329,40 @@ class e_media
\n"; - $dataPreview = !empty($data['previewHtml']) ? base64_encode($data['previewHtml']) : $data['previewUrl']; - $linkTag = ""; + + $linkTag = $this->browserCarouselItemSelector($data); + switch($data['type']) { case "video": - // $mime = vartrue($data['mime'],"video/mp4"); - - $text .= $tp->toVideo($data['thumbUrl'], array('w'=>$data['width'],'h'=>'', 'mime'=>$data['mime'])); - /* $text .= '';*/ - - $text .= "
"; - - $text .= $linkTag; - $text .= "\n".$data['title']; - $text .= "\n
\n\n"; - break; - case "audio": - // $mime = vartrue($data['mime'],"audio/mpeg"); - $text .= $tp->toAudio($data['thumbUrl'], array('mime'=>$data['mime'])); - /* $text .= '';*/ + 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 .= "
"; + $text .= "
+
"; - $text .= $linkTag; + $text .= $this->browserCarouselItemSelector($data); $text .= "\n".$data['title']; - $text .= "\n
\n\n"; + $text .= "\n
"; + $data['style'] = 'float:right'; + + $text .= "
". + $this->browserCarouselItemSelector($data). + "
+
\n\n"; break; - + case "image": $text .= $linkTag;