From 016593c0a8113361e90cd9ee3d94a1bbde44b776 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 14 Oct 2013 13:13:48 +0000 Subject: [PATCH] --- fluidbook/compile/index.html | 3 +- inc/ws/Metier/class.ws.book.parametres.php | 6 +- inc/ws/Util/html5/class.ws.html5.compiler.php | 8 +-- inc/ws/Util/html5/class.ws.html5.links.php | 62 ++++++++++++++++++- .../Util/packager/class.ws.packager.html.php | 8 ++- 5 files changed, 78 insertions(+), 9 deletions(-) diff --git a/fluidbook/compile/index.html b/fluidbook/compile/index.html index cf1ec2134..d6c0b76fc 100644 --- a/fluidbook/compile/index.html +++ b/fluidbook/compile/index.html @@ -12,6 +12,7 @@ $robots $facebook $description + $keywords $title @@ -19,7 +20,7 @@ ' . "\n"; diff --git a/inc/ws/Util/html5/class.ws.html5.links.php b/inc/ws/Util/html5/class.ws.html5.links.php index e7a862315..ca9dfa691 100644 --- a/inc/ws/Util/html5/class.ws.html5.links.php +++ b/inc/ws/Util/html5/class.ws.html5.links.php @@ -59,6 +59,8 @@ class wsHTML5Link { return new haguenauManifLink($id, $init, $compiler); } else if ($compiler->book->parametres->customLinkClass == 'FLFLink') { return new flfLink($id, $init, $compiler); + } else if ($compiler->book->parametres->customLinkClass == 'InpesPopinLink') { + return new inpesPopinLink($id, $init, $compiler); } case 8: case 9: @@ -524,6 +526,7 @@ class htmlMultimediaLink extends wsHTML5Link { protected $_config = null; protected $_content = ''; + protected $_url; public function getHTMLContent() { if ($this->_content == '') { @@ -538,11 +541,12 @@ class htmlMultimediaLink extends wsHTML5Link { $w = $this->width * $this->getCssScale(); $h = $this->height * $this->getCssScale(); + $this->_url = $d['fdir'] . '/' . $this->_config['html']; $iw = $this->_config['width']; $ih = $this->_config['height']; - $res = ''; + $res = ''; $this->copyExternalDir($d['dir']); $this->_content = $res; } @@ -638,6 +642,62 @@ class wescoLink extends normalLink { } +class inpesPopinLink extends htmlMultimediaLink { + + public function getHTMLContent() { + $this->alternative = $this->to; + $c = parent::getHTMLContent(); + + + + $class = $this->getClasses(); + if ($this->display_area) { + $class[] = 'displayArea'; + } + $c = ''; + if (count($class)) { + $c = ' class="' . implode(' ', $class) . '"'; + } + $tooltip = ''; + $t = $this->getTooltip(); + if ($t !== false) { + $tooltip = ' data-tooltip="' . $t . '"'; + } + return 'getAdditionnalContent() . '>'; + } + + public function getCSSContainer() { + if (!($this instanceof contentLink) && $this->page % 2 == 1) { + $this->page--; + $this->left+=$this->compiler->width; + } + + $css = '#l_' . $this->id . '{'; + $css.='left:' . $this->left * $this->getCssScale() . 'px;top:' . $this->top * $this->getCssScale() . 'px;'; + $css.='width:' . $this->width * $this->getCssScale() . 'px;height:' . $this->height * $this->getCssScale() . 'px;'; + $css.=$this->getCSS(); + $css.='}'; + return $css; + } + + public function getCSS() { + return ""; + } + + public function getClasses() { + $res = parent::getClasses(); + $res[] = 'popin'; + return $res; + } + + public function getAdditionnalContent() { + $res = parent::getAdditionnalContent(); + $res.=' data-src="' . $this->_url . '" data-width="900" data-height="650"'; + return $res; + } + +} + class flfLink extends wescoLink { public function getURL() { diff --git a/inc/ws/Util/packager/class.ws.packager.html.php b/inc/ws/Util/packager/class.ws.packager.html.php index 290380ebb..c9c2eb4ad 100644 --- a/inc/ws/Util/packager/class.ws.packager.html.php +++ b/inc/ws/Util/packager/class.ws.packager.html.php @@ -95,6 +95,10 @@ class wsPackagerHTML extends wsPackager { if ($this->book->parametres->seoDescription) { $description = ''; } + $keywords = ''; + if ($this->book->parametres->seoKeywords) { + $keywords = ''; + } // Stuffs to replace in html $toReplace = array('lang' => strtolower($this->book->lang), @@ -108,7 +112,9 @@ class wsPackagerHTML extends wsPackager { 'robots' => $robots, 'favicon' => $favicon, 'flashversion' => $this->getMinFlashVersion(), - 'fv' => json_encode($this->getFlashvars())); + 'fv' => json_encode($this->getFlashvars()), + 'alwaysHTML5' => $this->book->parametres->alwaysHTML5, + 'keywords' => $keywords); $this->origHTML = file_get_contents($this->vdir . '/index.html'); -- 2.39.5