]> _ Git - cubeextranet.git/commitdiff
#fluidbook-workshop : fix problem with mail and https redirect (add an exception...
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 9 Mar 2016 10:57:12 +0000 (10:57 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 9 Mar 2016 10:57:12 +0000 (10:57 +0000)
Redirect calls to archived docs files (back & front)
Begin to integrate new theme

14 files changed:
.htaccess
fluidbook/icones/interface/interface-previous.svg
inc/ws/Controlleur/class.ws.services.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/DAO/class.ws.dao.document.php
inc/ws/Metier/class.ws.document.php
inc/ws/Metier/class.ws.theme.parametres.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.html.php
inc/ws/Util/packager/class.ws.packager.html5.php
inc/ws/Util/packager/class.ws.packager.v1.php
inc/ws/Util/packager/html5/class.ws.packager.html5.php

index dd559d2bcc553bb240f96d56e2e8138c0a3dec2d..c76967de8f5ac6daa63fa8855ec02a0b8509b5af 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -38,12 +38,20 @@ AddCharset UTF-8 log
 \r
        RewriteCond %{HTTPS} off\r
        RewriteCond %{HTTP_HOST} workshop.fluidbook.com\r
+       RewriteCond %{REQUEST_URI} !^/s/\r
+       RewriteCond %{REQUEST_URI} !^/services/\r
+       RewriteCond %{REQUEST_URI} !^/crossdomain.xml\r
        RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\r
 \r
        RewriteCond %{HTTPS} off\r
        RewriteCond %{HTTP_HOST} extranet.cubedesigners.com\r
        RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\r
 \r
+       # Docs\r
+    RewriteCond %{REQUEST_FILENAME} !-d\r
+    RewriteCond %{REQUEST_FILENAME} !-f\r
+    RewriteRule ^fluidbook/docs/(.*)$ /fluidbook/docs1/$1 [L]\r
+\r
        # Favicon\r
        RewriteCond %{HTTP_HOST} cubedesigners\r
        RewriteRule ^favicon.ico$ images/extranet/favicon.ico [L]\r
index d68cb27d12adb58128fe2bd1babaf96b4713b5ce..a7025781d590da46d97b0ddc75b7d15ad13e5167 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->\r
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">\r
 <svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\r
         width="40px" height="100px" viewBox="1.5 1.75 40 100" enable-background="new 1.5 1.75 40 100" xml:space="preserve">\r
index 2ecd8bf811783c23bbbdaec1533f9b1bcf029aa0..14773ef15d98a5fc99756dc482ff6a6aba29ba45 100644 (file)
@@ -832,7 +832,10 @@ class wsServices extends cubeFlashGateway {
                                        $traductions[$r->lang_id] = json_decode($r->traductions);
                                }
 
-                               $d = array('id' => $id, 'res' => $resolution, 'ns' => $ns, 'langs' => $langs, 'langnames' => $langsnames, 'time' => $version, 'datas' => $composition, 'couvertures' => $couvertures, 'traductions' => $traductions, 'contents' => $contents);
+                               $theme = $collection->theme;
+                               $settings = $collection->settings;
+
+                               $d = array('id' => $id, 'res' => $resolution, 'ns' => $ns, 'langs' => $langs, 'langnames' => $langsnames, 'time' => $version, 'datas' => $composition, 'couvertures' => $couvertures, 'traductions' => $traductions, 'contents' => $contents, 'theme' => $theme, 'settings' => $settings);
                                if (!$collection->settings['offline']) {
                                        $d = array_merge($d, $this->_getManifest($publications, '/fluidbook/collections/versions/' . $id . '/' . $version . '/' . $os, $books, $resolution));
                                }
index b7aa458b44b67cb74ab8dd2c9a03a4fa68d30dfa..56fc76ed6efa93f23f7524a17fb17c0f4c43714f 100644 (file)
@@ -323,6 +323,10 @@ class wsUrl {
                $res .= '<tr><td class="min nowrap">' . __("Synchronisations supplémentaires") . '</td><td>' . form::textarea(array('settings[offline_syncs]', 'offline_syncs'), 30, 3, $collection->settings['offline_syncs']) . '</td></tr>';
                $res .= '</table>';
 
+
+               if (!isset($collection->settings['perline'])  || !$collection->settings['perline']) {
+                       $collection->settings['perline'] = 3;
+               }
                $res .= '<h3>' . __('Thème') . '</h3>';
                $res .= '<table class="max">';
                $images = array('back' => __('Image de fond'), 'etagere' => __("Image de l'étagère"), 'icon' => __("Icône de l'application") . ' (1024x1024px)');
@@ -334,6 +338,7 @@ class wsUrl {
                $res .= '<tr><td class="min nowrap">' . __('Couleur des textes') . '</td><td>#' . form::field(array('settings[couleurC]', 'couleurC'), 6, 6, $collection->settings['couleurC']) . '</td></tr>';
                $res .= '<tr><td class="min nowrap">' . __('Couleur des titres de publication') . '</td><td>#' . form::field(array('settings[couleurE]', 'couleurC'), 6, 6, $collection->settings['couleurE']) . '</td></tr>';
                $res .= '<tr><td class="min nowrap">' . __('Couleur de fond') . '</td><td>#' . form::field(array('settings[couleurD]', 'couleurD'), 6, 6, $collection->settings['couleurD']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Nombre de publication par ligne') . '</td><td>' . form::field(array('settings[perline]', 'perline'), 1, 1, $collection->settings['perline']) . '</td></tr>';
 
                $res .= '</table>';
 
index d641e86b37b191b937e3e0a1f282fa421639a80d..fc74f946c88dffeede9f0af936576d57c420591e 100644 (file)
@@ -115,7 +115,16 @@ class wsDAOBook extends commonDAO {
                } else {
                        $table = 'books_vue';
                }
-               $sql = 'SELECT * FROM ' . $table . ' WHERE book_id IN (' . implode(',', $book_ids) . ')';
+
+               $ids = array();
+               foreach ($book_ids as $bid) {
+                       fb($bid);
+                       if (intval($bid) > 0) {
+                               $ids[] = $bid;
+                       }
+               }
+
+               $sql = 'SELECT * FROM ' . $table . ' WHERE book_id IN (' . implode(',', $ids) . ')';
                $books = $this->factory($this->con->select($sql));
                $res = array();
                foreach ($books as $book) {
@@ -835,7 +844,7 @@ class wsDAOBook extends commonDAO {
                        $docs = array_unique($docs);
 
                        foreach ($docs as $doc) {
-                               $out = WS_DOCS . '/' . $doc . '/';
+                               $out = wsDocument::getDir($doc);
 
                                $fwstk = new cubeCommandLine('fwstk');
                                $fwstk->setPath(CONVERTER_PATH);
@@ -850,8 +859,8 @@ class wsDAOBook extends commonDAO {
                $index = array();
                $textes = array();
                foreach ($pages as $book_page => $infos) {
-                       $tfile = WS_DOCS . '/' . $infos['document_id'] . '/' . $prefix . 'p' . $infos['document_page'] . '.txt';
-                       $ifile = WS_DOCS . '/' . $infos['document_id'] . '/' . $prefix . 'i' . $infos['document_page'] . '.txt';
+                       $tfile = wsDocument::getDir($infos['document_id']) . $prefix . 'p' . $infos['document_page'] . '.txt';
+                       $ifile = wsDocument::getDir($infos['document_id']) . $prefix . 'i' . $infos['document_page'] . '.txt';
                        CubeIT_Util_Gzip::compressIfNotCompressed($tfile);
                        CubeIT_Util_Gzip::compressIfNotCompressed($ifile);
                        $text = CubeIT_Util_Gzip::file_get_contents($tfile);
@@ -1252,8 +1261,8 @@ class wsDAOBook extends commonDAO {
                $sizes = array();
 
                foreach ($pages as $i => $infos) {
-                       $base = WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'];
-                       $baset = WS_DOCS . '/' . $infos['document_id'] . '/t' . $infos['document_page'];
+                       $base = wsDocument::getDir($infos['document_id']) . 'p' . $infos['document_page'];
+                       $baset = wsDocument::getDir($infos['document_id']) . 't' . $infos['document_page'];
                        $swffile = $base . '.swf';
                        if (file_exists($swffile)) {
                                $fsize = filesize($swffile);
@@ -1480,7 +1489,7 @@ class wsDAOBook extends commonDAO {
                        $tempswf[$i] = cubeFiles::tempnam();
 
                        $it = new imageTools();
-                       $image = WS_DOCS . '/' . $page['document_id'] . '/html/t150-' . $page['document_page'] . '.jpg';
+                       $image = wsDocument::getDir($page['document_id']) . '/html/t150-' . $page['document_page'] . '.jpg';
 
                        try {
                                $it->loadImage($image);
@@ -1528,7 +1537,7 @@ class wsDAOBook extends commonDAO {
          foreach ($pages as $i => $infos) {
          $doc = new Zend_Search_Lucene_Document();
          $doc->addField(Zend_Search_Lucene_Field::Text('url', '#' . $i));
-         $doc->addField(Zend_Search_Lucene_Field::UnStored('contents', file_get_contents(WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.txt')));
+         $doc->addField(Zend_Search_Lucene_Field::UnStored('contents', file_get_contents(wsDocument::getDir($infos['document_id']) . 'p' . $infos['document_page'] . '.txt')));
          $index->addDocument($doc);
          }
 
@@ -1559,7 +1568,7 @@ class wsDAOBook extends commonDAO {
                        if ($fmtime >= $book->composition_update) {
                                $invalid = false;
                                foreach ($pages as $i => $infos) {
-                                       $doc = WS_DOCS . '/' . $infos['document_id'] . '/crop.pdf';
+                                       $doc = wsDocument::getDir($infos['document_id']) . 'crop.pdf';
                                        if (filemtime($doc) > $fmtime) {
                                                $invalid = true;
                                        }
@@ -1585,7 +1594,7 @@ class wsDAOBook extends commonDAO {
                                        $firstDoc = $infos['document_id'];
                                }
 
-                               $doc = WS_DOCS . '/' . $infos['document_id'] . '/crop.pdf';
+                               $doc = wsDocument::getDir($infos['document_id']) . 'crop.pdf';
                                if (!isset($pdfList[$doc])) {
                                        $pdfList[$doc] = $j;
                                        $nb_pages[$doc] = $infos['nb_pages'];
@@ -1603,7 +1612,7 @@ class wsDAOBook extends commonDAO {
 
                        if ($original) {
 
-                               $this->copy(WS_DOCS . '/' . $firstDoc . '/crop.pdf', $originalPDF);
+                               $this->copy(wsDocument::getDir($firstDoc) . 'crop.pdf', $originalPDF);
                        } else {
                                $args = '';
                                foreach ($pdfList as $doc => $index) {
index 5f029984a09bbde8bf63cebd1ba4d31f7eaa22ac..a0e235af070358af4237c6dd514b0d6a1da201a3 100644 (file)
@@ -69,7 +69,7 @@ class wsDAODocument extends commonDAO {
                for ($page = 1; $page <= $document->generalInfos['pages']; $page++) {
                        $links[$page] = array();
 
-                       $csv = WS_DOCS . '/' . $document->document_id . '/p' . $page . '.csv';
+                       $csv = wsDocument::getDir($document->document_id) . '/p' . $page . '.csv';
                        if (!file_exists($csv) && file_exists($csv . '.gz')) {
                                $csv = 'compress.zlib://' . $csv . '.gz';
                        } elseif (!file_exists($csv)) {
index 0ff93efe80f7f8a969bce5d886f81190d96dfc73..e35bff11812fddc67d11ffdfbe3ba1301bfd223d 100644 (file)
@@ -41,6 +41,8 @@ class wsDocument extends cubeMetier {
        protected $cropped;
        protected $rgb;
 
+       protected static $_docsDir;
+
        const NORMAL = 0;
        const FLATTEN = 1;
        const POLY2BITMAP = 2;
@@ -58,7 +60,7 @@ class wsDocument extends cubeMetier {
                                      'UppercaseLetters' => 'letters_up', 'LowercaseLetters' => 'letters_low');
 
        public function init() {
-               $this->out = WS_DOCS . '/' . $this->document_id . '/';
+               $this->out = wsDocument::getDir($this->document_id);
                $this->log = $this->out . '/logs/';
                $this->html = $this->out . '/html/';
                $this->in = $this->out . 'original.pdf';
@@ -764,13 +766,14 @@ class wsDocument extends cubeMetier {
                        $pdf2swf->setPath(CONVERTER_PATH);
 
                        $pdf2swf->setArg('p', $page);
+                       $flashversion = 10;
 
                        if ($method == self::NORMAL) {
                                // Default
                                $multiply = 1;
                        } elseif ($method == self::FLATTEN) {
-                               $pdf2swf->setArg('flatten');
                                $multiply = 1;
+                               $pdf2swf->setArg('flatten');
                        } elseif ($method == self::POLY2BITMAP) {
                                // Raster graphics, keep texts
                                $pdf2swf->setArg('set poly2bitmap');
@@ -783,7 +786,7 @@ class wsDocument extends cubeMetier {
                                $pdf2swf->setArg('set multiply', $multiply);
                        }
                        // $pdf2swf->setManualArg('-v');
-                       $pdf2swf->setArg('T', 10);
+                       $pdf2swf->setArg('T', $flashversion);
                        $pdf2swf->setArg('set reordertags', '0');
                        if ($storeAllChars) {
                                $pdf2swf->setArg('fonts');
@@ -923,6 +926,34 @@ class wsDocument extends cubeMetier {
 
        }
 
+       public static function getDir($id) {
+
+               if(!is_array(self::$_docsDir)){
+                       self::$_docsDir=array();
+               }
+
+               if(isset(self::$_docsDir[$id])){
+                       return self::$_docsDir[$id];
+               }
+
+               $new = WS_DOCS . '/' . $id . '/';
+               $old = '/mnt/sshfs/batman/home/extranet/www/fluidbook/docs/' . $id . '/';
+
+               if (file_exists($new . '/p1.swf')) {
+                       self::$_docsDir[$id]=$new;
+                       return $new;
+               } elseif (file_exists($old . 'p1.swf')) {
+                       self::$_docsDir[$id]=$old;
+                       return $old;
+               }
+               if (!file_exists($new)) {
+                       mkdir($new, 0777, true);
+                       self::$_docsDir[$id]=$new;
+                       return $new;
+               }
+       }
+
+
 }
 
 ?>
\ No newline at end of file
index 913b15b36f62fef98c770e326d99c1bb5a9e110a..038fd566098eef86382ed2fef937d39569549b27 100644 (file)
@@ -15,27 +15,29 @@ class wsThemeParametres extends wsParametres {
 \r
                parent::initFields();\r
                /* Navigation */\r
+               $this->fields['arrowsTheme'] = array('type' => 'boolean', "default" => false, "editable" => true, "label" => __('Nouveau thème'));\r
                $this->fields['couleurA'] = array('type' => 'couleurAlpha', 'default' => 'ff000000', 'editable' => true,\r
-                       'label' => __("Couleur de fond"));\r
+                                                 'label' => __("Couleur de fond"));\r
                $this->fields['arrowsColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
-                       'label' => __('Couleur des flèches'));\r
+                                                    'label' => __('Couleur des flèches'));\r
                $this->fields['shadeOnArrows'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Ombre portée sous les flèches'));\r
 \r
+\r
                $this->forms['bouton'] = array('label' => __('Personnalisation des boutons'),\r
-                       'fieldsnames' => array('couleurA', 'arrowsColor', 'shadeOnArrows'));\r
+                                              'fieldsnames' => array('couleurA', 'arrowsColor', 'shadeOnArrows', 'arrowsTheme'));\r
                /* Submenus */\r
                $this->fields['couleurB'] = array('type' => 'couleurAlpha', 'default' => 'ff000000', 'editable' => true,\r
-                       'label' => __("Couleur de fond"));\r
+                                                 'label' => __("Couleur de fond"));\r
                $this->fields['subTextColor'] = array('type' => 'couleur', 'default' => 'ffffffff', 'editable' => true,\r
-                       'label' => __("Couleur du texte"));\r
+                                                     'label' => __("Couleur du texte"));\r
                $this->fields['subSelectColor'] = array('type' => 'couleurAlpha', 'default' => 'ffffffff', 'editable' => true,\r
-                       'label' => __("Couleur des zones de sélection"));\r
+                                                       'label' => __("Couleur des zones de sélection"));\r
                $this->fields['subTextSelectColor'] = array('type' => 'couleur', 'default' => '000000', 'editable' => true,\r
-                       'label' => __("Couleur des textes des zones de sélection"));\r
+                                                           'label' => __("Couleur des textes des zones de sélection"));\r
                $this->fields['subTextFieldColor'] = array('type' => 'couleur', 'default' => '000000', 'editable' => true,\r
-                       'label' => __("Couleur des textes des champs d'édition"));\r
+                                                          'label' => __("Couleur des textes des champs d'édition"));\r
                $this->fields['subFieldColor'] = array('type' => 'couleurAlpha', 'default' => 'ffffffff', 'editable' => true,\r
-                       'label' => __("Couleur des champs d'édition"));\r
+                                                      'label' => __("Couleur des champs d'édition"));\r
                $this->fields['subStrokeWidth'] = array('type' => 'integer', 'default' => 0, "editable" => true, 'label' => __('Largeur du contour'));\r
                $this->fields['subStrokeColor'] = array('type' => 'couleur', 'default' => 'ffffff', "editable" => true, 'label' => __('Couleur du contour'));\r
                $this->fields['subShade'] = array('type' => 'couleurAlpha', 'default' => '00000000', "editable" => true, 'label' => __('Ombre sous le sous-menu'));\r
@@ -46,161 +48,161 @@ class wsThemeParametres extends wsParametres {
                $this->fields['subButtonDecoration'] = array('type' => 'couleur', 'default' => '797979', 'editable' => true, 'label' => __('Couleur des décorations'));\r
 \r
                $this->forms['menu'] = array('label' => __('Personnalisation des menus'),\r
-                       'fieldsnames' => array('couleurB', 'subTextColor', '|', 'subSelectColor', 'subTextSelectColor', '|', 'subTextFieldColor', 'subFieldColor',\r
-                               '|', 'subStrokeWidth', 'subStrokeColor', 'subShade', 'subRound',\r
-                               '|', 'subButtonCustom', 'subButtonBackground', 'subButtonColor', 'subButtonDecoration'));\r
+                                            'fieldsnames' => array('couleurB', 'subTextColor', '|', 'subSelectColor', 'subTextSelectColor', '|', 'subTextFieldColor', 'subFieldColor',\r
+                                                                   '|', 'subStrokeWidth', 'subStrokeColor', 'subShade', 'subRound',\r
+                                                                   '|', 'subButtonCustom', 'subButtonBackground', 'subButtonColor', 'subButtonDecoration'));\r
 \r
                /* Search */\r
                $this->fields['couleurS'] = array('type' => 'couleur', 'default' => '000000', 'editable' => true,\r
-                       'label' => __("Couleur du texte"));\r
+                                                 'label' => __("Couleur du texte"));\r
                $this->fields['searchFieldColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
-                       'label' => __("Couleur du champs de saisie"));\r
+                                                         'label' => __("Couleur du champs de saisie"));\r
                $this->fields['searchShadeAlpha'] = array('type' => 'integer', 'default' => 0, 'editable' => true,\r
-                       'label' => __("Intensité de l'ombre dans le champ de saisie"),\r
-                       'min' => 0, 'max' => 100);\r
+                                                         'label' => __("Intensité de l'ombre dans le champ de saisie"),\r
+                                                         'min' => 0, 'max' => 100);\r
                $this->fields['highlightColor'] = array('type' => 'couleur', 'default' => '00ff00', 'editable' => true,\r
-                       'label' => __("Couleur du surlignage des résultats"));\r
+                                                       'label' => __("Couleur du surlignage des résultats"));\r
                $this->fields['searchFieldWidth'] = array('type' => 'integer', 'default' => 230, 'editable' => true,\r
-                       'label' => __("Largeur du champ de recherche"));\r
+                                                         'label' => __("Largeur du champ de recherche"));\r
                $this->fields['searchIndexNoResultColor'] = array('type' => 'couleurAlpha', 'default' => 'CC000000', 'editable' => true,\r
-                       'label' => __("Couleur de l'overlay (aucun résultat)"),\r
-                       'grade' => 5);\r
+                                                                 'label' => __("Couleur de l'overlay (aucun résultat)"),\r
+                                                                 'grade' => 5);\r
 \r
                $this->forms['search'] = array('label' => __('Personnalisation de la recherche'),\r
-                       'fieldsnames' => array('couleurS', 'searchFieldColor', 'searchShadeAlpha', 'searchFieldWidth', '|', 'highlightColor', '|', 'searchIndexNoResultColor'));\r
+                                              'fieldsnames' => array('couleurS', 'searchFieldColor', 'searchShadeAlpha', 'searchFieldWidth', '|', 'highlightColor', '|', 'searchIndexNoResultColor'));\r
                /* Icones */\r
                $this->fields['iconSet'] = array('type' => 'icones', 'default' => 1, 'editable' => true,\r
-                       'label' => __("Jeu d'icônes"));\r
+                                                'label' => __("Jeu d'icônes"));\r
                $this->fields['colorizeIcons'] = array('type' => 'boolean', 'default' => false, 'editable' => true,\r
-                       'label' => __('Colorier les icônes'));\r
+                                                      'label' => __('Colorier les icônes'));\r
                $this->fields['couleurI'] = array('type' => 'couleur', 'default' => '$couleurA', 'editable' => true,\r
-                       'label' => __("Couleur des icônes"));\r
+                                                 'label' => __("Couleur des icônes"));\r
                $this->fields['iconShadeColor'] = array('type' => 'couleurAlpha', 'default' => '00000000', 'editable' => true,\r
-                       'label' => __("Couleur de l'effet de rollover"));\r
+                                                       'label' => __("Couleur de l'effet de rollover"));\r
                $this->fields['iconsHMargin'] = array('type' => 'integer', 'default' => 15, 'editable' => true,\r
-                       'label' => __('Espace entre les icônes'), 'min' => 0, 'max' => 50);\r
+                                                     'label' => __('Espace entre les icônes'), 'min' => 0, 'max' => 50);\r
 \r
                $this->fields['fontKit'] = array('type' => 'combo', 'default' => 'auto', 'editable' => true,\r
-                       'label' => __('Police de caractères'), 'datas' => array(__('Automatique') => 'auto',\r
-                               'VAG Rounded' => 'vagrounded',\r
-                               'Gill'=>'gill'));\r
+                                                'label' => __('Police de caractères'), 'datas' => array(__('Automatique') => 'auto',\r
+                                                                                                        'VAG Rounded' => 'vagrounded',\r
+                                                                                                        'Gill' => 'gill'));\r
 \r
                $this->forms['icones'] = array('label' => __('Personnalisation des icônes'),\r
-                       'fieldsnames' => array('iconSet', 'iconShadeColor', '|', 'iconsHMargin', '|', 'colorizeIcons', 'couleurI', '|', 'fontKit'));\r
+                                              'fieldsnames' => array('iconSet', 'iconShadeColor', '|', 'iconsHMargin', '|', 'colorizeIcons', 'couleurI', '|', 'fontKit'));\r
 \r
                /* Book */\r
                $this->fields['bookShadeColor'] = array('type' => 'couleurAlpha', 'default' => '66000000', 'editable' => true,\r
-                       'label' => __("Couleur de l'ombre sous la publication"));\r
+                                                       'label' => __("Couleur de l'ombre sous la publication"));\r
                $this->fields['shadeAlpha'] = array('type' => 'integer', 'default' => 100, 'editable' => true,\r
-                       'label' => __('Transparence des ombres et reflets sur les pages'),\r
-                       'min' => 0, 'max' => 100);\r
+                                                   'label' => __('Transparence des ombres et reflets sur les pages'),\r
+                                                   'min' => 0, 'max' => 100);\r
                $this->fields['pageReflection'] = array('type' => 'boolean', 'default' => false, 'editable' => true,\r
-                       'label' => __("Afficher le reflet sur la page"));\r
+                                                       'label' => __("Afficher le reflet sur la page"));\r
                $this->fields['usePageEdges'] = array('type' => 'boolean', 'default' => true, 'editable' => true,\r
-                       'label' => __("Afficher la bordure des pages"));\r
+                                                     'label' => __("Afficher la bordure des pages"));\r
                $this->fields['displayPageNumber'] = array('type' => 'boolean', 'default' => true, 'editable' => true,\r
-                       'label' => __('Afficher les numéros de page'));\r
+                                                          'label' => __('Afficher les numéros de page'));\r
                $this->fields['colorPageNumber'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
-                       'label' => __('Couleur des numéros de page'));\r
+                                                        'label' => __('Couleur des numéros de page'));\r
                $this->fields['linksColor'] = array('type' => 'couleur', 'default' => '$couleurA', 'editable' => true,\r
-                       'label' => __('Couleur des liens'));\r
+                                                   'label' => __('Couleur des liens'));\r
                $this->fields['videoBackgroundColor'] = array('type' => 'couleur', 'default' => '000000', 'editable' => true,\r
-                       'label' => __('Couleur de fond des videos'));\r
+                                                             'label' => __('Couleur de fond des videos'));\r
                $this->fields['popupVideoOverlay'] = array('type' => 'couleurAlpha', 'default' => '00000000', 'editable' => true,\r
-                       'label' => __('Overlay placé sous les vidéos en popup'));\r
+                                                          'label' => __('Overlay placé sous les vidéos en popup'));\r
                $this->fields['pageEdgeColor'] = array('type' => 'couleur', 'default' => 'dddddd', 'editable' => true,\r
-                       'label' => __('Couleur de la bordure'));\r
+                                                      'label' => __('Couleur de la bordure'));\r
                $this->fields['pageEdgeThickness'] = array('type' => 'integer', 'default' => 100, 'editable' => true,\r
-                       'label' => __('Epaisseur de la bordure'));\r
+                                                          'label' => __('Epaisseur de la bordure'));\r
                $this->fields['tooltipBackColor'] = array('type' => 'couleurAlpha', 'default' => 'CC000000', 'editable' => true,\r
-                       'label' => __("Couleur de fond des infobulles"));\r
+                                                         'label' => __("Couleur de fond des infobulles"));\r
                $this->fields['tooltipTextColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
-                       'label' => __("Couleur du texte des infobulles"));\r
+                                                         'label' => __("Couleur du texte des infobulles"));\r
                $this->fields['bookmarkBackgroundColor'] = array('type' => 'couleurAlpha', 'default' => 'ffadadad', 'editable' => true,\r
-                       'label' => __("Couleur de fond des marques-pages"));\r
+                                                                'label' => __("Couleur de fond des marques-pages"));\r
                $this->fields['bookmarkStarDisabledColor'] = array('type' => 'couleurAlpha', 'default' => '00ffffff', 'editable' => true,\r
-                       'label' => __("Couleur de l'étoile désactivée"));\r
+                                                                  'label' => __("Couleur de l'étoile désactivée"));\r
                $this->fields['bookmarkStarEnabledColor'] = array('type' => 'couleur', 'default' => 'ff7700', 'editable' => true,\r
-                       'label' => __("Couleur de l'étoile activée"));\r
+                                                                 'label' => __("Couleur de l'étoile activée"));\r
 \r
                $this->forms['book'] = array('label' => __('Personnalisation de la publication'),\r
-                       'fieldsnames' => array('pageReflection', 'shadeAlpha',\r
-                               '|', 'usePageEdges', 'pageEdgeColor', 'pageEdgeThickness',\r
-                               '|', 'bookShadeColor',\r
-                               '|', 'displayPageNumber', 'colorPageNumber',\r
-                               '|', 'linksColor', 'videoBackgroundColor', 'popupVideoOverlay',\r
-                               '|', 'tooltipBackColor', 'tooltipTextColor',\r
-                               '|', 'bookmarkBackgroundColor', 'bookmarkStarDisabledColor', 'bookmarkStarEnabledColor'));\r
+                                            'fieldsnames' => array('pageReflection', 'shadeAlpha',\r
+                                                                   '|', 'usePageEdges', 'pageEdgeColor', 'pageEdgeThickness',\r
+                                                                   '|', 'bookShadeColor',\r
+                                                                   '|', 'displayPageNumber', 'colorPageNumber',\r
+                                                                   '|', 'linksColor', 'videoBackgroundColor', 'popupVideoOverlay',\r
+                                                                   '|', 'tooltipBackColor', 'tooltipTextColor',\r
+                                                                   '|', 'bookmarkBackgroundColor', 'bookmarkStarDisabledColor', 'bookmarkStarEnabledColor'));\r
                /* Credits */\r
                $this->fields['creditsColor'] = array('type' => 'couleurAlpha', 'default' => '80ffffff', 'editable' => true,\r
-                       'label' => __("Couleur du texte"));\r
+                                                     'label' => __("Couleur du texte"));\r
 \r
                $this->forms['credits'] = array('label' => __('Personnalisation des crédits'),\r
-                       'fieldsnames' => array('creditsColor'));\r
+                                               'fieldsnames' => array('creditsColor'));\r
                /* Background */\r
                $this->fields['transparentBackground'] = array('type' => 'boolean', 'default' => false, 'editable' => true,\r
-                       'label' => __('Fond transparent'), 'hint' => __("Si cette option est cochée, aucun fond ne sera pris en compte (ni l'image, ni la couleur)"));\r
+                                                              'label' => __('Fond transparent'), 'hint' => __("Si cette option est cochée, aucun fond ne sera pris en compte (ni l'image, ni la couleur)"));\r
                $this->fields['backgroundColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
-                       'label' => __("Couleur du fond"));\r
+                                                        'label' => __("Couleur du fond"));\r
                $this->fields['backgroundImage'] = array('type' => 'file', 'default' => 'backgroundImg.jpg', 'editable' => true,\r
-                       'label' => __('Image de fond'),\r
-                       'path' => $themeRoot,\r
-                       'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id);\r
+                                                        'label' => __('Image de fond'),\r
+                                                        'path' => $themeRoot,\r
+                                                        'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id);\r
                $this->fields['repeat'] = array('type' => 'combo',\r
-                       'datas' => array(__('Etirer') => wsTheme::STRETCH,\r
-                               __('Etirer le fond en conservant les proportions') => wsTheme::RATIO,\r
-                               __("Répéter") => wsTheme::REPEAT,\r
-                               __('Ne pas répéter ni étirer') => wsTheme::NONE),\r
-                       'default' => 0, 'editable' => true, 'label' => __('Affichage du fond'));\r
+                                               'datas' => array(__('Etirer') => wsTheme::STRETCH,\r
+                                                                __('Etirer le fond en conservant les proportions') => wsTheme::RATIO,\r
+                                                                __("Répéter") => wsTheme::REPEAT,\r
+                                                                __('Ne pas répéter ni étirer') => wsTheme::NONE),\r
+                                               'default' => 0, 'editable' => true, 'label' => __('Affichage du fond'));\r
                $this->fields['backgroundHAlign'] = array('type' => 'combo',\r
-                       'datas' => array(__('Centré') => wsTheme::CENTER,\r
-                               __('Gauche') => wsTheme::LEFT,\r
-                               __("Droite") => wsTheme::RIGHT),\r
-                       'default' => wsTheme::CENTER, 'editable' => true, 'label' => __('Alignement Horizontal'));\r
+                                                         'datas' => array(__('Centré') => wsTheme::CENTER,\r
+                                                                          __('Gauche') => wsTheme::LEFT,\r
+                                                                          __("Droite") => wsTheme::RIGHT),\r
+                                                         'default' => wsTheme::CENTER, 'editable' => true, 'label' => __('Alignement Horizontal'));\r
                $this->fields['backgroundVAlign'] = array('type' => 'combo',\r
-                       'datas' => array(__('Milieu') => wsTheme::MIDDLE,\r
-                               __('Haut') => wsTheme::TOP,\r
-                               __("Bas") => wsTheme::BOTTOM),\r
-                       'default' => wsTheme::MIDDLE, 'editable' => true, 'label' => __('Alignement Vertical'));\r
+                                                         'datas' => array(__('Milieu') => wsTheme::MIDDLE,\r
+                                                                          __('Haut') => wsTheme::TOP,\r
+                                                                          __("Bas") => wsTheme::BOTTOM),\r
+                                                         'default' => wsTheme::MIDDLE, 'editable' => true, 'label' => __('Alignement Vertical'));\r
                $this->fields['displayBackgroundDuringLoading'] = array('type' => 'boolean', 'default' => true, 'editable' => true,\r
-                       'label' => __('Afficher le fond pendant le chargement'), 'hint' => __("Si cette option est désactivée, le fond ne sera affiché qu'à la fin du chargement"));\r
+                                                                       'label' => __('Afficher le fond pendant le chargement'), 'hint' => __("Si cette option est désactivée, le fond ne sera affiché qu'à la fin du chargement"));\r
 \r
                $this->forms['background'] = array('label' => __('Personnalisation du fond'),\r
-                       'fieldsnames' => array('transparentBackground', '|', 'backgroundColor', '|', 'backgroundImage',\r
-                               'repeat', 'backgroundHAlign', 'backgroundVAlign', '|', 'displayBackgroundDuringLoading'));\r
+                                                  'fieldsnames' => array('transparentBackground', '|', 'backgroundColor', '|', 'backgroundImage',\r
+                                                                         'repeat', 'backgroundHAlign', 'backgroundVAlign', '|', 'displayBackgroundDuringLoading'));\r
                /* Menu bar */\r
                $this->fields['menuHeight'] = array('type' => 'integer', 'default' => 39, 'editable' => true,\r
-                       'label' => __('Hauteur (en pixels)'));\r
+                                                   'label' => __('Hauteur (en pixels)'));\r
                $this->fields['menuColor'] = array('type' => 'couleurAlpha', 'default' => 'ffffffff', 'editable' => true,\r
-                       'label' => __("Couleur du fond"));\r
+                                                  'label' => __("Couleur du fond"));\r
                $this->fields['shadeOnMenu'] = array('type' => 'boolean', 'default' => true, 'editable' => true,\r
-                       'label' => __('Ombre portée sous la barre du menu'));\r
+                                                    'label' => __('Ombre portée sous la barre du menu'));\r
                $this->fields['menuImage'] = array('type' => 'file', 'default' => 'menu_back.png', 'editable' => true,\r
-                       'label' => __('Image de fond'),\r
-                       'path' => $themeRoot,\r
-                       'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id);\r
+                                                  'label' => __('Image de fond'),\r
+                                                  'path' => $themeRoot,\r
+                                                  'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id);\r
                $this->fields['invertMenuPosition'] = array('type' => 'boolean', 'default' => false, 'editable' => true,\r
-                       'label' => __("Intervertir le menu et le logo"));\r
+                                                           'label' => __("Intervertir le menu et le logo"));\r
 \r
                $this->fields['topBar'] = array('type' => 'file', 'default' => '', 'editable' => true,\r
-                       'label' => __('Top Bar'),\r
-                       'path' => $themeRoot,\r
-                       'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id);\r
+                                               'label' => __('Top Bar'),\r
+                                               'path' => $themeRoot,\r
+                                               'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id);\r
                $this->fields['topBarAlign'] = array('type' => 'combo',\r
-                       'datas' => array(__('Centré') => wsTheme::CENTER,\r
-                               __('Gauche') => wsTheme::LEFT,\r
-                               __("Droite") => wsTheme::RIGHT),\r
-                       'default' => wsTheme::LEFT, 'editable' => true, 'label' => __('Alignement Horizontal de la Top Bar'));\r
+                                                    'datas' => array(__('Centré') => wsTheme::CENTER,\r
+                                                                     __('Gauche') => wsTheme::LEFT,\r
+                                                                     __("Droite") => wsTheme::RIGHT),\r
+                                                    'default' => wsTheme::LEFT, 'editable' => true, 'label' => __('Alignement Horizontal de la Top Bar'));\r
 \r
                $this->fields['afterSearch'] = array('type' => 'file', 'default' => '', 'editable' => true,\r
-                       'label' => __('Image supplémentaire'),\r
-                       'path' => $themeRoot,\r
-                       'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id,\r
-                       'hint' => __('Image disposée à droite du champ de recherche')\r
+                                                    'label' => __('Image supplémentaire'),\r
+                                                    'path' => $themeRoot,\r
+                                                    'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id,\r
+                                                    'hint' => __('Image disposée à droite du champ de recherche')\r
                );\r
 \r
                $this->forms['menubar'] = array('label' => __('Personnalisation de la barre de menu'),\r
-                       'fieldsnames' => array('menuHeight', '|', 'menuColor', '|', 'menuImage', '|', 'shadeOnMenu', '|', 'invertMenuPosition', '|', 'topBar', 'topBarAlign', '|', 'afterSearch'));\r
+                                               'fieldsnames' => array('menuHeight', '|', 'menuColor', '|', 'menuImage', '|', 'shadeOnMenu', '|', 'invertMenuPosition', '|', 'topBar', 'topBarAlign', '|', 'afterSearch'));\r
                /* Menu bar logo */\r
 \r
                $imageFilter = new stdClass();\r
@@ -208,56 +210,56 @@ class wsThemeParametres extends wsParametres {
                $imageFilter->extensions = '*.png';\r
 \r
                $this->fields['logo'] = array('type' => 'file', 'default' => 'menu_clientLogo.png', 'editable' => true,\r
-                       'label' => __('Logo'),\r
-                       'path' => $themeRoot,\r
-                       'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id);\r
+                                             'label' => __('Logo'),\r
+                                             'path' => $themeRoot,\r
+                                             'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id);\r
                $this->fields['favicon'] = array('type' => 'file', 'default' => '', 'editable' => true,\r
-                       'label' => __('Icone (pour favicon et CD-ROM)'),\r
-                       'path' => $themeRoot,\r
-                       'fileFilter' => $imageFilter,\r
-                       'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&amp;type=favicon',\r
-                       'hint' => __('Image PNG de 256x256'));\r
+                                                'label' => __('Icone (pour favicon et CD-ROM)'),\r
+                                                'path' => $themeRoot,\r
+                                                'fileFilter' => $imageFilter,\r
+                                                'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&amp;type=favicon',\r
+                                                'hint' => __('Image PNG de 256x256'));\r
                $this->fields['iosicon'] = array('type' => 'file', 'default' => '', 'editable' => true,\r
-                       'label' => __('Icone (pour application iOS)'),\r
-                       'path' => $themeRoot,\r
-                       'fileFilter' => $imageFilter,\r
-                       'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&amp;type=iosicon',\r
-                       'hint' => __('Image PNG de 1024x1024'));\r
+                                                'label' => __('Icone (pour application iOS)'),\r
+                                                'path' => $themeRoot,\r
+                                                'fileFilter' => $imageFilter,\r
+                                                'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&amp;type=iosicon',\r
+                                                'hint' => __('Image PNG de 1024x1024'));\r
                $this->fields['androidicon'] = array('type' => 'file', 'default' => '', 'editable' => true,\r
-                       'label' => __('Icone (pour application Android)'),\r
-                       'path' => $themeRoot,\r
-                       'fileFilter' => $imageFilter,\r
-                       'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&amp;type=androidicon',\r
-                       'hint' => __('Image PNG de 1024x1024'));\r
+                                                    'label' => __('Icone (pour application Android)'),\r
+                                                    'path' => $themeRoot,\r
+                                                    'fileFilter' => $imageFilter,\r
+                                                    'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&amp;type=androidicon',\r
+                                                    'hint' => __('Image PNG de 1024x1024'));\r
 \r
                $this->forms['logo'] = array('label' => __('Personnalisation du logo'),\r
-                       'fieldsnames' => array('logo', '|', 'favicon', 'iosicon', 'androidicon'));\r
+                                            'fieldsnames' => array('logo', '|', 'favicon', 'iosicon', 'androidicon'));\r
                /* Loader */\r
                $this->fields['logoLoader'] = array('type' => 'file', 'default' => 'logoLoader.png', 'editable' => true,\r
-                       'label' => __('Logo affiché au chargement'),\r
-                       'path' => $themeRoot,\r
-                       'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id);\r
+                                                   'label' => __('Logo affiché au chargement'),\r
+                                                   'path' => $themeRoot,\r
+                                                   'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id);\r
                $this->fields['couleurL'] = array('type' => 'couleur', 'default' => '', 'editable' => true,\r
-                       'label' => __("Couleur principale de la barre de chargement"));\r
+                                                 'label' => __("Couleur principale de la barre de chargement"));\r
                $this->fields['loadingSecColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
-                       'label' => __("Couleur secondaire de la barre de chargement"));\r
+                                                        'label' => __("Couleur secondaire de la barre de chargement"));\r
                $this->fields['loadingBackColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
-                       'label' => __("Couleur du fond affichée avant l'affichage de l'image de fond"));\r
+                                                         'label' => __("Couleur du fond affichée avant l'affichage de l'image de fond"));\r
                $this->fields['loaderPosition'] = array('type' => 'boolean', 'default' => false, 'editable' => true,\r
-                       'label' => __('Placer le logo à gauche et le loader à droite'), 'grade' => 3);\r
+                                                       'label' => __('Placer le logo à gauche et le loader à droite'), 'grade' => 3);\r
 \r
                $this->forms['loader'] = array('label' => __('Personnalisation du loader'),\r
-                       'fieldsnames' => array('loadingBackColor', '|', 'couleurL', 'loadingSecColor', 'logoLoader', 'loaderPosition'));\r
+                                              'fieldsnames' => array('loadingBackColor', '|', 'couleurL', 'loadingSecColor', 'logoLoader', 'loaderPosition'));\r
                /* Pages bar */\r
                $this->fields['pagesBar'] = array('type' => 'boolean', 'default' => true, 'editable' => true,\r
-                       'label' => __("Afficher la barre d'accès rapide aux pages"));\r
+                                                 'label' => __("Afficher la barre d'accès rapide aux pages"));\r
                $this->fields['pageBarThumbBack'] = array('type' => 'couleurAlpha', 'default' => '80000000', 'editable' => true,\r
-                       'label' => __("Couleur de fond de la boîte"));\r
+                                                         'label' => __("Couleur de fond de la boîte"));\r
                $this->fields['bookmarkColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
-                       'label' => __("Couleur des marques-pages"));\r
+                                                      'label' => __("Couleur des marques-pages"));\r
 \r
                $this->forms['pagesbar'] = array('label' => __('Personnalisation de la barre des pages'),\r
-                       'fieldsnames' => array('pagesBar', 'pageBarThumbBack', '|', 'bookmarkColor'));\r
+                                                'fieldsnames' => array('pagesBar', 'pageBarThumbBack', '|', 'bookmarkColor'));\r
 \r
                /* Paramètres non implémentés */\r
                /* $this->fields['extraXSpace'] = array('type' => 'integer', 'default' => '0', 'editable' => true,\r
index ff8bf2cc17b1da72143d12c710baaf93996c70b8..59be1e92951202f4d6177f4d4393d16400deb1ce 100644 (file)
@@ -212,7 +212,7 @@ class wsHTML5Compiler {
                $this->width = round($size[0], 3);
                $this->height = round($size[1], 3);
 
-               $imagesize = getimagesize(WS_DOCS . '/' . $this->pages[1]['document_id'] . '/html/h150-' . $this->pages[1]['document_page'] . '.jpg');
+               $imagesize = getimagesize(wsDocument::getDir($this->pages[1]['document_id']) . 'html/h150-' . $this->pages[1]['document_page'] . '.jpg');
                $this->pdf2htmlRatio = round(($imagesize[0] * 0.48) / $this->width, 3);
 
                $this->cssScale = min($this->optimalWidth / $this->width, $this->optimalHeight / $this->height);
@@ -925,8 +925,8 @@ class wsHTML5Compiler {
                }
                foreach ($this->pages as $page => $infos) {
                        if ($this->svg) {
-                               $orig = WS_DOCS . '/' . $infos['document_id'] . '/html/p' . $infos['document_page'] . '.svg';
-                               $opt = WS_DOCS . '/' . $infos['document_id'] . '/html/o' . $infos['document_page'] . '.svg';
+                               $orig = wsDocument::getDir($infos['document_id']) . 'html/p' . $infos['document_page'] . '.svg';
+                               $opt = wsDocument::getDir($infos['document_id']) . 'html/o' . $infos['document_page'] . '.svg';
 
                                $svg = $orig;
                                if (file_exists($opt) && filesize($opt) > 0) {
@@ -937,15 +937,15 @@ class wsHTML5Compiler {
                        }
 
                        foreach ($this->getResolutions() as $r) {
-                               $ok = $this->copy(WS_DOCS . '/' . $infos['document_id'] . '/html/' . $srcPrefix . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/' . $this->backgroundsPrefix . $page . '.jpg');
+                               $ok = $this->copy(wsDocument::getDir($infos['document_id']) . 'html/' . $srcPrefix . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/' . $this->backgroundsPrefix . $page . '.jpg');
                                if (!$ok && $r = 300) {
                                        $this->maxRes = 150;
                                }
                        }
-                       $this->copy(WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', $this->vdir . '/data/thumbnails/p' . $page . '.jpg');
+                       $this->copy(wsDocument::getDir($infos['document_id']) . 'p' . $infos['document_page'] . '.jpg', $this->vdir . '/data/thumbnails/p' . $page . '.jpg');
 
                        if ($page == 1) {
-                               $this->_makeCover(WS_DOCS . '/' . $infos['document_id'] . '/html/t36-' . $infos['document_page'] . '.jpg');
+                               $this->_makeCover(wsDocument::getDir($infos['document_id']) . 'html/t36-' . $infos['document_page'] . '.jpg');
                        }
                }
        }
index a0a4fe05ff15660fc5bf50b628397f811511902e..5750e8ae8c71a1ffb0137f6529d151aa4cf01e3d 100644 (file)
@@ -111,7 +111,7 @@ class wsHTML5Link {
                                return new statsTagLink($id, $init, $compiler);
                                break;
                        case
-                               24:
+                       24:
                                return new phoneLink($id, $init, $compiler);
                        default:
                                return null;
@@ -292,7 +292,7 @@ class normalLink extends wsHTML5Link {
                if ($t !== false) {
                        $tooltip = ' data-tooltip="' . $t . '"';
                }
-               return '<a href="' . $this->getURL() . '" target="' . $this->getTarget() . '"' . $tooltip . $c . $this->getAdditionnalContent() . $this->getTrack() . '></a>';
+               return '<a href="' . $this->getURL() . '" data-type="' . $this->type . '" target="' . $this->getTarget() . '"' . $tooltip . $c . $this->getAdditionnalContent() . $this->getTrack() . '></a>';
        }
 
        public function getTrack() {
index 4ef86c1b3d8775e85018b905472922d3dfba25d2..45627de33f88418541f07fee78ad69a78d7e09ba 100644 (file)
@@ -161,7 +161,7 @@ class wsPackagerHTML extends wsPackager {
                        }
                        $alt = '';
 
-                       $htmlfile = WS_DOCS . '/' . $infos['document_id'] . '/h' . $infos['document_page'] . '.txt';
+                       $htmlfile = wsDocument::getDir($infos['document_id']) . 'h' . $infos['document_page'] . '.txt';
 
                        if ($seoVersion && CubeIT_Util_Gzip::file_exists($htmlfile)) {
                                $html = CubeIT_Util_Gzip::file_get_contents($htmlfile);
index 0b7389f8b77de5e8f9499aa0612f814eb56c6ccb..da05fa44e508414b2ebc572d4f640356c7772b88 100644 (file)
@@ -29,13 +29,13 @@ class wsPackagerHTML5 extends wsPackager {
                parent::preparePackage();\r
 \r
                foreach ($this->pages as $page => $infos) {\r
-                       $file = WS_DOCS . '/' . $infos['document_id'] . '/html/p' . $infos['document_page'] . '.layout';\r
+                       $file = wsDocument::getDir($infos['document_id']) . 'html/p' . $infos['document_page'] . '.layout';\r
                        if (file_exists($file)) {\r
                                $this->layouts[$page] = simplexml_load_file($file, null, LIBXML_ERR_WARNING);\r
                        }\r
                }\r
 \r
-               $imagesize = getimagesize(WS_DOCS . '/' . $this->pages[1]['document_id'] . '/html/h72-' . $this->pages[1]['document_page'] . '.jpg');\r
+               $imagesize = getimagesize(wsDocument::getDir($this->pages[1]['document_id']) . 'html/h72-' . $this->pages[1]['document_page'] . '.jpg');\r
                $this->pdf2htmlRatio = $imagesize[0] / $this->layouts[1]['width'];\r
                $this->scale = 4;\r
                $this->multiply = $this->pdf2htmlRatio * $this->scale;\r
@@ -93,7 +93,7 @@ class wsPackagerHTML5 extends wsPackager {
                foreach ($this->cssFont as $font => $index) {\r
                        list($font, $document_id) = explode('//', $font);\r
                        foreach ($fext as $ext) {\r
-                               copy(WS_DOCS . '/' . $document_id . "/fonts/web/" . $font . '.' . $ext, $this->vdir . '/data/style/F' . $index . '.' . $ext);\r
+                               copy(wsDocument::getDir($document_id) . "fonts/web/" . $font . '.' . $ext, $this->vdir . '/data/style/F' . $index . '.' . $ext);\r
                        }\r
                }\r
        }\r
@@ -125,7 +125,7 @@ class wsPackagerHTML5 extends wsPackager {
                }\r
                foreach ($this->pages as $page => $infos) {\r
                        foreach (self::$resolutions as $r) {\r
-                               copy(WS_DOCS . '/' . $infos['document_id'] . '/html/h' . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/p' . $page . '.jpg');\r
+                               copy(wsDocument::getDir($infos['document_id']) . 'html/h' . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/p' . $page . '.jpg');\r
                        }\r
                }\r
        }\r
index 39af64c92eebda0103af303d607eb6bfe1355ba9..a88a9aaad0b91ff030b50405cdd4fb379ec100f5 100644 (file)
@@ -42,7 +42,7 @@ class wsPackagerV1 extends wsPackagerHTML {
 
        protected function copyThumbnails() {
                foreach ($this->pages as $book_page => $infos) {
-                       $this->copy(WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', $this->vdir . '/data/p' . $book_page . '.jpg');
+                       $this->copy(wsDocument::getDir($infos['document_id']) . 'p' . $infos['document_page'] . '.jpg', $this->vdir . '/data/p' . $book_page . '.jpg');
                }
        }
 
@@ -50,7 +50,7 @@ class wsPackagerV1 extends wsPackagerHTML {
                $xml = simplexml_load_string('<?xml version="1.0" encoding="UTF-8" ?><movie />');
 
                foreach ($this->pages as $book_page => $infos) {
-                       $ftext = WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.txt';
+                       $ftext = wsDocument::getDir($infos['document_id']) . 'p' . $infos['document_page'] . '.txt';
                        if (file_exists($ftext)) {
                                $xml->addChild('pageText', htmlspecialchars(CubeIT_Util_Gzip::file_get_contents($ftext)));
                        } else {
@@ -63,9 +63,9 @@ class wsPackagerV1 extends wsPackagerHTML {
 
        protected function getFlashvars() {
                return array('id' => $this->book_id,
-                       'mail' => '0',
-                       'onlineFlag' => '1',
-                       'loaderColor' => $this->theme->parametres->loadingBackColor);
+                            'mail' => '0',
+                            'onlineFlag' => '1',
+                            'loaderColor' => $this->theme->parametres->loadingBackColor);
        }
 
        protected function copyLinks() {
@@ -90,13 +90,13 @@ class wsPackagerV1 extends wsPackagerHTML {
                        $link['type'] = intval($link['type']);
 
                        if ($link['page'] % 2 == 1) {
-                               $link['page'] --;
+                               $link['page']--;
                                $link['left'] = $link['left'] + $this->size[0];
                        }
 
                        if ($link['type'] == 4 && !$link['inline']) {
                                $link['type'] = 1;
-                               $link['to'].='$' . $link['video_width'] . '$' . $link['video_height'];
+                               $link['to'] .= '$' . $link['video_width'] . '$' . $link['video_height'];
                        }
 
                        if ($link['type'] > 6) {
@@ -144,25 +144,25 @@ class wsPackagerV1 extends wsPackagerHTML {
                global $core;
 
                $mapping = array('width' => 'sizeX',
-                       'height' => 'sizeY',
-                       'repeat' => 'patternFlag',
-                       'zoom' => 'maxZoom',
-                       'zoomw' => 'maxZoomScroll',
-                       'url_link' => 'logoLink',
-                       'pdf' => 'pdfFlag',
-                       'search' => 'searchFlag',
-                       'friend' => 'sendfriendFlag',
-                       'print' => 'printFlag',
-                       'bookmark' => 'bookmarkFlag',
-                       'email_title' => 'emailTitle',
-                       'email_body' => 'emailBody',
-                       'email_editable' => 'emailEditable'
+                                'height' => 'sizeY',
+                                'repeat' => 'patternFlag',
+                                'zoom' => 'maxZoom',
+                                'zoomw' => 'maxZoomScroll',
+                                'url_link' => 'logoLink',
+                                'pdf' => 'pdfFlag',
+                                'search' => 'searchFlag',
+                                'friend' => 'sendfriendFlag',
+                                'print' => 'printFlag',
+                                'bookmark' => 'bookmarkFlag',
+                                'email_title' => 'emailTitle',
+                                'email_body' => 'emailBody',
+                                'email_editable' => 'emailEditable'
                );
 
                $more = array('id' => $this->book_id,
-                       'pagesSplit' => 1,
-                       'readingDir' => 'ltr',
-                       'ws' => '2');
+                             'pagesSplit' => 1,
+                             'readingDir' => 'ltr',
+                             'ws' => '2');
 
                $booleans = array('pdfFlag', 'printFlag', 'searchFlag', 'sendfriendFlag', 'bookmarkFlag', 'emailEditable');
 
@@ -187,9 +187,9 @@ class wsPackagerV1 extends wsPackagerHTML {
                $daoSignature = new wsDAOSignature($core->con);
                $s = $daoSignature->selectById($this->book->parametres->signature);
                $signature = array('fbCredit' => $s->main,
-                       'fbLink' => $s->mainLink,
-                       'partnerCredit' => $s->partner,
-                       'partnerLink' => $s->partnerLink);
+                                  'fbLink' => $s->mainLink,
+                                  'partnerCredit' => $s->partner,
+                                  'partnerLink' => $s->partnerLink);
 
 
                $allParams = array_merge($allParams, $signature);
@@ -198,7 +198,7 @@ class wsPackagerV1 extends wsPackagerHTML {
                $xtra = simplexml_load_string('<?xml version="1.0" encoding="UTF-8" ?><extras>' . $this->book->parametres->extras . '</extras>');
                foreach ($xtra as $xt) {
                        $k = $xt->getName();
-                       $v = (string) $xt;
+                       $v = (string)$xt;
                        $allParams[$k] = $v;
                }
 
@@ -242,9 +242,9 @@ class wsPackagerV1 extends wsPackagerHTML {
 
        public function copyTheme() {
                $files = array('logoLoader' => 'logoLoader.png',
-                       'backgroundImage' => 'backgroundImg.jpg',
-                       'logo' => 'menu_clientLogo.png',
-                       'menuImage' => 'menu_back.png');
+                              'backgroundImage' => 'backgroundImg.jpg',
+                              'logo' => 'menu_clientLogo.png',
+                              'menuImage' => 'menu_back.png');
 
                $images = $this->vdir . '/images';
                if (!file_exists($images)) {
index ac21e910d89cb83197afba8b71e96e1cf48ba5e1..3666dc46c22facef4852b4a3b21115d35f1d95c8 100644 (file)
@@ -30,13 +30,13 @@ class wsPackagerHTML5 extends wsPackager {
                parent::preparePackage();\r
 \r
                foreach ($this->pages as $page => $infos) {\r
-                       $file = WS_DOCS . '/' . $infos['document_id'] . '/html/p' . $infos['document_page'] . '.layout';\r
+                       $file = wsDocument::getDir($infos['document_id']) . 'html/p' . $infos['document_page'] . '.layout';\r
                        if (file_exists($file)) {\r
                                $this->layouts[$page] = simplexml_load_file($file, null, LIBXML_ERR_WARNING);\r
                        }\r
                }\r
 \r
-               $imagesize = getimagesize(WS_DOCS . '/' . $this->pages[1]['document_id'] . '/html/h72-' . $this->pages[1]['document_page'] . '.jpg');\r
+               $imagesize = getimagesize(wsDocument::getDir($this->pages[1]['document_id']) . 'html/h72-' . $this->pages[1]['document_page'] . '.jpg');\r
                $this->pdf2htmlRatio = round($imagesize[0] / $this->layouts[1]['width'], 2);\r
                $this->scale = 4;\r
                $this->multiply = $this->pdf2htmlRatio * $this->scale;\r
@@ -59,7 +59,7 @@ class wsPackagerHTML5 extends wsPackager {
        }\r
 \r
        protected function compareLines($a, $b) {\r
-               if ((float) $a['y'] > (float) $b['y']) {\r
+               if ((float)$a['y'] > (float)$b['y']) {\r
                        return 1;\r
                } else {\r
                        return -1;\r
@@ -188,21 +188,21 @@ class wsPackagerHTML5 extends wsPackager {
 \r
        protected function writeJs() {\r
                $files = array('js/libs/modernizr.js',\r
-                       'js/libs/jquery/jquery.js',\r
-                       'js/libs/jquery/jquery.transform.js',\r
-                       'js/libs/jquery/jquery.mousewheel.js',\r
-                       'js/libs/jquery/jquery.hashchange.js',\r
-                       'js/libs/fluidbook/fluidbook.utils.js',\r
-                       'js/libs/fluidbook/fluidbook.cache.js',\r
-                       'js/libs/fluidbook/fluidbook.support.js',\r
-                       'js/libs/fluidbook/fluidbook.viewport.js',\r
-                       'js/libs/fluidbook/fluidbook.desktop.js',\r
-                       'js/libs/fluidbook/fluidbook.service.js',\r
-                       'js/libs/fluidbook/fluidbook.loader.js',\r
-                       'js/libs/fluidbook/fluidbook.l10n.js',\r
-                       'js/libs/fluidbook/fluidbook.nav.js',\r
-                       'js/libs/fluidbook/fluidbook.js',\r
-                       'js/main.js');\r
+                              'js/libs/jquery/jquery.js',\r
+                              'js/libs/jquery/jquery.transform.js',\r
+                              'js/libs/jquery/jquery.mousewheel.js',\r
+                              'js/libs/jquery/jquery.hashchange.js',\r
+                              'js/libs/fluidbook/fluidbook.utils.js',\r
+                              'js/libs/fluidbook/fluidbook.cache.js',\r
+                              'js/libs/fluidbook/fluidbook.support.js',\r
+                              'js/libs/fluidbook/fluidbook.viewport.js',\r
+                              'js/libs/fluidbook/fluidbook.desktop.js',\r
+                              'js/libs/fluidbook/fluidbook.service.js',\r
+                              'js/libs/fluidbook/fluidbook.loader.js',\r
+                              'js/libs/fluidbook/fluidbook.l10n.js',\r
+                              'js/libs/fluidbook/fluidbook.nav.js',\r
+                              'js/libs/fluidbook/fluidbook.js',\r
+                              'js/main.js');\r
 \r
                $mintime = 0;\r
                $minimized = WS_COMPILE_ASSETS . '/_html5/js/min.js';\r
@@ -220,8 +220,8 @@ class wsPackagerHTML5 extends wsPackager {
                if ($reminimize) {\r
                        $js = '';\r
                        foreach ($files as $file) {\r
-                               $js.=file_get_contents(WS_COMPILE_ASSETS . '/_html5/' . $file);\r
-                               $js.="\n\n";\r
+                               $js .= file_get_contents(WS_COMPILE_ASSETS . '/_html5/' . $file);\r
+                               $js .= "\n\n";\r
                        }\r
                        $tmp = cubeFiles::tempnam();\r
                        file_put_contents($tmp, $js);\r
@@ -237,7 +237,7 @@ class wsPackagerHTML5 extends wsPackager {
                }\r
 \r
                $js = $this->writeConfig();\r
-               $js.=file_get_contents($minimized);\r
+               $js .= file_get_contents($minimized);\r
                file_put_contents($this->vdir . '/data/fluidbook.js', $js);\r
        }\r
 \r
@@ -258,7 +258,7 @@ class wsPackagerHTML5 extends wsPackager {
                                $fontforge = new cubeCommandLine('convert.pe');\r
                                $fontforge->setPath(CONVERTER_PATH);\r
                                foreach ($this->fontDocs[$font] as $document_id => $dummy) {\r
-                                       $fontforge->setArg(null, WS_DOCS . '/' . $document_id . '/fonts/web/' . $font . '.ttf');\r
+                                       $fontforge->setArg(null, wsDocument::getDir($document_id) . 'fonts/web/' . $font . '.ttf');\r
                                }\r
                                $fontforge->setArg(null, $this->vdir . '/data/style/F' . $index . '.' . $format);\r
                                $fontforge->execute();\r
@@ -277,8 +277,8 @@ 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, 'nav-facebook' => $couleurI, 'nav-twitter' => $couleurI,\r
-                       'help-fingers' => $couleurI, 'help-mouse' => $couleurI);\r
+                              'next' => $arrowsColor, 'previous' => $arrowsColor, 'search' => $couleurI, 'nav-facebook' => $couleurI, 'nav-twitter' => $couleurI,\r
+                              'help-fingers' => $couleurI, 'help-mouse' => $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
@@ -293,9 +293,9 @@ class wsPackagerHTML5 extends wsPackager {
                }\r
                foreach ($this->pages as $page => $infos) {\r
                        foreach (self::$resolutions as $r) {\r
-                               copy(WS_DOCS . '/' . $infos['document_id'] . '/html/h' . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/p' . $page . '.jpg');\r
+                               copy(wsDocument::getDir($infos['document_id']) . 'html/h' . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/p' . $page . '.jpg');\r
                        }\r
-                       copy(WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', $this->vdir . '/data/thumbnails/p' . $page . '.jpg');\r
+                       copy(wsDocument::getDir($infos['document_id']) . 'p' . $infos['document_page'] . '.jpg', $this->vdir . '/data/thumbnails/p' . $page . '.jpg');\r
                }\r
        }\r
 \r
@@ -310,7 +310,7 @@ class wsPackagerHTML5 extends wsPackager {
        protected function writeLine($line) {\r
                $res = '';\r
                foreach ($line['groups'] as $group) {\r
-                       $res.=$this->writeGroup($group, $line);\r
+                       $res .= $this->writeGroup($group, $line);\r
                }\r
                return $res;\r
        }\r
@@ -352,9 +352,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
@@ -391,9 +391,9 @@ 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
@@ -407,77 +407,77 @@ class wsPackagerHTML5 extends wsPackager {
                }\r
 \r
                $texts = '.texts{' . $this->writeCSSUA('transform-origin', 'top left') . ';';\r
-               $texts.=$this->writeCSSUA('transform', 'scale(' . round(1 / $this->multiply, 2) . ')') . ';';\r
-               $texts.='width:' . $wm . '; max-width:' . $wm . ';';\r
-               $texts.='height:' . $hm . '; max-height:' . $hm . ';';\r
-               $texts.='}';\r
+               $texts .= $this->writeCSSUA('transform', 'scale(' . round(1 / $this->multiply, 2) . ')') . ';';\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 = '#deviceView{';\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
@@ -488,9 +488,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
@@ -547,17 +547,17 @@ 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.='margin-top:' . round(cos(deg2rad($rotation)) * -1, 2) . 'em !important;';\r
-                       $css.='margin-left:' . round(sin(deg2rad($rotation)), 2) . 'em !important;';\r
-                       $css.='}';\r
+                       $css .= self::writeCSSUA('transform', 'rotate(' . $rotation . 'deg)') . ';';\r
+                       $css .= self::writeCSSUA('transform-origin', 'left top') . ';';\r
+                       $css .= 'margin-top:' . round(cos(deg2rad($rotation)) * -1, 2) . 'em !important;';\r
+                       $css .= 'margin-left:' . round(sin(deg2rad($rotation)), 2) . 'em !important;';\r
+                       $css .= '}';\r
                        $res[] = $css;\r
                }\r
 \r
@@ -608,15 +608,15 @@ class wsPackagerHTML5 extends wsPackager {
                $spans = array();\r
 \r
                foreach ($group->s as $span) {\r
-                       if ($first && trim((string) $span) == '') {\r
+                       if ($first && trim((string)$span) == '') {\r
                                continue;\r
                        }\r
                        if ($first) {\r
                                $pos = $x = $span['x'];\r
-                               $pos+=$span['width'];\r
+                               $pos += $span['width'];\r
                                $first = false;\r
                        } else {\r
-                               if ((float) $span['x'] < (float) $newSpan['x']) {\r
+                               if ((float)$span['x'] < (float)$newSpan['x']) {\r
                                        // On change de groupe\r
                                        $ls = $ws = 0;\r
                                        if ($letterCount > 0) {\r
@@ -629,7 +629,7 @@ class wsPackagerHTML5 extends wsPackager {
                                        $res[] = array(\r
                                                'color' => $this->getCSSColor($group['color']),\r
                                                'size' => $this->getCSSSize($group['size']),\r
-                                               'font' => $this->getCSSFont((string) $group['font'], $document_id),\r
+                                               'font' => $this->getCSSFont((string)$group['font'], $document_id),\r
                                                'letterspacing' => $this->getCSSLetterSpacing($ls),\r
                                                'wordspacing' => $this->getCSSLetterSpacing($ws),\r
                                                'y' => 0,\r
@@ -638,7 +638,7 @@ class wsPackagerHTML5 extends wsPackager {
 \r
                                        $spans = array();\r
                                        $pos = $x = $span['x'];\r
-                                       $pos+=$span['width'];\r
+                                       $pos += $span['width'];\r
                                } else {\r
 \r
                                        $diff = $span['x'] - $pos;\r
@@ -665,7 +665,7 @@ class wsPackagerHTML5 extends wsPackager {
 \r
                                                        $spans = array();\r
                                                        $pos = $x = $span['x'];\r
-                                                       $pos+=$span['width'];\r
+                                                       $pos += $span['width'];\r
                                                } else {\r
 \r
                                                        $newSpan = $this->addSpan('<span style="width:' . $space . 'em;"> </span>', true);\r
@@ -680,16 +680,16 @@ class wsPackagerHTML5 extends wsPackager {
                        $pos = $span['x'] + $span['width'];\r
 \r
                        array_push($spans, $newSpan);\r
-                       $copy = (string) $span;\r
+                       $copy = (string)$span;\r
                        $len = mb_strlen($copy);\r
                        str_replace(' ', '-', $copy, $w);\r
                        $l = $len - $w;\r
 \r
-                       $letterCount+=$l;\r
-                       $wordCount+=$w;\r
+                       $letterCount += $l;\r
+                       $wordCount += $w;\r
 \r
-                       $letterSpacing+=$l * (float) $span['letterspacing'];\r
-                       $wordSpacing+=$w * (float) $span['wordspacing'];\r
+                       $letterSpacing += $l * (float)$span['letterspacing'];\r
+                       $wordSpacing += $w * (float)$span['wordspacing'];\r
                }\r
 \r
                if (count($spans)) {\r
@@ -715,19 +715,19 @@ class wsPackagerHTML5 extends wsPackager {
                return $res;\r
        }\r
 \r
-       protected function addSpan($span, $space=false) {\r
-               $text = (string) $span;\r
+       protected function addSpan($span, $space = false) {\r
+               $text = (string)$span;\r
                return array('text' => $text, 'space' => $space, 'x' => $span['x']);\r
        }\r
 \r
        protected function getCSSSize($size) {\r
                $size = $this->normalizeFloatValue($size);\r
-               $size*=$this->multiply;\r
+               $size *= $this->multiply;\r
                return $this->getIndex($size, $this->cssSize);\r
        }\r
 \r
        protected function getCSSFont($font, $document_id) {\r
-               $font = (string) $font;\r
+               $font = (string)$font;\r
                if (!isset($this->fontDocs[$font])) {\r
                        $this->fontDocs[$font] = array();\r
                }\r
@@ -791,7 +791,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
@@ -800,9 +800,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
@@ -819,7 +819,7 @@ class wsPackagerHTML5 extends wsPackager {
                return $str;\r
        }\r
 \r
-       public function copyLinkFile($source, $dest, $video=false) {\r
+       public function copyLinkFile($source, $dest, $video = false) {\r
                // TODO delete that return;\r
                //return;\r
                $origDir = WS_BOOKS . '/working/' . $this->book_id . '/';\r
@@ -860,10 +860,10 @@ class wsPackagerHTML5 extends wsPackager {
        }\r
 \r
        public function __destruct() {\r
-               \r
+\r
        }\r
 \r
-       public static function colorToCSS($color, $forceAlpha=null) {\r
+       public static function colorToCSS($color, $forceAlpha = null) {\r
 \r
                if (!is_null($forceAlpha)) {\r
                        $a = $forceAlpha * 255;\r
@@ -888,7 +888,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