From 239aaa787f3e4b5daf069a4919dc7c0441af18ef Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 27 Dec 2011 16:05:25 +0000 Subject: [PATCH] --- fluidbook/compile/index.html | 1 + fluidbook/compile/script.nsi | 2 +- .../fwstk/nbproject/private/config.properties | 2 +- .../private/configs/Extract_texts.properties | 2 +- .../tools/fwstk/nbproject/private/private.xml | 3 -- .../tools/fwstk/src/cube/util/Array.java | 2 +- inc/ws/Controlleur/class.ws.flash.php | 33 ++++++++++++++++--- inc/ws/DAO/class.ws.dao.book.php | 9 +++-- inc/ws/Metier/class.ws.theme.parametres.php | 21 +++++++++--- .../Util/packager/class.ws.packager.html.php | 15 +++++++-- inc/ws/Util/packager/class.ws.packager.php | 6 ++-- .../packager/class.ws.packager.win.inst.php | 10 ++++-- 12 files changed, 77 insertions(+), 29 deletions(-) diff --git a/fluidbook/compile/index.html b/fluidbook/compile/index.html index 210f8a3e0..8a576bacc 100644 --- a/fluidbook/compile/index.html +++ b/fluidbook/compile/index.html @@ -7,6 +7,7 @@ +$favicon $robots $facebook $title diff --git a/fluidbook/compile/script.nsi b/fluidbook/compile/script.nsi index a3b1835fc..ad0a7caec 100644 --- a/fluidbook/compile/script.nsi +++ b/fluidbook/compile/script.nsi @@ -17,7 +17,7 @@ RequestExecutionLevel user ; Style XPStyle on -Icon "$htmldir/fluidbook.ico" +Icon "$favicon" ; not released ;TargetMinimalOS 5.0 diff --git a/fluidbook/tools/fwstk/nbproject/private/config.properties b/fluidbook/tools/fwstk/nbproject/private/config.properties index 5aa2fea7b..9d6df0f95 100644 --- a/fluidbook/tools/fwstk/nbproject/private/config.properties +++ b/fluidbook/tools/fwstk/nbproject/private/config.properties @@ -1 +1 @@ -config=Extract_Links +config=Extract_texts diff --git a/fluidbook/tools/fwstk/nbproject/private/configs/Extract_texts.properties b/fluidbook/tools/fwstk/nbproject/private/configs/Extract_texts.properties index 97e5bd462..1d3c1d34e 100644 --- a/fluidbook/tools/fwstk/nbproject/private/configs/Extract_texts.properties +++ b/fluidbook/tools/fwstk/nbproject/private/configs/Extract_texts.properties @@ -1 +1 @@ -application.args=--input H:\\Documents\\fwstk\\layout\\document.pdf --extractTexts H:\\Documents\\fwstk\\layout\\p%d.txt +application.args=--input H:\\Documents\\fwstk\\texts\\document.pdf --extractTexts H:\\Documents\\fwstk\\texts\\%s%d.txt diff --git a/fluidbook/tools/fwstk/nbproject/private/private.xml b/fluidbook/tools/fwstk/nbproject/private/private.xml index 1ee292a27..cc2c0e57c 100644 --- a/fluidbook/tools/fwstk/nbproject/private/private.xml +++ b/fluidbook/tools/fwstk/nbproject/private/private.xml @@ -1,7 +1,4 @@ - - file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/com/fluidbook/fwstk/Main.java - diff --git a/fluidbook/tools/fwstk/src/cube/util/Array.java b/fluidbook/tools/fwstk/src/cube/util/Array.java index 7f076e572..93ac35330 100644 --- a/fluidbook/tools/fwstk/src/cube/util/Array.java +++ b/fluidbook/tools/fwstk/src/cube/util/Array.java @@ -18,7 +18,7 @@ public class Array { } if (e.length == 1) { res.put(e0, true); - } else if (e0 > e1) { + } else if (e0 >= e1) { for (int j = e1; j <= e0; j++) { res.put(j, true); } diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index 650239b3d..592ce51c0 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -1,6 +1,7 @@ args['theme_id'] . '/' . $fname; + $dir = WS_THEMES . '/' . $this->args['theme_id'] . '/'; + $dest = $dir . $fname; + if (!file_exists(WS_THEMES . '/' . $this->args['theme_id'])) { mkdir(WS_THEMES . '/' . $this->args['theme_id'], 0755, true); } - move_uploaded_file($infos['tmp_name'], WS_THEMES . $dest); + move_uploaded_file($infos['tmp_name'], $dest); + + if (isset($this->args['type']) && $this->args['type'] == 'ico') { + $icotool = new cubeCommandLine('icotool'); + $icotool->setArg('c'); + $icotool->setArg('o', $dir . '/fluidbook.ico'); + + $sizes = array(256, 128, 64, 32, 16); + + foreach ($sizes as $s) { + $r = $dir . '/ico-' . $s . '.png'; + $it = new cubeImageTools(); + $it->loadImage($dest); + $it->resize($s, $s, 'crop', true,'C','M','transparent'); + $it->output('png', $r); + $icotool->setArg(null, $r); + } + + $icotool->execute(); + } + $this->xml->addChild('file', $fname); return; } @@ -259,7 +282,7 @@ class wsFlash extends cubeFlashGateway { $info['method'] = 1; $info['objects'] = 1800; $info['quality'] = 85; - $info['version']='stable'; + $info['version'] = 'stable'; } else { $dim = getimagesize($file); } @@ -438,9 +461,9 @@ class wsFlash extends cubeFlashGateway { public function getLinks() { global $core; - + set_time_limit(0); - + $dao = new wsDAOBook($core->con); $book = $dao->selectById($this->args['book_id']); diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 0d77dd91f..009d34e34 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -708,6 +708,7 @@ class wsDAOBook extends commonDAO { $filesToCopy['data/fd.swf'] = $compilerDir . '/FluidbookDatas.swf'; $filesToCopy['data/fdl.swf'] = $compilerDir . '/FluidbookDatasLight.swf'; + // Copy of files // Check if dest dir exists if (!file_exists($finalDir . 'data')) { @@ -944,6 +945,9 @@ class wsDAOBook extends commonDAO { if ($theme->parametres->afterSearch != '') { $flex->addBitmap($themeRoot . $theme->parametres->afterSearch, 'aftersearch'); } + if ($theme->parametres->favicon != '') { + $filesToCopy['data/fluidbook.ico'] = $themeRoot . 'fluidbook.ico'; + } // Icons assets $iconsRoot = WS_ICONS . '/' . $theme->parametres->iconSet . '/'; @@ -1048,8 +1052,6 @@ class wsDAOBook extends commonDAO { $swfcombine->setArg(null, $tempswf[$i]); } $swfcombine->execute(); - fb($swfcombine->commande); - fb($swfcombine->output); foreach ($tempimage as $t) { unlink($t); @@ -1143,11 +1145,8 @@ class wsDAOBook extends commonDAO { if ($original) { copy(WS_DOCS . '/' . $firstDoc . '/crop.pdf', $finalPDF); - fb('Original'); return; } - fb('Composite'); - exit; $args = ''; foreach ($pdfList as $doc => $index) { diff --git a/inc/ws/Metier/class.ws.theme.parametres.php b/inc/ws/Metier/class.ws.theme.parametres.php index 31072046e..d7d905969 100644 --- a/inc/ws/Metier/class.ws.theme.parametres.php +++ b/inc/ws/Metier/class.ws.theme.parametres.php @@ -57,7 +57,7 @@ class wsThemeParametres extends wsParametres { 'grade' => 5); $this->forms['search'] = array('label' => __('Personnalisation de la recherche'), - 'fieldsnames' => array('couleurS', 'searchFieldColor', 'searchShadeAlpha', 'searchFieldWidth', '|', 'highlightColor','|','searchIndexNoResultColor')); + 'fieldsnames' => array('couleurS', 'searchFieldColor', 'searchShadeAlpha', 'searchFieldWidth', '|', 'highlightColor', '|', 'searchIndexNoResultColor')); /* Icones */ $this->fields['iconSet'] = array('type' => 'icones', 'default' => 1, 'editable' => true, 'label' => __("Jeu d'icônes")); @@ -95,10 +95,12 @@ class wsThemeParametres extends wsParametres { 'label' => __('Overlay placé sous les vidéos en popup')); $this->fields['pageEdgeColor'] = array('type' => 'couleur', 'default' => 'dddddd', 'editable' => true, 'label' => __('Couleur de la bordure')); + $this->fields['pageEdgeThickness'] = array('type' => 'integer', 'default' => 100, 'editable' => true, + 'label' => __('Epaisseur de la bordure')); $this->forms['book'] = array('label' => __('Personnalisation du fluidbook'), 'fieldsnames' => array('pageReflection', 'shadeAlpha', - '|', 'usePageEdges', 'pageEdgeColor', + '|', 'usePageEdges', 'pageEdgeColor', 'pageEdgeThickness', '|', 'bookShadeColor', '|', 'displayPageNumber', 'colorPageNumber', '|', 'linksColor', 'videoBackgroundColor', 'popupVideoOverlay')); @@ -171,13 +173,24 @@ class wsThemeParametres extends wsParametres { $this->forms['menubar'] = array('label' => __('Personnalisation de la barre de menu'), 'fieldsnames' => array('menuHeight', '|', 'menuColor', '|', 'menuImage', '|', 'shadeOnMenu', '|', 'invertMenuPosition', '|', 'topBar', 'topBarAlign', '|', 'afterSearch')); /* Menu bar logo */ + + $imageFilter = new stdClass(); + $imageFilter->name = __('Image PNG') . ' (*.png)'; + $imageFilter->extensions = '*.png'; + $this->fields['logo'] = array('type' => 'file', 'default' => 'menu_clientLogo.png', 'editable' => true, - 'label' => __('Image'), + 'label' => __('Logo'), 'path' => $themeRoot, 'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id); + $this->fields['favicon'] = array('type' => 'file', 'default' => '', 'editable' => true, + 'label' => __('Icone (pour favicon et CD-ROM)'), + 'path' => $themeRoot, + 'fileFilter' => $imageFilter, + 'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&type=ico', + 'hint' => __('Image PNG de 256x256')); $this->forms['logo'] = array('label' => __('Personnalisation du logo'), - 'fieldsnames' => array('logo')); + 'fieldsnames' => array('logo', 'favicon')); /* Loader */ $this->fields['logoLoader'] = array('type' => 'file', 'default' => 'logoLoader.png', 'editable' => true, 'label' => __('Logo affiché au chargement'), diff --git a/inc/ws/Util/packager/class.ws.packager.html.php b/inc/ws/Util/packager/class.ws.packager.html.php index 475cbe134..7243acf4e 100644 --- a/inc/ws/Util/packager/class.ws.packager.html.php +++ b/inc/ws/Util/packager/class.ws.packager.html.php @@ -46,6 +46,13 @@ class wsPackagerHTML extends wsPackager { $facebook .= ''; } + $favicon = ''; + + fb($this->theme->parametres->favicon); + if ($this->theme->parametres->favicon != '') { + $favicon = ''; + } + if ($this->book->parametres->mobileVersion == 'pdf') { $redirectMobile = 'window.location="data/document.pdf";'; } else { @@ -65,17 +72,19 @@ class wsPackagerHTML extends wsPackager { $robots = ''; if (!$seoRobot) { - $robots=''; + $robots = ''; } // Stuffs to replace in html $toReplace = array('lang' => strtolower($this->book->lang), 'title' => self::escape($this->book->parametres->title), - 'ga' => $ga, 'facebook' => $facebook, + 'ga' => $ga, + 'facebook' => $facebook, 'bgcolor' => $this->theme->parametres->loadingBackColor, 'redirectMobile' => $redirectMobile, 'junk' => TIME, - 'robots' => $robots); + 'robots' => $robots, + 'favicon' => $favicon); $this->origHTML = file_get_contents($this->vdir . '/index.html'); $this->origHTML = $this->replaceHTML($toReplace); diff --git a/inc/ws/Util/packager/class.ws.packager.php b/inc/ws/Util/packager/class.ws.packager.php index 3a6cc62a8..47c387a32 100644 --- a/inc/ws/Util/packager/class.ws.packager.php +++ b/inc/ws/Util/packager/class.ws.packager.php @@ -13,9 +13,9 @@ class wsPackager { protected $daoBook; protected $zip; - public static function package($book_id, $version,$zip=true) { + public static function package($book_id, $version, $zip = true) { global $packager; - + cubePHP::neverStop(); if ($version == 'html') { $packager = new wsPackagerHTML($book_id); @@ -87,7 +87,7 @@ class wsPackager { } $s = WS_COMPILE_ASSETS . '/' . $source; - if (is_file($s)) { + if (is_file($s) && !file_exists($this->vdir . $dest)) { copy($s, $this->vdir . $dest); } else if (is_dir($s)) { $cp = new cubeCommandLine('cp'); diff --git a/inc/ws/Util/packager/class.ws.packager.win.inst.php b/inc/ws/Util/packager/class.ws.packager.win.inst.php index f14e557cd..a08fff41f 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.inst.php +++ b/inc/ws/Util/packager/class.ws.packager.win.inst.php @@ -37,15 +37,21 @@ class wsPackagerWinINST extends wsPackagerWinEXE { $nsi = str_replace('$lang', utf8_decode($lang->nsis), $nsi); $nsi = str_replace('$nsisdir', '/usr/local/nsis/nsis-2.46/share/nsis', $nsi); $nsi = str_replace('$output', $this->getPathBase('exe'), $nsi); + $favicon = WS_COMPILE_ASSETS . '/fluidbook.ico'; + if ($this->theme->parametres->favicon != '') { + $favicon = $this->vdir . '/data/fluidbook.ico'; + } + $nsi = str_replace('$favicon', $favicon, $nsi); $this->nsi = $nsi; } public function makePackage($zip) { $this->preparePackage(); - $url = 'http://installer.fluidbook.com/make.php?nsi=' . base64_encode($this->nsi); + $url = 'http://installer.fluidbook.com/make.php?nsi=' . base64_encode($this->nsi) . '&junk=' . TIME; - file_get_contents('http://installer.fluidbook.com/make.php?nsi=' . base64_encode($this->nsi) . '&junk=' . TIME); + file_get_contents($url); + fb($url); return $this->getURLBase('exe'); } -- 2.39.5