\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
$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
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
}\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
$packager->makePackage(false);\r
\r
mkdir($finalDir,0777,true);\r
- \r
- fb('compile1');\r
}\r
\r
public function compile3($book_id, $complete) {\r
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() {
if ($link['page'] % 2 == 1) {
$link['page']--;
- $link['left']-=$this->book->parametres['width'];
+ $link['left'] = $link['left'] + $this->size[0];
}
if ($link['type'] > 6) {
$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']));
$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);
$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) {
$n = explode(',', $this->book->numerotation);
$keys = array_keys($n, $page);
if (count($keys)) {
- return $keys[0]+1;
+ return $keys[0] + 1;
}
return $default;
}