$versions['mac-exe'] = array('title' => __('Version offline') . ' - ' . __('Exécutable Mac OS X'), 'icon' => cubeMedia::image(IMG . '/macos.png'));\r
$versions['win-cd'] = array('title' => __('Version offline') . ' - ' . __('CD-ROM') . ' / ' . __('Clé USB'), 'icon' => cubeMedia::silk('cd.png'));\r
if (wsDroits::admin()) {\r
- $versions['html5'] = array('title' => __('Version HTML5 (α)'), 'icon' => cubeMedia::silk('page_white_world.png'));\r
+ $versions['html5'] = array('title' => __('Version HTML5 (α)'), 'icon' => cubeMedia::image(IMG . '/html5.png'));\r
}\r
\r
$res = '<div class="contextMenu downbookContextMenu" id="' . $id . '">';\r
protected $scale;\r
protected $multiply;\r
protected $div = array();\r
+ protected $numerotation;\r
protected static $resolutions = array(36, 72, 150);\r
protected static $uaPrefixes = array('-moz-', '-webkit-', '-o-', '-ms-', '');\r
\r
$this->pdf2htmlRatio = $imagesize[0] / $this->layouts[1]['width'];\r
$this->scale = 4;\r
$this->multiply = $this->pdf2htmlRatio * $this->scale;\r
+ $this->numerotation = explode(',', $this->book->numerotation);\r
\r
$this->createHTML();\r
}\r
return $this->zip();\r
}\r
\r
+ public function virtualToPhysical($virtual) {\r
+ if (!in_array($virtual, $this->numerotation)) {\r
+ return 1;\r
+ }\r
+ $p = array_search($virtual, $this->numerotation);\r
+ return $p + 1;\r
+ }\r
+\r
protected function createHTML() {\r
foreach ($this->layouts as $page => $layout) {\r
$this->div[$page] = array();\r
mkdir($this->vdir . '/data/thumbnails', 0777, true);\r
mkdir($this->vdir . '/data/style', 0777, true);\r
mkdir($this->vdir . '/data/links/pages', 0777, true);\r
+ mkdir($this->vdir . '/data/l10n/', 0777, true);\r
\r
foreach ($this->div as $n => $page) {\r
file_put_contents($this->vdir . '/data/contents/p' . $n . '.html', $this->writePage($page));\r
$this->writeImages();\r
$linksCSS = $this->writeLinks();\r
$this->writeCSS($this->vdir . '/data/style/style_%d.css', $linksCSS);\r
+ $this->writeLangs();\r
\r
file_put_contents($this->vdir . '/data/datas.js', $this->writeConfig());\r
}\r
\r
+ protected function writeLangs() {\r
+ global $core;\r
+ $daoLang = new wsDAOLang($core->con);\r
+ $lang = $daoLang->selectById($this->book->lang);\r
+ $langs = $daoLang->selectAll();\r
+\r
+\r
+ $traductions = (!count($this->book->traductions)) ? $lang->traductions : $this->book->traductions;\r
+ file_put_contents($this->vdir . '/data/l10n/default.json', json_encode($traductions));\r
+ foreach ($langs as $lang) {\r
+ file_put_contents($this->vdir . '/data/l10n/' . $lang->lang_id . '.json', json_encode($lang->traductions));\r
+ }\r
+ }\r
+\r
protected function writeLinks() {\r
global $core;\r
$daoDoc = new wsDAODocument($core->con);\r
\r
protected function writeConfig() {\r
$config = cubeObject::merge($this->book->parametres->toStandardObject(), $this->theme->parametres->toStandardObject());\r
+ $config->numerotation = explode(',', $this->book->numerotation);\r
$config->id = $this->book->book_id;\r
$config->cacheDate = TIME;\r
return 'DATAS=' . json_encode($config) . ';';\r