]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 30 Jan 2012 10:08:47 +0000 (10:08 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 30 Jan 2012 10:08:47 +0000 (10:08 +0000)
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/packager/class.ws.packager.html.php
inc/ws/Util/packager/class.ws.packager.v1.php

index 96a073ff29d5cf2d63955b6353a12415bb3d1f50..4582b15c55fc6c0d396a8267dfb8686c02eb92e5 100644 (file)
@@ -229,10 +229,10 @@ class wsUrl {
 \r
                if (wsDroits::admin()) {\r
                        $viewers = array('viewer' => array('title' => __('Version Flash'), 'icon' => cubeMedia::image(IMG . '/flash.png')),\r
-                       'viewerh' => array('title' => __('Version HTML5'), 'icon' => cubeMedia::image(IMG . '/html5.png')),\r
-                       'vieweru' => array('title' => __('Version Flash') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/flashbug.png')),\r
-                       'viewerhu' => array('title' => __('Version HTML5') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/html5bug.png')),\r
-                       'viewer1' => array('title' => __('Version 1'), 'icon' => cubeMedia::image(IMG . '/flash.png'))\r
+                               'viewerh' => array('title' => __('Version HTML5'), 'icon' => cubeMedia::image(IMG . '/html5.png')),\r
+                               'vieweru' => array('title' => __('Version Flash') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/flashbug.png')),\r
+                               'viewerhu' => array('title' => __('Version HTML5') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/html5bug.png')),\r
+                               'viewer1' => array('title' => __('Version 1'), 'icon' => cubeMedia::image(IMG . '/flash.png'))\r
                        );\r
                }\r
 \r
@@ -698,6 +698,9 @@ html{height:100%}' . "\n";
                $wmode = isset($args[1]) ? $args[1] : '';\r
 \r
                $e = explode('_', $args[0]);\r
+\r
+\r
+\r
                $newurl = null;\r
                if (count($e) == 2 || $e[2] < TIME - 10) {\r
                        $e[2] = TIME;\r
index 29493c3ab04c5ec05ee2985dd3b0f1b1f7a0024c..f1afa2e36b9afcf1fdcf24b4cc4e68dc083c57d4 100644 (file)
@@ -549,6 +549,10 @@ class wsDAOBook extends commonDAO {
                if ($r->compiledate < $r->changedate) {\r
                        return false;\r
                }\r
+               \r
+               if(!file_exists(WS_BOOKS.'/finalv1/'.$book_id.'/index.swf')){\r
+                       return false;\r
+               }\r
 \r
                $checks = array($r->changedate, cubeFiles::filemtimeRecursive(WS_COMPILE_ASSETS . '/_html5'), cubeFiles::filemtimeRecursive(ROOT . '/inc/ws/Util/html5'));\r
                $reffile = WS_BOOKS . '/html5/' . $book_id;\r
@@ -698,7 +702,6 @@ class wsDAOBook extends commonDAO {
        }\r
 \r
        public function compile($book_id, $version = 3, $complete = false) {\r
-\r
                $this->compile3($book_id, $complete);\r
                $this->compile1($book_id);\r
 \r
@@ -711,8 +714,6 @@ class wsDAOBook extends commonDAO {
                $packager->makePackage(false);\r
                \r
                mkdir($finalDir,0777,true);\r
-               \r
-               fb('compile1');\r
        }\r
 \r
        public function compile3($book_id, $complete) {\r
index c4623b4ca46d5545b1c024c7f594af546ddc3fc8..865956c220ea58789fc2d247b88e22ec882040a2 100644 (file)
@@ -59,7 +59,6 @@ class wsPackagerHTML extends wsPackager {
 \r
                $favicon = '';\r
 \r
-               fb($this->theme->parametres->favicon);\r
                if ($this->theme->parametres->favicon != '') {\r
                        $favicon = '<link rel="shortcut icon" href="data/fluidbook.ico" />';\r
                }\r
index 4f0d7c839e6d013be0ece54c4c40c27a5b5764d2..1438a322cd6eb7ba8272e58627bd9a4fbd184522 100644 (file)
@@ -2,9 +2,15 @@
 
 class wsPackagerV1 extends wsPackagerHTML {
 
-       public function __construct($book_id,$vdir,$whole) {
-               parent::__construct($book_id,$vdir,$whole);
+       protected $size;
+
+       public function __construct($book_id, $vdir, $whole) {
+               parent::__construct($book_id, $vdir, $whole);
                $this->version = 'v1';
+
+               $daoDoc = new wsDAODocument($core->con);
+               $firstDoc = $daoDoc->selectById($this->pages[1]['document_id']);
+               $this->size = $firstDoc->generalInfos['size'];
        }
 
        protected function getMinFlashVersion() {
@@ -71,7 +77,7 @@ class wsPackagerV1 extends wsPackagerHTML {
 
                        if ($link['page'] % 2 == 1) {
                                $link['page']--;
-                               $link['left']-=$this->book->parametres['width'];
+                               $link['left'] = $link['left'] + $this->size[0];
                        }
 
                        if ($link['type'] > 6) {
@@ -97,16 +103,6 @@ class wsPackagerV1 extends wsPackagerHTML {
                        $this->_copyWorkingFile($link['to']);
                }
 
-               // Chapters
-               /*
-                *   <chapters>
-                 <page>3</page>
-                 <level>0</level>
-                 <txt>c</txt>
-                 </chapters>
-                * 
-                */
-
                foreach ($this->book->chapters as $c) {
                        $chap = $xml->addChild('chapters');
                        $chap->addChild('page', $this->__virtualToPhysical($c['page']));
@@ -158,8 +154,8 @@ class wsPackagerV1 extends wsPackagerHTML {
                $firstDoc = $daoDoc->selectById($this->pages[1]['document_id']);
                $size = $firstDoc->generalInfos['size'];
 
-               $allParams['width'] = round($size[0], 2);
-               $allParams['height'] = round($size[1], 2);
+               $allParams['width'] = round($this->size[0], 2);
+               $allParams['height'] = round($this->size[1], 2);
 
 
                $daoSignature = new wsDAOSignature($core->con);
@@ -171,7 +167,7 @@ class wsPackagerV1 extends wsPackagerHTML {
 
 
                $allParams = array_merge($allParams, $signature);
-               $allParams['firstPageNr'] = $this->__virtualToPhysical('1');
+               $allParams['firstPageNr'] = $this->__virtualToPhysical('1') - 1;
 
                foreach ($allParams as $k => $v) {
                        if ((stristr($k, 'color') || stristr($k, 'couleur')) && strlen($v) == 8) {
@@ -249,7 +245,7 @@ class wsPackagerV1 extends wsPackagerHTML {
                $n = explode(',', $this->book->numerotation);
                $keys = array_keys($n, $page);
                if (count($keys)) {
-                       return $keys[0]+1;
+                       return $keys[0] + 1;
                }
                return $default;
        }