]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 17 May 2013 09:02:51 +0000 (09:02 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 17 May 2013 09:02:51 +0000 (09:02 +0000)
inc/ws/Controlleur/class.ws.services.php
inc/ws/Util/html5/class.ws.html5.compiler.php
inc/ws/Util/html5/class.ws.html5.links.php

index 19cc00ef0f7ef1ec6d19d54a92a9f172b9f33540..d6f94fc68871edd0cc2aefd3a29ec962e7dc27f3 100644 (file)
@@ -528,6 +528,14 @@ class wsServices extends cubeFlashGateway {
        }\r
 \r
        public function wescoRef() {\r
+               global $core;\r
+               $r = $core->con->select('SELECT url FROM wescoref WHERE ref="' . $core->con->escape($this->args['ref']) . '"');\r
+               if ($r->count()) {\r
+                       header('Location: ' . $r->url);\r
+                       exit;\r
+               }\r
+\r
+\r
                $cache = ROOT . '/cache/wesco/' . $this->args['ref'];\r
                if (file_exists($cache)) {\r
                        header('Location: ' . file_get_contents($cache));\r
@@ -546,6 +554,7 @@ class wsServices extends cubeFlashGateway {
                }\r
                header('Location: http://www.wesco-eshop.fr');\r
        }\r
+\r
 }\r
 \r
 ?>
\ No newline at end of file
index f7cabebb77467391d194563a923f1e58c23116e4..0460887f0525f4dbff9f4177f25cce8b0df9b401 100644 (file)
@@ -99,7 +99,7 @@ class wsHTML5Compiler {
         *
         * @var wsBook
         */
-       protected $book;
+       public $book;
        protected $pages;
        protected $theme;
        protected $version;
index 3a840f3c6a76daafa350510f22a56768dd498cb4..c27be3a3691ba0344a46af9166da03fe13ce3f4b 100644 (file)
@@ -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';
+       }
+
+}
+
 ?>