From: vincent@cubedesigners.com Date: Mon, 30 Jan 2012 10:08:47 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9e8a17be59ebefc19e4f315ef3a4192d0a9be36e;p=cubeextranet.git --- diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 96a073ff2..4582b15c5 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -229,10 +229,10 @@ class wsUrl { if (wsDroits::admin()) { $viewers = array('viewer' => array('title' => __('Version Flash'), 'icon' => cubeMedia::image(IMG . '/flash.png')), - 'viewerh' => array('title' => __('Version HTML5'), 'icon' => cubeMedia::image(IMG . '/html5.png')), - 'vieweru' => array('title' => __('Version Flash') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/flashbug.png')), - 'viewerhu' => array('title' => __('Version HTML5') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/html5bug.png')), - 'viewer1' => array('title' => __('Version 1'), 'icon' => cubeMedia::image(IMG . '/flash.png')) + 'viewerh' => array('title' => __('Version HTML5'), 'icon' => cubeMedia::image(IMG . '/html5.png')), + 'vieweru' => array('title' => __('Version Flash') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/flashbug.png')), + 'viewerhu' => array('title' => __('Version HTML5') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/html5bug.png')), + 'viewer1' => array('title' => __('Version 1'), 'icon' => cubeMedia::image(IMG . '/flash.png')) ); } @@ -698,6 +698,9 @@ html{height:100%}' . "\n"; $wmode = isset($args[1]) ? $args[1] : ''; $e = explode('_', $args[0]); + + + $newurl = null; if (count($e) == 2 || $e[2] < TIME - 10) { $e[2] = TIME; diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 29493c3ab..f1afa2e36 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -549,6 +549,10 @@ class wsDAOBook extends commonDAO { if ($r->compiledate < $r->changedate) { return false; } + + if(!file_exists(WS_BOOKS.'/finalv1/'.$book_id.'/index.swf')){ + return false; + } $checks = array($r->changedate, cubeFiles::filemtimeRecursive(WS_COMPILE_ASSETS . '/_html5'), cubeFiles::filemtimeRecursive(ROOT . '/inc/ws/Util/html5')); $reffile = WS_BOOKS . '/html5/' . $book_id; @@ -698,7 +702,6 @@ class wsDAOBook extends commonDAO { } public function compile($book_id, $version = 3, $complete = false) { - $this->compile3($book_id, $complete); $this->compile1($book_id); @@ -711,8 +714,6 @@ class wsDAOBook extends commonDAO { $packager->makePackage(false); mkdir($finalDir,0777,true); - - fb('compile1'); } public function compile3($book_id, $complete) { diff --git a/inc/ws/Util/packager/class.ws.packager.html.php b/inc/ws/Util/packager/class.ws.packager.html.php index c4623b4ca..865956c22 100644 --- a/inc/ws/Util/packager/class.ws.packager.html.php +++ b/inc/ws/Util/packager/class.ws.packager.html.php @@ -59,7 +59,6 @@ class wsPackagerHTML extends wsPackager { $favicon = ''; - fb($this->theme->parametres->favicon); if ($this->theme->parametres->favicon != '') { $favicon = ''; } diff --git a/inc/ws/Util/packager/class.ws.packager.v1.php b/inc/ws/Util/packager/class.ws.packager.v1.php index 4f0d7c839..1438a322c 100644 --- a/inc/ws/Util/packager/class.ws.packager.v1.php +++ b/inc/ws/Util/packager/class.ws.packager.v1.php @@ -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 - /* - * - 3 - 0 - c - - * - */ - 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; }