}\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
}\r
header('Location: http://www.wesco-eshop.fr');\r
}\r
+\r
}\r
\r
?>
\ No newline at end of file
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:
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;
return new webVideoPopupLink($id, $init, $compiler);
}
case 11:
- if($init['to']=='fullScreen'){
+ if ($init['to'] == 'fullScreen') {
return null;
}
return new actionLink($id, $init, $compiler);
}
+class wescoLink extends normalLink {
+
+ public function getURL() {
+ return 'http://workshop.fluidbook.com/services/wescoRef?ref=' . $this->to;
+ }
+
+ public function getTarget() {
+ return '_blank';
+ }
+
+}
+
?>