$pages = $this->getPagesOfBook($book_id);\r
}\r
\r
- public function compile($book_id, $version = 3)\r
+ public function compile($book_id, $version = 3, $complete = false)\r
{\r
if ($version == 3) {\r
- return $this->compile3($book_id);\r
+ return $this->compile3($book_id, $complete);\r
}\r
}\r
\r
- public function compile3($book_id)\r
+ /**\r
+ * wsDAOBook::compile3()\r
+ *\r
+ * @param mixed $book_id\r
+ * @param mixed $complete\r
+ * @return\r
+ */\r
+ public function compile3($book_id, $complete)\r
{\r
+ $res = '';\r
$book = $this->selectById($book_id);\r
$pages = $this->getPagesOfBook($book_id);\r
\r
$this->makeTextsIndexes($book_id, $index, $textes);\r
\r
$flex = new cubeFlexCompiler('FluidbookDatas', ROOT . '/books/datasCompiler/' . $book_id, 'flash.display.Sprite', explode(';', AS3_SOURCES), MXMLC_PATH);\r
+ $flexLight = new cubeFlexCompiler('FluidbookDatasLight', ROOT . '/books/datasCompiler/' . $book_id, 'flash.display.Sprite', explode(';', AS3_SOURCES), MXMLC_PATH);\r
$flex->addVariable('links', $book->links);\r
- $flex->addVariable('datas', $book->parametres->toStandardObject());\r
+ $flexLight->addVariable('datas', $book->parametres->toStandardObject());\r
$flex->addVariable('traductions', wsLang::getTraductionWithId($book->traductions));\r
$flex->addVariable('chapters', $book->chapters);\r
$flex->addVariable('extras', '<extras>' . $book->extras . '</extras>', false, true, 'XML');\r
$flex->addVariable('numerotation', $book->numerotation);\r
- $flex->addVariable('theme', $theme->parametres->toStandardObject());\r
- $flex->addVariable('pages', count($pages));\r
- $flex->addVariable('fwidth', $size[0], false, true, 'Number');\r
- $flex->addVariable('fheight', $size[1], false, true, 'Number');\r
+ $flexLight->addVariable('theme', $theme->parametres->toStandardObject());\r
+ $flexLight->addVariable('pages', count($pages));\r
+ $flexLight->addVariable('fwidth', $size[0], false, true, 'Number');\r
+ $flexLight->addVariable('fheight', $size[1], false, true, 'Number');\r
+ $flexLight->addVariable('pagesInDatas', $complete, false, true, 'Boolean');\r
$flex->addVariable('index', $index);\r
$flex->addVariable('textes', $textes);\r
foreach($pages as $i => $infos) {\r
- $flex->addBitmap(ROOT . '/docs/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', 'thumb' . $i);\r
+ if ($i == 1) {\r
+ $flexLight->addBitmap(ROOT . '/docs/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', 'thumb1');\r
+ } else {\r
+ $flex->addBitmap(ROOT . '/docs/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', 'thumb' . $i);\r
+ }\r
+ }\r
+\r
+ if ($complete) {\r
+ foreach($pages as $i => $infos) {\r
+ $flex->addSWF(ROOT . '/docs/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.swf', 'page' . $i);\r
+ }\r
}\r
// Theme assets\r
$themeRoot = ROOT . '/themes/' . $theme->theme_id . '/';\r
if ($theme->parametres->useBackgroundImage) {\r
- $flex->addBitmap($themeRoot . $theme->parametres->backgroundImage, 'background');\r
+ $flexLight->addBitmap($themeRoot . $theme->parametres->backgroundImage, 'background');\r
}\r
if ($theme->parametres->useMenuImage) {\r
$flex->addBitmap($themeRoot . $theme->parametres->menuImage, 'menu');\r
}\r
+ if ($theme->parametres->logoLoader != '') {\r
+ $flexLight->addBitmap($themeRoot . $theme->parametres->logoLoader, 'logoLoader');\r
+ }\r
$flex->addBitmap($themeRoot . $theme->parametres->logo, 'logo');\r
// Icons assets\r
$iconsRoot = ROOT . '/icones/' . $theme->parametres->iconSet . '/';\r
$flex->addBitmap($iconsRoot . 'nav-' . $file . '.png', 'nav_' . $file);\r
}\r
// Fonts\r
- $flex->addFont(FONT_PATH . '/FFFATLAN_0.TTF', 'Atlantis', 'ASCII');\r
- $flex->addFont(FONT_PATH . '/DIN Medium_0.ttf', 'DinMedium', 'Latin');\r
- return $flex->compile();\r
+ $flex->addFont(FONT_PATH . '/FFFATLAN_0.TTF', 'CreditsFont', 'ASCII');\r
+ $flex->addFont(FONT_PATH . '/DIN Medium_0.ttf', 'GeneralFont', 'Latin');\r
+ $flexLight->addFont(FONT_PATH . '/DIN Medium_0.ttf', 'GeneralFont', 'Numerals');\r
+ $res .= $flexLight->compile() . "\n\n-------------------\n\n";\r
+ $res .= $flex->compile();\r
+ //$flex->clean();\r
+ //$flexLight->clean();\r
+ return $res;\r
}\r
}\r
\r