From: vincent@cubedesigners.com Date: Mon, 14 Apr 2014 15:49:12 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=dca59d59837cb81ff65879cdaeaf517bbcba1c64;p=cubeextranet.git --- diff --git a/inc/ws/Util/html5/class.ws.html5.links.php b/inc/ws/Util/html5/class.ws.html5.links.php index 82893c0b5..a3ccea18f 100644 --- a/inc/ws/Util/html5/class.ws.html5.links.php +++ b/inc/ws/Util/html5/class.ws.html5.links.php @@ -27,12 +27,12 @@ class wsHTML5Link { /** * - * @var wsHTML5Compiler + * @var wsHTML5Compiler */ public $compiler; /** - * + * * @param integer $id * @param stdClass $init * @param wsHTML5Compiler $compiler @@ -88,8 +88,11 @@ class wsHTML5Link { case 16: return new fileLink($id, $init, $compiler); case 17: - //return new audioLink($id,$init,$compiler); - break; + if ($init['inline']) { + return new audioLink($id, $init, $compiler); + } else { + return new audioPopupLink($id, $init, $compiler); + } case 18: case 19: break; @@ -164,7 +167,7 @@ class wsHTML5Link { } public function getAdditionnalContent() { - + } public function getClasses() { @@ -339,7 +342,7 @@ class webLink extends normalLink { } public function getCSS() { - + } public function getDefaultTooltip() { @@ -456,6 +459,32 @@ class videoPopupLink extends normalLink { } +class audioPopupLink extends normalLink { + + public function getURL() { + $this->copyExternalFile($this->to, true); + $file = $this->to; + $e = explode('.', $file); + $ext = array_pop($e); + $basename = implode('.', $e); + + return '#/audio/' . $basename; + } + + public function getAdditionnalContent() { + return ' data-audio="' . rawurlencode(audioLink::makeAudioTag($this, null, null, $this->compiler)) . '" '; + } + + public function keep() { + return true; + } + + public function getDefaultTooltip() { + return 'click to play the audio'; + } + +} + class webVideoLink extends videoLink { public function getHTMLContent() { @@ -563,7 +592,7 @@ class htmlMultimediaLink extends wsHTML5Link { } foreach ($this->_config['injectcss'] as $i) { - + } foreach ($this->_config['injectjs'] as $i) { @@ -664,6 +693,42 @@ class webVideoPopupLink extends videoPopupLink { } +class audioLink extends wsHTML5Link { + + public function getHTMLContent() { + $this->copyExternalFile($this->to); + + $w = round($this->width * $this->getCssScale()); + $h = round($this->height * $this->getCssScale()); + + return self::makeAudioTag($this, $w, $h, $this->compiler); + } + + public function getCSSContainer() { + $css = parent::getCSSContainer(); + $css .= '#l_' . $this->id . ' audio{'; + $css.='width:' . round($this->width * $this->getCssScale()) . 'px;'; + $css.='height:' . round($this->height * $this->getCssScale()) . 'px;'; + $css.='display:block;'; + $css.='}'; + return $css; + } + + public static function makeAudioTag($linkDatas, $w = null, $h = null, $compiler = null) { + $res = ''; + return $res; + } + +} + class wescoLink extends normalLink { public function getURL() {