mkdir($this->vdir . '/style', 0777, true);\r
mkdir($this->vdir . '/contents', 0777, true);\r
mkdir($this->vdir . '/images', 0777, true);\r
+ mkdir($this->vdir . '/data/images', 0777, true);\r
\r
foreach ($this->div as $n => $page) {\r
file_put_contents($this->vdir . '/contents/p' . $n . '.html', $this->writePage($page));\r
}\r
$this->writeFonts();\r
$this->writeImages();\r
+ $this->writeTheme();\r
file_put_contents($this->vdir . '/style/style.css', $this->writeCSS());\r
\r
file_put_contents($this->vdir . '/data/datas.js', $this->writeConfig());\r
}\r
}\r
\r
+ protected function writeTheme() {\r
+ // Icons\r
+ }\r
+\r
protected function writeImages() {\r
\r
foreach (self::$resolutions as $r) {\r
protected function writeCSS() {\r
$res = array();\r
\r
- $h = $this->book->parametres->height . 'px';\r
+\r
+ // General theme\r
+ $h = $this->t->parametres->height . 'px';\r
$w2 = ($this->book->parametres->width * 2) . 'px';\r
$w = $this->book->parametres->width . 'px';\r
\r
$res[] = '.doublePage,#pages{width:' . $w2 . ';max-width:' . $w2 . ';height:' . $h . ';max-height:' . $h . '}';\r
$res[] = '.page.right{left:' . $w . '}';\r
\r
+ // Theme\r
+ // Background\r
+ $body = 'body{';\r
+ $body.='background-color:#' . $this->theme->parametres->backgroundColor . ';';\r
+ switch ($this->theme->parametres->repeat) {\r
+ case wsTheme::REPEAT:\r
+ $body.='background-repeat:repeat;';\r
+ break;\r
+ case wsTheme::NONE:\r
+ $body.='background-repeat:no-repeat;';\r
+ break;\r
+ case wsTheme::RATIO:\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
+ 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(../data/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
+ break;\r
+ case wsTheme::MIDDLE:\r
+ $body.='center';\r
+ break;\r
+ case wsTheme::BOTTOM:\r
+ $body.='bottom';\r
+ break;\r
+ }\r
+ $body.=' ';\r
+ switch ($this->theme->parametres->backgroundHAlign) {\r
+ case wsTheme::LEFT:\r
+ $body.='left';\r
+ break;\r
+ case wsTheme::CENTER:\r
+ $body.='center';\r
+ break;\r
+ case wsTheme::RIGHT:\r
+ $body.='right';\r
+ break;\r
+ }\r
+ $body.=';';\r
+ }\r
+\r
+ $body.='}';\r
+ $res[] = $body;\r
+\r
+ // Pages styles\r
foreach ($this->cssColor as $color => $index) {\r
$res[] = '.c' . $index . '{color:#' . $color . '}';\r
}\r