From 556b925ed82818480a453fd635624e3b65f10a9d Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 17 May 2013 09:02:51 +0000 Subject: [PATCH] --- inc/ws/Controlleur/class.ws.services.php | 9 +++++++ inc/ws/Util/html5/class.ws.html5.compiler.php | 2 +- inc/ws/Util/html5/class.ws.html5.links.php | 24 ++++++++++++++++++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index 19cc00ef0..d6f94fc68 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -528,6 +528,14 @@ class wsServices extends cubeFlashGateway { } public function wescoRef() { + global $core; + $r = $core->con->select('SELECT url FROM wescoref WHERE ref="' . $core->con->escape($this->args['ref']) . '"'); + if ($r->count()) { + header('Location: ' . $r->url); + exit; + } + + $cache = ROOT . '/cache/wesco/' . $this->args['ref']; if (file_exists($cache)) { header('Location: ' . file_get_contents($cache)); @@ -546,6 +554,7 @@ class wsServices extends cubeFlashGateway { } header('Location: http://www.wesco-eshop.fr'); } + } ?> \ No newline at end of file diff --git a/inc/ws/Util/html5/class.ws.html5.compiler.php b/inc/ws/Util/html5/class.ws.html5.compiler.php index f7cabebb7..0460887f0 100644 --- a/inc/ws/Util/html5/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/class.ws.html5.compiler.php @@ -99,7 +99,7 @@ class wsHTML5Compiler { * * @var wsBook */ - protected $book; + public $book; protected $pages; protected $theme; protected $version; diff --git a/inc/ws/Util/html5/class.ws.html5.links.php b/inc/ws/Util/html5/class.ws.html5.links.php index 3a840f3c6..c27be3a36 100644 --- a/inc/ws/Util/html5/class.ws.html5.links.php +++ b/inc/ws/Util/html5/class.ws.html5.links.php @@ -25,6 +25,13 @@ class wsHTML5Link { public $id; public $compiler; + /** + * + * @param integer $id + * @param stdClass $init + * @param wsHTML5Compiler $compiler + * @return \webLink|\mailLink|\internalLink|\videoLink|\videoPopupLink|\multimediaLink|null|\webVideoLink|\webVideoPopupLink|\actionLink|\basketLink|\colorLink|\imageLink|\fileLink|\htmlMultimediaLink + */ public static function getInstance($id, $init, &$compiler) { switch ($init['type']) { case 1: @@ -43,6 +50,9 @@ class wsHTML5Link { case 6: return new multimediaLink($id, $init, $compiler); case 7: + if ($compiler->book->parametres->customLinkClass == 'WescoLink') { + return new wescoLink($id, $init, $compiler); + } case 8: case 9: return null; @@ -53,7 +63,7 @@ class wsHTML5Link { return new webVideoPopupLink($id, $init, $compiler); } case 11: - if($init['to']=='fullScreen'){ + if ($init['to'] == 'fullScreen') { return null; } return new actionLink($id, $init, $compiler); @@ -447,4 +457,16 @@ class webVideoPopupLink extends videoPopupLink { } +class wescoLink extends normalLink { + + public function getURL() { + return 'http://workshop.fluidbook.com/services/wescoRef?ref=' . $this->to; + } + + public function getTarget() { + return '_blank'; + } + +} + ?> -- 2.39.5