}
}
- public function compile($book_id, $version = 'all', $complete = false, $force = false, $dev = false)
+ public function compile($book_id, $version = 'all', $complete = false, $force = false, $dev = false, $book = null)
{
if (is_null($book_id) || !$book_id) {
return;
$html5 = true;
}
- $book = $this->selectById($book_id);
+ if (null === $book) {
+ $book = $this->selectById($book_id);
+ }
$pages = $this->getPagesOfBook($book_id);
if (!$force) {
$version = 'dev';
}
- $htmlCompiler = wsHTML5::compilerFactory($book_id, $version);
+ $htmlCompiler = wsHTML5::compilerFactory($book_id, $version, false, 'latest', null, false, false, false, $book);
$htmlCompiler->compile();
}
{\r
protected static $uaPrefixes = array('-moz-', '-webkit-', '-o-', '-ms-', '');\r
\r
- public static function compilerFactory($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false)\r
+ public static function compilerFactory($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false, $book = null)\r
{\r
if (is_null($version)) {\r
global $core;\r
}\r
}\r
\r
- return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home);\r
+ return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home, $book);\r
}\r
\r
public static function getPhonegapVersion($v = 'latest')\r
public $seo = null;
- function __construct($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false)
+ function __construct($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false, $book = null)
{
global $core;
$this->phonegap = $phonegap;
$this->standalone = $standalone || $this->phonegap;
$this->appcache = $appcache;
- $this->widget = !$this->phonegap;
cubePHP::set_memory('4G');
$this->wdir = WS_BOOKS . '/working/' . $this->book_id . '/';
$this->daoBook = new wsDAOBook($core->con);
- $this->book = $this->daoBook->selectById($book_id);
+ if (null === $book) {
+ $this->book = $this->daoBook->selectById($book_id);
+ } else {
+ $this->book = $book;
+ }
+
+ $this->widget = !$this->phonegap && $this->book->parametres->widget;
+
$this->pages = $this->daoBook->getPagesOfBook($book_id);
$this->maxRes = min(300, $this->book->parametres->maxResolution);
-
$daoTheme = new wsDAOTheme($core->con);
$this->theme = $daoTheme->getThemeOfBook($book_id, true);
$this->themeRoot = WS_THEMES . '/' . $this->theme->theme_id . '/';
{
global $core;
+
switch ($this->book->parametres->mobileVersion) {
case 'html5-desktop':
$this->backgroundsPrefix = array('t', 'p');
}
}
-
foreach ($this->getResolutions() as $r) {
foreach ($this->backgroundsPrefix as $backgroundsPrefix) {
$srcPrefix = $backgroundsPrefix;
public function __construct($book_id) {\r
parent::__construct($book_id);\r
$this->version = 'mac-exe-html';\r
- $this->book->parametres->alwaysHTML5 = true;\r
-\r
- $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 30));\r
}\r
\r
public function makePackage($zip) {\r
\r
}\r
\r
-}\r
-\r
-?>
\ No newline at end of file
+}
\ No newline at end of file
{\r
parent::__construct($book_id, null, true, true);\r
$this->version = 'win-exe-html';\r
- $this->book->parametres->alwaysHTML5 = true;\r
$this->appName = '';\r
$this->appversion = '1.0.' . time();\r
$this->_clean = false;\r
\r
protected function compile()\r
{\r
- $this->daoBook->compile($this->book_id, 'html5', false, $this->book->parametres->forceCompileOnDownload);\r
+ // For exe version, force to export only the html5 version\r
+ $this->book->parametres->alwaysHTML5 = true;\r
+ // No need to export pages with texts for this version, we are certain that svg is supported if enabled\r
+ if ($this->book->parametres->mobileVersion == 'html5-desktop') {\r
+ $this->book->parametres->mobileVersion = 'html5';\r
+ }\r
+ // No need to have the widget\r
+ $this->book->parametres->widget = false;\r
+\r
+ $this->daoBook->compile($this->book_id, 'html5', false, $this->book->parametres->forceCompileOnDownload, false, $this->book);\r
}\r
\r
protected function copyFluidbookFiles()\r