]> _ Git - cubeextranet.git/commitdiff
Popup html link
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 8 Apr 2015 17:23:00 +0000 (17:23 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 8 Apr 2015 17:23:00 +0000 (17:23 +0000)
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/class.ws.links.php
inc/ws/Util/html5/class.ws.html5.compiler.php
inc/ws/Util/html5/class.ws.html5.links.php
inc/ws/Util/packager/class.ws.packager.html5.php

index e68f8ec5e5812517d68b83b3fe9d4bc0e79b493c..af7c9ff70036c8903603627a3857f1c1a26386b8 100644 (file)
@@ -102,7 +102,7 @@ class wsDAOBook extends commonDAO {
                        $mail->to = 'tech@fluidbook.com';
                        $mail->subject = '[Fluidbook Workshop] Fluidbook consulté via l\'url publique';
                        $mail->body = 'Le fluidbook suivant a été consulté ' . $m . ' fois (et ' . $r->demo_counter . ' au total) via l\'url publique : ' . "\r\n" .
-                                       'Fluidbook # ' . $book_id . ' - ' . $r->nom;
+                               'Fluidbook # ' . $book_id . ' - ' . $r->nom;
                        $mail->send();
                }
 
@@ -337,10 +337,10 @@ class wsDAOBook extends commonDAO {
                                $num = '';
                        }
                        $pages[$r->book_page] = array('document_id' => $r->document_id,
-                               'document_page' => $r->document_page,
-                               'version' => $r->version,
-                               'defaultNum' => $num,
-                               'nb_pages' => $r->doc_pages
+                                                     'document_page' => $r->document_page,
+                                                     'version' => $r->version,
+                                                     'defaultNum' => $num,
+                                                     'nb_pages' => $r->doc_pages
                        );
 
                        if ($conversion) {
@@ -494,12 +494,12 @@ class wsDAOBook extends commonDAO {
        }
 
        public function setChapters($book_id, $json) {
-               $chapters = json_decode($json, TRUE);
+               $chapters = json_decode($json, true);
                $res = array();
 
                foreach ($chapters as $c) {
                        $c['label'] = trim($c['label']);
-                       $n = (string) $c['page'];
+                       $n = (string)$c['page'];
                        $c['label'] = trim(preg_replace('|\s+' . $n . '$|iu', '', $c['label']));
                        $res[] = $c;
                }
@@ -529,7 +529,6 @@ class wsDAOBook extends commonDAO {
                }
 
 
-
                $c1->links = $c->specialLinks = $links;
                $c1->rulers = $c->specialRulers = $rulers;
                $c1->update = $c->changedate = TIME;
@@ -568,14 +567,14 @@ class wsDAOBook extends commonDAO {
                $chapters = $xml->xpath('//chapters');
                foreach ($chapters as $ch) {
                        $c = array();
-                       $c['label'] = (string) $ch->txt;
+                       $c['label'] = (string)$ch->txt;
 
-                       $p = intval((string) $ch->page);
+                       $p = intval((string)$ch->page);
                        if ($p <= 0) {
                                continue;
                        }
                        $c['page'] = $n[$p];
-                       $c['level'] = intval((string) $ch->level);
+                       $c['level'] = intval((string)$ch->level);
                        $res[] = $c;
                }
 
@@ -713,7 +712,7 @@ class wsDAOBook extends commonDAO {
        }
 
        public function isUpToDate($book, $version) {
-               $version = (string) $version;
+               $version = (string)$version;
                if ($version == '2') {
                        if (!file_exists(WS_BOOKS . '/final/' . $book->book_id)) {
                                return false;
@@ -730,6 +729,7 @@ class wsDAOBook extends commonDAO {
                                return false;
                        }
                } else if ($version == 'html5') {
+                       return false;
                        // HTML5
                        $checks = array($book->changedate, cubeFiles::filemtimeRecursive(WS_BOOKS . '/working/' . $book->book_id), cubeFiles::filemtimeRecursive(WS_COMPILE_ASSETS . '/_html5'), cubeFiles::filemtimeRecursive(ROOT . '/inc/ws/Util/html5'));
                        foreach ($checks as $check) {
@@ -763,11 +763,11 @@ class wsDAOBook extends commonDAO {
                $tab = array();
                $now = array();
                while ($r->fetch()) {
-                       $ref[$r->book_page] = array((int) $r->document_id, (int) $r->document_page);
+                       $ref[$r->book_page] = array((int)$r->document_id, (int)$r->document_page);
                }
                $i = 1;
                foreach ($pages as $p) {
-                       $now[$i] = array((int) $p->document_id, (int) $p->document_page);
+                       $now[$i] = array((int)$p->document_id, (int)$p->document_page);
                        $i++;
                }
                if ($now != $ref) {
@@ -808,7 +808,7 @@ class wsDAOBook extends commonDAO {
 
                $dir = WS_BOOKS . '/index/' . $book->book_id;
                if ($book->parametres->ignoreSearchSeparators != '') {
-                       $dir.='/' . sha1($book->parametres->ignoreSearchSeparators);
+                       $dir .= '/' . sha1($book->parametres->ignoreSearchSeparators);
                }
                if (!file_exists($dir)) {
                        mkdir($dir, 0777, true);
@@ -1004,11 +1004,10 @@ class wsDAOBook extends commonDAO {
                }
 
 
-
                $res = '';
                if ($v1) {
                        fb(time(), 'Compile V1');
-                       $res.=$this->compile1($book_id, $book, $pages);
+                       $res .= $this->compile1($book_id, $book, $pages);
                        $this->touchCompile($book_id, '1');
                }
                if ($v2) {
@@ -1018,7 +1017,7 @@ class wsDAOBook extends commonDAO {
                }
                if ($html5) {
                        fb(time(), 'Compile HTML5');
-                       $res.=$this->compileHTML5($book_id, $book);
+                       $res .= $this->compileHTML5($book_id, $book);
                        $this->touchCompile($book_id, 'html5');
                }
                if ($v1 || $v2) {
@@ -1131,7 +1130,7 @@ class wsDAOBook extends commonDAO {
                $air = new cubeAIRCompiler($swf . '.swf', '/usr/local/flex/bin', $compilerDir, '2.0');
                $air->setApplicationDatas('com.fluidbook' . $book_id, $book->parametres->title, $book->parametres->title, cubeText::str2URL($book->parametres->title), $book->lang);
                $air->setInitialWindow($book->parametres->title);
-               $res.=$air->compile();
+               $res .= $air->compile();
 
                return $res;
        }
@@ -1160,9 +1159,9 @@ class wsDAOBook extends commonDAO {
                $signature = $daoSignature->selectById($book->parametres->signature);
 
                $exportSignature = array('main' => $signature->main,
-                       'mainLink' => $signature->mainLink,
-                       'partner' => $signature->partner,
-                       'partnerLink' => $signature->partnerLink);
+                                        'mainLink' => $signature->mainLink,
+                                        'partner' => $signature->partner,
+                                        'partnerLink' => $signature->partnerLink);
 
                $index = '';
                $textes = '';
@@ -1347,7 +1346,7 @@ class wsDAOBook extends commonDAO {
                                $langNames[$mlang] = $n;
                                $cn = cubeCountry::getCountryName($flag, $mlang);
                                $countryNames[$mlang . '_' . $flag] = $cn;
-                               $chars.=$n . $cn;
+                               $chars .= $n . $cn;
                        }
 
                        $chars = preg_split('/(?<!^)(?!$)/u', $chars);
@@ -1369,7 +1368,7 @@ class wsDAOBook extends commonDAO {
                                $i = 0;
                                $allref = array();
                                foreach ($xml->item as $item) {
-                                       $ref = (string) $item['reference'];
+                                       $ref = (string)$item['reference'];
                                        if (isset($allref[$ref])) {
                                                continue;
                                        }
@@ -1657,8 +1656,6 @@ class wsDAOBook extends commonDAO {
                }
 
 
-
-
                if ($book->parametres->pdfReplace) {
                        $replace = WS_BOOKS . '/working/' . $book->book_id . '/' . $book->parametres->pdfReplace;
                        if (file_exists($replace)) {
@@ -1700,7 +1697,7 @@ class wsDAOBook extends commonDAO {
                        $res = '';
                        for ($i = 0; $i < 8; $i++) {
                                $j = rand(0, 61);
-                               $res.=$this->base62($j);
+                               $res .= $this->base62($j);
                        }
                        $r = $this->con->select('SELECT book_id FROM books WHERE cid=\'' . $res . '\'');
                        if ($r->count() == 0) {
index 8691c5b1aa8432809cca352697a4c72f948cf32f..82e373fefe2f505f279df2117e35c3f1bb51e96f 100644 (file)
@@ -210,7 +210,7 @@ class wsLinks {
                        if (isset($tlinks[$infos['document_id']][$infos['document_page']])) {
                                $l = $tlinks[$infos['document_id']][$infos['document_page']];
                                foreach ($l as $link) {
-                                       $link = (array) $link;
+                                       $link = (array)$link;
                                        $link['page'] = $p;
                                        $link['id'] = $i;
                                        if (!isset($link['rot'])) {
index ccd73544626de3873403ebaa87e2e6401afaaaf2..441d85015221bdfca42d5555fe29c76c411ee6a7 100644 (file)
@@ -91,7 +91,7 @@ class wsHTML5Compiler {
                'js/widget.js'
        );
        public $phonegapStandardPlugins = array('ios' => array('ExternalFileUtil'),
-               'android' => array('webintent'));
+                                               'android' => array('webintent'));
        public $pluginCSS = array();
        public $pluginJs = array();
        public $htmlmultimedia = array();
@@ -438,15 +438,15 @@ class wsHTML5Compiler {
                $signature = $daoSignature->selectById($this->book->parametres->signature);
 
                $exportSignature = array('main' => $signature->main,
-                       'mainLink' => $signature->mainLink,
-                       'partner' => $signature->partner,
-                       'partnerLink' => $signature->partnerLink);
+                                        'mainLink' => $signature->mainLink,
+                                        'partner' => $signature->partner,
+                                        'partnerLink' => $signature->partnerLink);
 
                $credits = '';
                if ($signature->partner != '') {
                        $credits = '<a href="' . $signature->partnerLink . '" target="_blank">' . $signature->partner . '</a> ';
                }
-               $credits.='<a href="' . $signature->mainLink . '" target="_blank">' . $signature->main . '</a>';
+               $credits .= '<a href="' . $signature->mainLink . '" target="_blank">' . $signature->main . '</a>';
 
                $hiddenContents = implode("\n", $this->hiddenContents);
 
@@ -479,9 +479,9 @@ class wsHTML5Compiler {
 
                $iscript = '';
                if (count($this->htmlmultimedia)) {
-                       $iscript.='<script type="text/javascript">' . "\n";
-                       $iscript.=implode("\n", $this->htmlmultimedia);
-                       $iscript.='</script>' . "\n";
+                       $iscript .= '<script type="text/javascript">' . "\n";
+                       $iscript .= implode("\n", $this->htmlmultimedia);
+                       $iscript .= '</script>' . "\n";
                }
 
                $script = '';
@@ -494,7 +494,7 @@ class wsHTML5Compiler {
                foreach ($this->pluginJs as $p) {
                        $script .= '<script type="text/javascript" charset="utf-8" src="' . $p . '"></script>' . "\n";
                }
-               $script.=$iscript;
+               $script .= $iscript;
 
 
                $description = '';
@@ -517,7 +517,7 @@ class wsHTML5Compiler {
                        $dim = getimagesize($this->themeRoot . '/' . $this->theme->parametres->logoLoader);
                        if ($dim !== false) {
                                $this->copy($this->themeRoot . '/' . $this->theme->parametres->logoLoader, $this->vdir . '/data/images/' . $this->theme->parametres->logoLoader);
-                               $splash.='<div class="logo"><img src="data/images/' . $this->theme->parametres->logoLoader . '" width="' . $dim[0] . '" height="' . $dim[1] . '" alt="" /></div>';
+                               $splash .= '<div class="logo"><img src="data/images/' . $this->theme->parametres->logoLoader . '" width="' . $dim[0] . '" height="' . $dim[1] . '" alt="" /></div>';
                        }
                }
 
@@ -555,7 +555,7 @@ class wsHTML5Compiler {
                        $uhtml = str_replace('<!-- $' . $v . ' -->', $$v, $uhtml);
                }
 
-               $script.="\n\t\t" . '<script type="text/javascript" charset="utf-8">window.tester = true;</script>';
+               $script .= "\n\t\t" . '<script type="text/javascript" charset="utf-8">window.tester = true;</script>';
                $vars = array('titre', 'credits', 'ga', 'style', 'script', 'print', 'hiddenContents', 'splash', 'message');
                foreach ($vars as $v) {
                        $thtml = str_replace('<!-- $' . $v . ' -->', $$v, $thtml);
@@ -705,9 +705,9 @@ class wsHTML5Compiler {
                                $cpages[$link->page] = '';
                        }
                        if ($link instanceof contentLink) {
-                               $cpages[$link->page].=$c;
+                               $cpages[$link->page] .= $c;
                        } else {
-                               $pages[$link->page].=$c;
+                               $pages[$link->page] .= $c;
                        }
 
                        if ($link->keep()) {
@@ -744,7 +744,7 @@ class wsHTML5Compiler {
                        return;
                }
 
-               $this->config->bookmarkGroups[] = array('page' => ($link['page'] ), 'nb' => $link['to'], 'name' => $link['extra']);
+               $this->config->bookmarkGroups[] = array('page' => ($link['page']), 'nb' => $link['to'], 'name' => $link['extra']);
        }
 
        protected function writeJs() {
@@ -771,7 +771,7 @@ class wsHTML5Compiler {
                        }
 
                        if (!$reminimize) {
-                               if (filemtime(__FILE__) > $mintime) {
+                               if (filemtime(__FILE__) > $mintime || filemtime(__DIR__ . 'class.ws.html5.links.php') > $mintime) {
                                        $reminimize = true;
                                }
                        }
@@ -779,8 +779,8 @@ class wsHTML5Compiler {
                        if ($reminimize) {
                                $js = '';
                                foreach ($files as $file) {
-                                       $js.=file_get_contents($this->assets . '/' . $file);
-                                       $js.="\n\n";
+                                       $js .= file_get_contents($this->assets . '/' . $file);
+                                       $js .= "\n\n";
                                }
                                $tmp = cubeFiles::tempnam();
                                file_put_contents($tmp, $js);
@@ -889,14 +889,14 @@ class wsHTML5Compiler {
                $arrowsColor = $this->theme->parametres->arrowsColor;
                // Set the icon list with the color
                $icons = array('nav-bookmark' => $couleurI, 'nav-friend' => $couleurI, 'nav-help' => $couleurI, 'nav-index' => $couleurI, 'nav-sommaire' => $couleurI,
-                       'nav-zoomin' => $couleurI, 'nav-zoomout' => $couleurI, 'nav-fullscreen' => $couleurI,
-                       'interface-next' => $arrowsColor, 'interface-previous' => $arrowsColor, 'interface-search' => $couleurI, 'interface-back-arrow' => $subTextColor, 'interface-print' => $subTextColor,
-                       'interface-down' => $arrowsColor, 'interface-close' => $arrowsColor,
-                       'help-fingers' => $couleurI, 'help-mouse' => $couleurI, 'nav-home' => $couleurI, 'nav-archives' => $couleurI, 'nav-map' => $couleurI,
-                       'nav-tag' => $couleurI, 'nav-print' => $couleurI, 'nav-friend' => $couleurI,
-                       'share-facebook' => $couleurM, 'share-twitter' => $couleurM, 'share-email' => $couleurM, 'share-googleplus' => $couleurM, 'share-linkedin' => $couleurM, 'share-viadeo' => $couleurM,
-                       'bookmark-left-off' => $bookmarksDisabledColors, 'bookmark-left-on' => $bookmarksEnabledColors,
-                       'bookmark-right-off' => $bookmarksDisabledColors, 'bookmark-right-on' => $bookmarksEnabledColors
+                              'nav-zoomin' => $couleurI, 'nav-zoomout' => $couleurI, 'nav-fullscreen' => $couleurI,
+                              'interface-next' => $arrowsColor, 'interface-previous' => $arrowsColor, 'interface-search' => $couleurI, 'interface-back-arrow' => $subTextColor, 'interface-print' => $subTextColor,
+                              'interface-down' => $arrowsColor, 'interface-close' => $arrowsColor,
+                              'help-fingers' => $couleurI, 'help-mouse' => $couleurI, 'nav-home' => $couleurI, 'nav-archives' => $couleurI, 'nav-map' => $couleurI,
+                              'nav-tag' => $couleurI, 'nav-print' => $couleurI, 'nav-friend' => $couleurI,
+                              'share-facebook' => $couleurM, 'share-twitter' => $couleurM, 'share-email' => $couleurM, 'share-googleplus' => $couleurM, 'share-linkedin' => $couleurM, 'share-viadeo' => $couleurM,
+                              'bookmark-left-off' => $bookmarksDisabledColors, 'bookmark-left-on' => $bookmarksEnabledColors,
+                              'bookmark-right-off' => $bookmarksDisabledColors, 'bookmark-right-on' => $bookmarksEnabledColors
                );
 
                $this->config->iconsDimensions = array();
@@ -959,8 +959,8 @@ class wsHTML5Compiler {
 
                $convert = new cubeCommandLine('composite');
                $cmd = '-compose Multiply ';
-               $cmd.=$tmp . ' ' . $orig . ' ';
-               $cmd.=$this->vdir . '/cover.jpg';
+               $cmd .= $tmp . ' ' . $orig . ' ';
+               $cmd .= $this->vdir . '/cover.jpg';
                $convert->setManualArg($cmd);
                $convert->execute();
 
@@ -1035,36 +1035,36 @@ class wsHTML5Compiler {
 
                        $br = '.background.r' . $r . '{';
                        if ($ratio != 1) {
-                               $br.=self::writeCSSUA('transform', 'scale(' . $ratio . ')') . ';';
+                               $br .= self::writeCSSUA('transform', 'scale(' . $ratio . ')') . ';';
                        }
-                       $br.='width:' . $wr . 'px;height:' . $hr . 'px;}';
+                       $br .= 'width:' . $wr . 'px;height:' . $hr . 'px;}';
                        $res[] = $br;
                }
                $texts = '.texts{' . self::writeCSSUA('transform-origin', 'top left') . ';';
-               $texts.=self::writeCSSUA('transform', 'scale(' . round((1 / $this->multiply) * $cssScale * $this->cssSVGScale, 3) . ')') . ';';
-               $texts.='width:' . ($wm / $this->cssSVGScale) . '; max-width:' . ($wm / $this->cssSVGScale) . ';';
-               $texts.='height:' . ($hm / $this->cssSVGScale) . '; max-height:' . ($hm / $this->cssSVGScale) . ';';
-               $texts.='}';
+               $texts .= self::writeCSSUA('transform', 'scale(' . round((1 / $this->multiply) * $cssScale * $this->cssSVGScale, 3) . ')') . ';';
+               $texts .= 'width:' . ($wm / $this->cssSVGScale) . '; max-width:' . ($wm / $this->cssSVGScale) . ';';
+               $texts .= 'height:' . ($hm / $this->cssSVGScale) . '; max-height:' . ($hm / $this->cssSVGScale) . ';';
+               $texts .= '}';
                $res[] = $texts;
 
                // Theme
                $shade = '.page .shade{';
-               $shade.='opacity:' . ($this->theme->parametres->shadeAlpha / 100) . ';';
-               $shade.='}';
+               $shade .= 'opacity:' . ($this->theme->parametres->shadeAlpha / 100) . ';';
+               $shade .= '}';
                $res[] = $shade;
 
                // Search field
                $searchColor = self::colorToCSS($this->theme->parametres->couleurS);
                $searchBackColor = self::colorToCSS($this->theme->parametres->searchFieldColor);
                $search = '#q{';
-               $search.='color:' . $searchColor . ';';
-               $search.='background-color:' . $searchBackColor . ';';
+               $search .= 'color:' . $searchColor . ';';
+               $search .= 'background-color:' . $searchBackColor . ';';
                if ($this->theme->parametres->searchShadeAlpha > 0) {
-                       $search.=self::writeCSSUA('box-shadow', '1px 1px 4px rgba(0,0,0,' . ($this->theme->parametres->searchShadeAlpha / 100) . ')') . ' inset;';
+                       $search .= self::writeCSSUA('box-shadow', '1px 1px 4px rgba(0,0,0,' . ($this->theme->parametres->searchShadeAlpha / 100) . ')') . ' inset;';
                }
-               $search.='}';
-               $search.='#searchHints,.hint{color:' . $searchColor . ';background-color:' . $searchBackColor . ';}';
-               $search.='.hint:hover{color:' . $searchBackColor . ';background-color:' . $searchColor . ';}';
+               $search .= '}';
+               $search .= '#searchHints,.hint{color:' . $searchColor . ';background-color:' . $searchBackColor . ';}';
+               $search .= '.hint:hover{color:' . $searchBackColor . ';background-color:' . $searchColor . ';}';
 
                $res[] = $search;
 
@@ -1076,15 +1076,15 @@ class wsHTML5Compiler {
                // Archives
                // Header
                $header = 'header{';
-               $header.='height:' . $this->theme->parametres->menuHeight . 'px;';
-               $header.='background-color:' . self::colorToCSS($this->theme->parametres->menuColor) . ';';
+               $header .= 'height:' . $this->theme->parametres->menuHeight . 'px;';
+               $header .= 'background-color:' . self::colorToCSS($this->theme->parametres->menuColor) . ';';
                if ($this->theme->parametres->menuImage != '') {
                        $this->copy($this->themeRoot . '/' . $this->theme->parametres->menuImage, $this->vdir . '/data/images/' . $this->theme->parametres->menuImage);
-                       $header.='background-image:url(../images/' . $this->theme->parametres->menuImage . ');';
-                       $header.='background-repeat:no-repeat;';
-                       $header.='background-size:100% ' . $this->theme->parametres->menuHeight . 'px;';
+                       $header .= 'background-image:url(../images/' . $this->theme->parametres->menuImage . ');';
+                       $header .= 'background-repeat:no-repeat;';
+                       $header .= 'background-size:100% ' . $this->theme->parametres->menuHeight . 'px;';
                }
-               $header.='}';
+               $header .= '}';
                $res[] = $header;
 
                //Icons
@@ -1096,9 +1096,9 @@ class wsHTML5Compiler {
                if ($this->theme->parametres->logo) {
                        $this->copy($this->themeRoot . '/' . $this->theme->parametres->logo, $this->vdir . '/data/images/' . $this->theme->parametres->logo);
                        $dim = getimagesize($this->vdir . '/data/images/' . $this->theme->parametres->logo);
-                       $logo.='background-image:url(../images/' . $this->theme->parametres->logo . ');width:' . $dim[0] . 'px;height:' . $dim[1] . 'px;';
+                       $logo .= 'background-image:url(../images/' . $this->theme->parametres->logo . ');width:' . $dim[0] . 'px;height:' . $dim[1] . 'px;';
                }
-               $logo.='}';
+               $logo .= '}';
                $res[] = $logo;
 
                // Credits
@@ -1141,8 +1141,8 @@ class wsHTML5Compiler {
                $res[] = '.mview{background-color:' . $menuColor->toCSS() . ';color:' . $menuTextColor . ';}';
 
                # Inner View
-               $res[].='#innerView>div{background-color:' . $menuColor->toCSS() . ';color:' . $menuTextColor . ';}';
-               $res[].='form input[type="text"],form input[type="email"]{background-color:' . self::colorToCSS($this->theme->parametres->subFieldColor) . ';color:' . self::colorToCSS($this->theme->parametres->subTextFieldColor) . ';}';
+               $res[] .= '#innerView>div{background-color:' . $menuColor->toCSS() . ';color:' . $menuTextColor . ';}';
+               $res[] .= 'form input[type="text"],form input[type="email"]{background-color:' . self::colorToCSS($this->theme->parametres->subFieldColor) . ';color:' . self::colorToCSS($this->theme->parametres->subTextFieldColor) . ';}';
 
                // Archives
                if ($this->book->parametres->externalArchivesBack) {
@@ -1163,7 +1163,7 @@ class wsHTML5Compiler {
        background-image: linear-gradient(top bottom, $top 0%,$bottom 100%); /* W3C */
 }";
 
-               $caption.=".mview .caption a{
+               $caption .= ".mview .caption a{
        border:1px solid $border;
 }";
                $res[] = $caption;
@@ -1202,21 +1202,21 @@ class wsHTML5Compiler {
 
        protected function _cssBackground() {
                $body = '#background,#splash{';
-               $body.='background-color:#' . $this->theme->parametres->backgroundColor . ';';
+               $body .= 'background-color:#' . $this->theme->parametres->backgroundColor . ';';
                switch ($this->theme->parametres->repeat) {
                        case wsTheme::REPEAT:
-                               $body.='background-repeat:repeat;';
+                               $body .= 'background-repeat:repeat;';
                                break;
                        case wsTheme::NONE:
-                               $body.='background-repeat:no-repeat;';
+                               $body .= 'background-repeat:no-repeat;';
                                break;
                        case wsTheme::RATIO:
-                               $body.='background-repeat:no-repeat;';
-                               $body.='background-size:cover;';
+                               $body .= 'background-repeat:no-repeat;';
+                               $body .= 'background-size:cover;';
                                break;
                        case wsTheme::STRETCH:
-                               $body.='background-repeat:no-repeat;';
-                               $body.='background-size:100% 100%;';
+                               $body .= 'background-repeat:no-repeat;';
+                               $body .= 'background-size:100% 100%;';
                                break;
                }
                if ($this->theme->parametres->backgroundImage != '') {
@@ -1227,36 +1227,36 @@ class wsHTML5Compiler {
                        }
 
                        $this->copy($this->themeRoot . '/' . $this->theme->parametres->backgroundImage, $this->vdir . '/data/images/' . $this->theme->parametres->backgroundImage);
-                       $body.='background-image:url(../images/' . $this->theme->parametres->backgroundImage . ');';
-                       $body.='background-position:';
+                       $body .= 'background-image:url(../images/' . $this->theme->parametres->backgroundImage . ');';
+                       $body .= 'background-position:';
 
                        switch ($this->theme->parametres->backgroundVAlign) {
                                case wsTheme::TOP:
-                                       $body.='top';
+                                       $body .= 'top';
                                        break;
                                case wsTheme::MIDDLE:
-                                       $body.='center';
+                                       $body .= 'center';
                                        break;
                                case wsTheme::BOTTOM:
-                                       $body.='bottom';
+                                       $body .= 'bottom';
                                        break;
                        }
-                       $body.=' ';
+                       $body .= ' ';
                        switch ($this->theme->parametres->backgroundHAlign) {
                                case wsTheme::LEFT:
-                                       $body.='left';
+                                       $body .= 'left';
                                        break;
                                case wsTheme::CENTER:
-                                       $body.='center';
+                                       $body .= 'center';
                                        break;
                                case wsTheme::RIGHT:
-                                       $body.='right';
+                                       $body .= 'right';
                                        break;
                        }
-                       $body.=';';
+                       $body .= ';';
                }
 
-               $body.='}';
+               $body .= '}';
 
                return $body;
        }
index 30657f2af0e0b504016fdc8a07c40471d2d589fb..929ccea85b51c55a870447de097728e997c7d621 100644 (file)
@@ -26,6 +26,8 @@ class wsHTML5Link {
        public $id;
        public $rot;
 
+       protected $_init;
+
        /**
         *
         * @var wsHTML5Compiler
@@ -133,6 +135,7 @@ class wsHTML5Link {
        }
 
        public function __construct($id, $init, &$compiler) {
+               $this->_init = $init;
                foreach ($init as $k => $v) {
                        $this->$k = $v;
                }
@@ -194,6 +197,9 @@ class wsHTML5Link {
        public function unzipFile($file, $moveAssets = false) {
                $fdir = 'data/links/' . $file;
                $dir = $this->compiler->vdir . '/' . $fdir;
+               if (file_exists($dir) && is_file($dir)) {
+                       unlink($dir);
+               }
                if (!file_exists($dir)) {
                        mkdir($dir, 0777, true);
                }
@@ -221,18 +227,18 @@ class wsHTML5Link {
        public function getCSSContainer() {
                if (!($this instanceof contentLink) && $this->page % 2 == 1) {
                        $this->page--;
-                       $this->left+=$this->compiler->width;
+                       $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 .= '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;';
                if ($this->rot) {
-                       $css.= wsHTML5Compiler::writeCSSUA('transform', 'rotate(' . $this->rot . 'deg)');
-                       $css.= wsHTML5Compiler::writeCSSUA('transform-origin', '0% 0%');
+                       $css .= wsHTML5Compiler::writeCSSUA('transform', 'rotate(' . $this->rot . 'deg)');
+                       $css .= wsHTML5Compiler::writeCSSUA('transform-origin', '0% 0%');
                }
-               $css.=$this->getCSS();
-               $css.='}';
+               $css .= $this->getCSS();
+               $css .= '}';
                return $css;
        }
 
@@ -309,6 +315,19 @@ class htmlMultimediaImage extends wsHTML5Link {
 
 }
 
+class htmlMultimediaPopupLink extends htmlMultimediaPopupImage {
+
+       public function getAdditionnalContent() {
+               $i = $this->_init;
+               $i['inline'] = true;
+
+               $l = wsHTML5Link::getMultimediaInstance($this->id . '_content', $i, $this->compiler);
+               $markup = $l->getHTMLContainer();
+               return ' data-multimedia="' . rawurlencode($markup) . '" ';
+       }
+}
+
+
 class htmlMultimediaPopupImage extends normalLink {
 
        public function getURL() {
@@ -424,19 +443,19 @@ class videoLink extends wsHTML5Link {
 
                $res = '<div class="videoContainer" ';
                if (!is_null($w) && !is_null($h)) {
-                       $res.='data-width="' . $w . '" data-height="' . $h . '" ';
+                       $res .= 'data-width="' . $w . '" data-height="' . $h . '" ';
                } else if (!is_null($compiler)) {
 
                        $path = WS_BOOKS . '/working/' . $compiler->book_id . '/' . $basename . '.jpg';
                        $dim = getimagesize($path);
-                       $res.='data-width="' . $dim[0] . '" data-height="' . $dim[1] . '" ';
-               }
-               $res.=' data-autoplay="' . $autoplay . '"';
-               $res.=' data-controls="' . $controls . '"';
-               $res.=' data-loop="' . $loop . '"';
-               $res.=' data-sound="' . $sound . '"';
-               $res.=' data-name="' . $basename . '"';
-               $res.='></div>';
+                       $res .= 'data-width="' . $dim[0] . '" data-height="' . $dim[1] . '" ';
+               }
+               $res .= ' data-autoplay="' . $autoplay . '"';
+               $res .= ' data-controls="' . $controls . '"';
+               $res .= ' data-loop="' . $loop . '"';
+               $res .= ' data-sound="' . $sound . '"';
+               $res .= ' data-name="' . $basename . '"';
+               $res .= '></div>';
                return $res;
        }
 
@@ -574,6 +593,8 @@ class htmlMultimediaLink extends wsHTML5Link {
        public function getHTMLContent() {
                if ($this->_content == '') {
                        $ext = files::getExtension($this->alternative);
+                       fb($this->alternative);
+                       fb($ext);
                        if ($ext == 'oam') {
                                $d = $this->unzipFile($this->alternative, true);
                                $this->_config = $this->getConfigOAM($d['dir']);
@@ -585,6 +606,7 @@ class htmlMultimediaLink extends wsHTML5Link {
                        } elseif ($ext == 'html') {
                                $fdir = 'data/links';
                                $dir = $this->compiler->vdir . '/' . $fdir;
+
                                $d = array('fdir' => $fdir, 'dir' => $dir);
                                if (!file_exists($d['dir'])) {
                                        fb($d['dir']);
@@ -595,12 +617,14 @@ class htmlMultimediaLink extends wsHTML5Link {
                                $this->copyExternalFile($d['dir'] . '/' . $this->alternative);
                        }
 
+                       fb($this->_config);
+
                        $w = $this->width * $this->getCssScale();
                        $h = $this->height * $this->getCssScale();
                        if ($this->_config['html']) {
                                $this->_url = $d['fdir'] . '/' . $this->_config['html'];
                                if ($this->extra) {
-                                       $this->_url.='?' . $this->extra;
+                                       $this->_url .= '?' . $this->extra;
                                }
 
                                $iw = $this->_config['width'];
@@ -643,14 +667,14 @@ class htmlMultimediaLink extends wsHTML5Link {
        public function getCSSContainer() {
                if (!($this instanceof contentLink) && $this->page % 2 == 1) {
                        $this->page--;
-                       $this->left+=$this->compiler->width;
+                       $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->_config['width'] . 'px;height:' . $this->_config['height'] . 'px;';
-               $css.=$this->getCSS();
-               $css.='}';
+               $css .= 'left:' . $this->left * $this->getCssScale() . 'px;top:' . $this->top * $this->getCssScale() . 'px;';
+               $css .= 'width:' . $this->_config['width'] . 'px;height:' . $this->_config['height'] . 'px;';
+               $css .= $this->getCSS();
+               $css .= '}';
                return $css;
        }
 
@@ -659,7 +683,7 @@ class htmlMultimediaLink extends wsHTML5Link {
                $sy = ($this->height / ($this->_config['height'])) * $this->getCssScale();
 
                $res = wsHTML5Compiler::writeCSSUA('transform', 'scale(' . $sx . ',' . $sy . ')');
-               $res.= wsHTML5Compiler::writeCSSUA('transform-origin', '0% 0%');
+               $res .= wsHTML5Compiler::writeCSSUA('transform-origin', '0% 0%');
 
                if (!$this->_config['html']) {
                        return '';
@@ -674,7 +698,8 @@ class htmlMultimediaLink extends wsHTML5Link {
                } else {
                        $r = array('html' => false, 'inject' => array(file_get_contents($d . '/init.js')), 'injectcss' => array('multimedia.css'), 'injectjs' => array('multimedia.js'));
                }
-               return array_merge($res, $r);
+               $res = array_merge($res, $r);
+               return $res;
        }
 
        public function getConfigHTML($d, $html) {
@@ -686,7 +711,7 @@ class htmlMultimediaLink extends wsHTML5Link {
 
        public function getConfigOAM($d) {
                $x = simplexml_load_file($d . '/config.xml');
-               $config = (string) $x->oamfile['src'];
+               $config = (string)$x->oamfile['src'];
                $config = str_replace('/Assets', '', $d . '/' . $config);
                $x = simplexml_load_file($config, 'SimpleXMLElement', LIBXML_NOCDATA);
                $c = CubeIT_Util_Xml::toObject($x);
@@ -738,23 +763,23 @@ class audioLink extends wsHTML5Link {
        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.='}';
+               $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 = '<audio controls ';
                if ($linkDatas->video_loop) {
-                       $res.='loop ';
+                       $res .= 'loop ';
                }
                if ($linkDatas->video_auto_start) {
-                       $res.='autoplay ';
+                       $res .= 'autoplay ';
                }
-               $res.=' src="' . wsHTML5Link::getUniversalLocation($linkDatas->to) . '"';
-               $res.='></audio>';
+               $res .= ' src="' . wsHTML5Link::getUniversalLocation($linkDatas->to) . '"';
+               $res .= '></audio>';
                return $res;
        }
 
@@ -797,18 +822,18 @@ class inpesPopinLink extends htmlMultimediaLink {
        public function getCSSContainer() {
                if (!($this instanceof contentLink) && $this->page % 2 == 1) {
                        $this->page--;
-                       $this->left+=$this->compiler->width;
+                       $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 .= '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;';
                if ($this->rot) {
-                       $css.= wsHTML5Compiler::writeCSSUA('transform', 'rotate(' . $this->rot . 'deg)');
-                       $css.= wsHTML5Compiler::writeCSSUA('transform-origin', '0% 0%');
+                       $css .= wsHTML5Compiler::writeCSSUA('transform', 'rotate(' . $this->rot . 'deg)');
+                       $css .= wsHTML5Compiler::writeCSSUA('transform-origin', '0% 0%');
                }
-               $css.=$this->getCSS();
-               $css.='}';
+               $css .= $this->getCSS();
+               $css .= '}';
                return $css;
        }
 
@@ -824,7 +849,7 @@ class inpesPopinLink extends htmlMultimediaLink {
 
        public function getAdditionnalContent() {
                $res = parent::getAdditionnalContent();
-               $res.=' data-src="' . $this->_url . '" data-width="900" data-height="650"';
+               $res .= ' data-src="' . $this->_url . '" data-width="900" data-height="650"';
                return $res;
        }
 
index 3defc0aa69d561df3997f3849266fa082c939c9e..12644be5ae981f28f1878cfacd464c20a0e1d01f 100644 (file)
@@ -108,10 +108,10 @@ class wsPackagerHTML5 extends wsPackager {
                $arrowsColor = '#' . $this->theme->parametres->arrowsColor;\r
                // Set the icon list with the color\r
                $icons = array('nav-bookmark' => $couleurI, 'nav-friend' => $couleurI, 'nav-help' => $couleurI, 'nav-index' => $couleurI, 'nav-sommaire' => $couleurI,\r
-                       'next' => $arrowsColor, 'previous' => $arrowsColor, 'search' => $couleurI);\r
+                              'next' => $arrowsColor, 'previous' => $arrowsColor, 'search' => $couleurI);\r
 \r
                foreach ($icons as $icon => $color) {\r
-                       wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/',4, $w, $h);\r
+                       wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', 4, $w, $h);\r
                        $res[] = '#icon-' . $icon . '{width:' . $w . 'px;height:' . $h . 'px;background-image:url(data/images/' . $icon . '.svg), url(data/images/' . $icon . '.png);background-repeat:no-repeat;background-size:' . $w . 'px ' . $h . 'px}';\r
                }\r
                return $res;\r
@@ -156,9 +156,9 @@ class wsPackagerHTML5 extends wsPackager {
 \r
                $res = '<div class="' . $class . '">';\r
                foreach ($line['groups'] as $group) {\r
-                       $res.=$this->writeGroup($group);\r
+                       $res .= $this->writeGroup($group);\r
                }\r
-               $res.='</div>';\r
+               $res .= '</div>';\r
                return $res;\r
        }\r
 \r
@@ -196,9 +196,9 @@ class wsPackagerHTML5 extends wsPackager {
 \r
                $res = '<div class="' . $class . '">';\r
                foreach ($group['spans'] as $span) {\r
-                       $res.=$this->writeSpan($span);\r
+                       $res .= $this->writeSpan($span);\r
                }\r
-               $res.='</div>';\r
+               $res .= '</div>';\r
                return $res;\r
        }\r
 \r
@@ -231,86 +231,86 @@ class wsPackagerHTML5 extends wsPackager {
 \r
                        $br = '.background.r' . $r . '{';\r
                        if ($ratio != 1) {\r
-                               $br.=$this->writeCSSUA('transform', 'scale(' . $ratio . ')') . ';';\r
+                               $br .= $this->writeCSSUA('transform', 'scale(' . $ratio . ')') . ';';\r
                        }\r
-                       $br.='width:' . $wr . 'px;height:' . $hr . 'px;}';\r
+                       $br .= 'width:' . $wr . 'px;height:' . $hr . 'px;}';\r
                        $res[] = $br;\r
                }\r
                $res[] = '.doublePage,#pages,.landscape #shadow.double{width:' . $w2 . ';max-width:' . $w2 . ';height:' . $h . ';max-height:' . $h . '}';\r
                $res[] = '.landscape #shadow.single.right{left: ' . $w . ';}';\r
                $res[] = '.landscape .page.right{left:' . $w . '}';\r
                $texts = '.texts{' . $this->writeCSSUA('transform-origin', 'top left') . ';';\r
-               $texts.=$this->writeCSSUA('transform', 'scale(' . (1 / $this->multiply) . ')') . ';';\r
-               $texts.='width:' . $wm . '; max-width:' . $wm . ';';\r
-               $texts.='height:' . $hm . '; max-height:' . $hm . ';';\r
-               $texts.='}';\r
+               $texts .= $this->writeCSSUA('transform', 'scale(' . (1 / $this->multiply) . ')') . ';';\r
+               $texts .= 'width:' . $wm . '; max-width:' . $wm . ';';\r
+               $texts .= 'height:' . $hm . '; max-height:' . $hm . ';';\r
+               $texts .= '}';\r
                $res[] = $texts;\r
 \r
                // Theme\r
                // Background\r
                $body = '#main{';\r
-               $body.='background-color:#' . $this->theme->parametres->backgroundColor . ';';\r
+               $body .= 'background-color:#' . $this->theme->parametres->backgroundColor . ';';\r
                switch ($this->theme->parametres->repeat) {\r
                        case wsTheme::REPEAT:\r
-                               $body.='background-repeat:repeat;';\r
+                               $body .= 'background-repeat:repeat;';\r
                                break;\r
                        case wsTheme::NONE:\r
-                               $body.='background-repeat:no-repeat;';\r
+                               $body .= 'background-repeat:no-repeat;';\r
                                break;\r
                        case wsTheme::RATIO:\r
-                               $body.='background-repeat:no-repeat;';\r
+                               $body .= 'background-repeat:no-repeat;';\r
                                break;\r
                        case wsTheme::STRETCH:\r
-                               $body.='background-repeat:no-repeat;';\r
-                               $body.='background-size:100% 100%;';\r
+                               $body .= 'background-repeat:no-repeat;';\r
+                               $body .= 'background-size:100% 100%;';\r
                                break;\r
                }\r
                if ($this->theme->parametres->backgroundImage != '') {\r
                        copy($this->themeRoot . '/' . $this->theme->parametres->backgroundImage, $this->vdir . '/data/images/' . $this->theme->parametres->backgroundImage);\r
-                       $body.='background-image:url(../images/' . $this->theme->parametres->backgroundImage . ');';\r
-                       $body.='background-position:';\r
+                       $body .= 'background-image:url(../images/' . $this->theme->parametres->backgroundImage . ');';\r
+                       $body .= 'background-position:';\r
 \r
 \r
                        switch ($this->theme->parametres->backgroundVAlign) {\r
                                case wsTheme::TOP:\r
-                                       $body.='top';\r
+                                       $body .= 'top';\r
                                        break;\r
                                case wsTheme::MIDDLE:\r
-                                       $body.='center';\r
+                                       $body .= 'center';\r
                                        break;\r
                                case wsTheme::BOTTOM:\r
-                                       $body.='bottom';\r
+                                       $body .= 'bottom';\r
                                        break;\r
                        }\r
-                       $body.=' ';\r
+                       $body .= ' ';\r
                        switch ($this->theme->parametres->backgroundHAlign) {\r
                                case wsTheme::LEFT:\r
-                                       $body.='left';\r
+                                       $body .= 'left';\r
                                        break;\r
                                case wsTheme::CENTER:\r
-                                       $body.='center';\r
+                                       $body .= 'center';\r
                                        break;\r
                                case wsTheme::RIGHT:\r
-                                       $body.='right';\r
+                                       $body .= 'right';\r
                                        break;\r
                        }\r
-                       $body.=';';\r
+                       $body .= ';';\r
                }\r
 \r
-               $body.='}';\r
+               $body .= '}';\r
                $res[] = $body;\r
 \r
                // Header\r
                $header = '#header{';\r
-               $header.='height:' . $this->theme->parametres->menuHeight . 'px;';\r
-               $header.='background-color:' . self::colorToCSS($this->theme->parametres->menuColor) . ';';\r
+               $header .= 'height:' . $this->theme->parametres->menuHeight . 'px;';\r
+               $header .= 'background-color:' . self::colorToCSS($this->theme->parametres->menuColor) . ';';\r
                if ($this->theme->parametres->menuImage != '') {\r
                        copy($this->themeRoot . '/' . $this->theme->parametres->menuImage, $this->vdir . '/data/images/' . $this->theme->parametres->menuImage);\r
-                       $header.='background-image:url(../images/' . $this->theme->parametres->menuImage . ');';\r
-                       $header.='background-repeat:no-repeat;';\r
-                       $header.='background-size:100% ' . $this->theme->parametres->menuHeight . 'px;';\r
+                       $header .= 'background-image:url(../images/' . $this->theme->parametres->menuImage . ');';\r
+                       $header .= 'background-repeat:no-repeat;';\r
+                       $header .= 'background-size:100% ' . $this->theme->parametres->menuHeight . 'px;';\r
                }\r
-               $header.='}';\r
+               $header .= '}';\r
                $res[] = $header;\r
 \r
                //Icons\r
@@ -321,9 +321,9 @@ class wsPackagerHTML5 extends wsPackager {
                if ($this->theme->parametres->logo) {\r
                        copy($this->themeRoot . '/' . $this->theme->parametres->logo, $this->vdir . '/data/images/' . $this->theme->parametres->logo);\r
                        $dim = getimagesize($this->vdir . '/data/images/' . $this->theme->parametres->logo);\r
-                       $logo.='background-image:url(../images/' . $this->theme->parametres->logo . ');width:' . $dim[0] . 'px;height:' . $dim[1] . 'px;';\r
+                       $logo .= 'background-image:url(../images/' . $this->theme->parametres->logo . ');width:' . $dim[0] . 'px;height:' . $dim[1] . 'px;';\r
                }\r
-               $logo.='}';\r
+               $logo .= '}';\r
                $res[] = $logo;\r
 \r
                // Credits\r
@@ -363,15 +363,15 @@ class wsPackagerHTML5 extends wsPackager {
                }\r
 \r
                foreach ($this->cssRotation as $rotation => $index) {\r
-                       $rotation*= - 1;\r
+                       $rotation *= -1;\r
 \r
 \r
                        $to = 'transform-origin:left top;';\r
 \r
                        $css = '.r' . $index . '{';\r
-                       $css.=self::writeCSSUA('transform', 'rotate(' . $rotation . 'deg)') . ';';\r
-                       $css.=self::writeCSSUA('transform-origin', 'left top');\r
-                       $css.='}';\r
+                       $css .= self::writeCSSUA('transform', 'rotate(' . $rotation . 'deg)') . ';';\r
+                       $css .= self::writeCSSUA('transform-origin', 'left top');\r
+                       $css .= '}';\r
                        $res[] = $css;\r
                }\r
 \r
@@ -401,9 +401,9 @@ class wsPackagerHTML5 extends wsPackager {
                        $res[] = $this->addGroup($group, $document_id);\r
                }\r
                return array('x' => $this->normalizeFloatValue($line['x']),\r
-                       'y' => $this->normalizeFloatValue($line['y']),\r
-                       'rotation' => $this->getCSSRotation($this->normalizeFloatValue($line['rotation'], 0)),\r
-                       "groups" => $res);\r
+                            'y' => $this->normalizeFloatValue($line['y']),\r
+                            'rotation' => $this->getCSSRotation($this->normalizeFloatValue($line['rotation'], 0)),\r
+                            "groups" => $res);\r
        }\r
 \r
        protected function addGroup($group, $document_id) {\r
@@ -438,7 +438,7 @@ class wsPackagerHTML5 extends wsPackager {
 \r
        protected function addSpan($span, $document_id) {\r
 \r
-               $text = (string) $span;\r
+               $text = (string)$span;\r
                if ($text == '') {\r
                        return false;\r
                }\r
@@ -510,7 +510,7 @@ class wsPackagerHTML5 extends wsPackager {
        }\r
 \r
        protected function getIndex($value, &$tab) {\r
-               $value = (string) $value;\r
+               $value = (string)$value;\r
                if (isset($tab[$value])) {\r
                        return $tab[$value];\r
                }\r
@@ -519,9 +519,9 @@ class wsPackagerHTML5 extends wsPackager {
                return $res;\r
        }\r
 \r
-       protected function normalizeFloatValue($value, $round=3) {\r
+       protected function normalizeFloatValue($value, $round = 3) {\r
                $value = str_replace(',', '.', $value);\r
-               $value = (float) $value;\r
+               $value = (float)$value;\r
                $value = round($value, $round);\r
                return $value;\r
        }\r
@@ -546,7 +546,7 @@ class wsPackagerHTML5 extends wsPackager {
        }\r
 \r
        public function __destruct() {\r
-               \r
+\r
        }\r
 \r
        public static function colorToCSS($color) {\r
@@ -563,7 +563,7 @@ class wsPackagerHTML5 extends wsPackager {
                                $hex = substr($color, $k * 2, 2);\r
                                $$name = intval($hex, 16);\r
                        }\r
-                       $alpha/=255;\r
+                       $alpha /= 255;\r
                        if ($alpha == 0) {\r
                                return 'transparent';\r
                        } elseif ($alpha == 1) {\r