From: vincent@cubedesigners.com Date: Wed, 1 Sep 2010 10:21:22 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8f0ebe5676e0228c07747f68506337d316d7486f;p=cubeextranet.git --- diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index f7a587202..f436f159b 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -128,7 +128,7 @@ html{height:100%}' . "\n"; $dao = new wsDAOBook($core->con); header('Content-type: text/plain'); ob_clean(); - echo $dao->compile(2963, 3); + echo $dao->compile(2963, 3,false); exit; } diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 739f33f57..34eedd7be 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -442,15 +442,23 @@ class wsDAOBook extends extranetDAO { $pages = $this->getPagesOfBook($book_id); } - public function compile($book_id, $version = 3) + public function compile($book_id, $version = 3, $complete = false) { if ($version == 3) { - return $this->compile3($book_id); + return $this->compile3($book_id, $complete); } } - public function compile3($book_id) + /** + * wsDAOBook::compile3() + * + * @param mixed $book_id + * @param mixed $complete + * @return + */ + public function compile3($book_id, $complete) { + $res = ''; $book = $this->selectById($book_id); $pages = $this->getPagesOfBook($book_id); @@ -464,29 +472,44 @@ class wsDAOBook extends extranetDAO { $this->makeTextsIndexes($book_id, $index, $textes); $flex = new cubeFlexCompiler('FluidbookDatas', ROOT . '/books/datasCompiler/' . $book_id, 'flash.display.Sprite', explode(';', AS3_SOURCES), MXMLC_PATH); + $flexLight = new cubeFlexCompiler('FluidbookDatasLight', ROOT . '/books/datasCompiler/' . $book_id, 'flash.display.Sprite', explode(';', AS3_SOURCES), MXMLC_PATH); $flex->addVariable('links', $book->links); - $flex->addVariable('datas', $book->parametres->toStandardObject()); + $flexLight->addVariable('datas', $book->parametres->toStandardObject()); $flex->addVariable('traductions', wsLang::getTraductionWithId($book->traductions)); $flex->addVariable('chapters', $book->chapters); $flex->addVariable('extras', '' . $book->extras . '', false, true, 'XML'); $flex->addVariable('numerotation', $book->numerotation); - $flex->addVariable('theme', $theme->parametres->toStandardObject()); - $flex->addVariable('pages', count($pages)); - $flex->addVariable('fwidth', $size[0], false, true, 'Number'); - $flex->addVariable('fheight', $size[1], false, true, 'Number'); + $flexLight->addVariable('theme', $theme->parametres->toStandardObject()); + $flexLight->addVariable('pages', count($pages)); + $flexLight->addVariable('fwidth', $size[0], false, true, 'Number'); + $flexLight->addVariable('fheight', $size[1], false, true, 'Number'); + $flexLight->addVariable('pagesInDatas', $complete, false, true, 'Boolean'); $flex->addVariable('index', $index); $flex->addVariable('textes', $textes); foreach($pages as $i => $infos) { - $flex->addBitmap(ROOT . '/docs/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', 'thumb' . $i); + if ($i == 1) { + $flexLight->addBitmap(ROOT . '/docs/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', 'thumb1'); + } else { + $flex->addBitmap(ROOT . '/docs/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', 'thumb' . $i); + } + } + + if ($complete) { + foreach($pages as $i => $infos) { + $flex->addSWF(ROOT . '/docs/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.swf', 'page' . $i); + } } // Theme assets $themeRoot = ROOT . '/themes/' . $theme->theme_id . '/'; if ($theme->parametres->useBackgroundImage) { - $flex->addBitmap($themeRoot . $theme->parametres->backgroundImage, 'background'); + $flexLight->addBitmap($themeRoot . $theme->parametres->backgroundImage, 'background'); } if ($theme->parametres->useMenuImage) { $flex->addBitmap($themeRoot . $theme->parametres->menuImage, 'menu'); } + if ($theme->parametres->logoLoader != '') { + $flexLight->addBitmap($themeRoot . $theme->parametres->logoLoader, 'logoLoader'); + } $flex->addBitmap($themeRoot . $theme->parametres->logo, 'logo'); // Icons assets $iconsRoot = ROOT . '/icones/' . $theme->parametres->iconSet . '/'; @@ -494,9 +517,14 @@ class wsDAOBook extends extranetDAO { $flex->addBitmap($iconsRoot . 'nav-' . $file . '.png', 'nav_' . $file); } // Fonts - $flex->addFont(FONT_PATH . '/FFFATLAN_0.TTF', 'Atlantis', 'ASCII'); - $flex->addFont(FONT_PATH . '/DIN Medium_0.ttf', 'DinMedium', 'Latin'); - return $flex->compile(); + $flex->addFont(FONT_PATH . '/FFFATLAN_0.TTF', 'CreditsFont', 'ASCII'); + $flex->addFont(FONT_PATH . '/DIN Medium_0.ttf', 'GeneralFont', 'Latin'); + $flexLight->addFont(FONT_PATH . '/DIN Medium_0.ttf', 'GeneralFont', 'Numerals'); + $res .= $flexLight->compile() . "\n\n-------------------\n\n"; + $res .= $flex->compile(); + //$flex->clean(); + //$flexLight->clean(); + return $res; } } diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index eae44393a..946e2c804 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -645,7 +645,7 @@ disablelinks Disable links. $pdf2swf->setArg('stop'); // $pdf2swf->setManualArg('-v'); - $pdf2swf->setArg('T', 8); + $pdf2swf->setArg('T', 9); if ($storeAllChars) { $pdf2swf->setArg('fonts'); } @@ -671,7 +671,7 @@ disablelinks Disable links. protected function makeAS3($page) { - $swffile = $this->out . 'p' . $page . '.swf'; + /*$swffile = $this->out . 'p' . $page . '.swf'; $swfcombine = new cubeCommandLine('swfcombine'); $swfcombine->setPath(CONVERTER_PATH); @@ -683,7 +683,7 @@ disablelinks Disable links. $swfcombine->setArg(null, ROOT . '/swf/as3Container.swf'); $swfcombine->setManualArg('content=' . $swffile); $swfcombine->execute(); - $this->addToLog($swfcombine); + $this->addToLog($swfcombine);*/ } protected function pdf2swfBarbare($page, $resolution = 150, $quality = 85, $method = 4)