From df7533e23b3c0ede23b18017a2ad8bf9c5e0ad9b Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 6 Apr 2012 13:01:15 +0000 Subject: [PATCH] --- fluidbook/tools/scour.php | 19 +++++++++++++++++++ inc/ws/Controlleur/class.ws.flash.php | 12 ++++++++---- inc/ws/Metier/class.ws.book.parametres.php | 19 +++++++++++++------ inc/ws/Metier/class.ws.document.php | 19 +++++++++---------- 4 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 fluidbook/tools/scour.php diff --git a/fluidbook/tools/scour.php b/fluidbook/tools/scour.php new file mode 100644 index 000000000..5db8bae89 --- /dev/null +++ b/fluidbook/tools/scour.php @@ -0,0 +1,19 @@ +#!/usr/local/bin/php + diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index 5f53957d0..efa70e4c3 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -615,7 +615,9 @@ class wsFlash extends cubeFlashGateway { $book = $dao->selectById($this->args['book_id']); $book->traductions = wsLang::checkTranslations($book->traductions); if ($book->traductions != array()) { - $bookLang = $this->xml->addChild('book_lang', json_encode($book->traductions)); + //$bookLang = $this->xml->addChild('book_lang', json_encode($book->traductions)); + $bookLang =(array) $book->traductions; + fb($bookLang); } } @@ -630,9 +632,11 @@ class wsFlash extends cubeFlashGateway { if (!isset($bookLang)) { $l->addAttribute('selected', '1'); } else { - $bookLang->addAttribute('id', $lang->lang_id); - $bookLang->addAttribute('nom', $nom . ' (' . __('modifié') . ')'); - $bookLang->addAttribute('selected', '1'); + $trad = array_merge($lang->traductions, $bookLang); + $bl = $this->xml->addChild('book_lang', json_encode($trad)); + $bl->addAttribute('id', $lang->lang_id); + $bl->addAttribute('nom', $nom . ' (' . __('modifié') . ')'); + $bl->addAttribute('selected', '1'); } } } diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 7170434ef..bdadfaf71 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -157,17 +157,26 @@ class wsBookParametres extends wsParametres { $this->fields['externalChapters'] = array('type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Sommaire personnalisé'), 'grade' => 3, 'fileFilter' => $swfFilter, 'hint' => __('Laisser vide pour utiliser le sommaire classique')); $this->fields['fullExternalChapters'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Sommaire totalement personnalisé"), 'grade' => 3, 'hint' => __('Supprime la flèche de fermeture, titre prédéfini et couleur de fond')); - $this->fields['ongletsXML'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('XML de configuration des onglets'), 'grade' => 5); - $this->fields['ongletsSWF'] = array('type' => 'freefile', 'default' => '', 'editable' => true, - 'label' => __('SWF pour onglets personnalisés'), 'grade' => 3, 'fileFilter' => $swfFilter); + $this->fields['chaptersPosition'] = array('type' => 'combo', 'default' => 'center', 'editable' => true, 'label' => __("Position du sommaire"), 'datas' => array(__('Centré') => 'center', __("Aligné sur l'icône") => 'chaptersIcon')); $this->fields['chaptersCascade'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Sommaire en cascade"), 'grade' => 3); $this->forms['sommaire'] = array('label' => __('Sommaire'), - 'fieldsnames' => array('displayChaptersIcon', 'displayChaptersAtStart', 'chaptersPage', 'chaptersPosition', 'chaptersCascade', '|', 'chaptersColMaxWidth', 'chaptersColumns', 'displayChaptersLine', '|', 'externalChapters', 'fullExternalChapters', '|', 'ongletsSWF', 'ongletsXML')); + 'fieldsnames' => array('displayChaptersIcon', 'displayChaptersAtStart', 'chaptersPage', 'chaptersPosition', 'chaptersCascade', '|', 'chaptersColMaxWidth', 'chaptersColumns', 'displayChaptersLine', '|', 'externalChapters', 'fullExternalChapters')); // . + + $this->fields['ongletsXML'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('XML de configuration des onglets'), 'grade' => 5); + $this->fields['ongletsSWF'] = array('type' => 'freefile', 'default' => '', 'editable' => true, + 'label' => __('SWF pour onglets personnalisés'), 'grade' => 3, 'fileFilter' => $swfFilter); + + $this->fields['tabs2DSWF'] = array('type' => 'freefile', 'default' => '', 'editable' => true, + 'label' => __('SWF pour onglets 2D'), 'grade' => 3, 'fileFilter' => $swfFilter); + + $this->forms['tabs'] = array('label' => __('Onglets'), + 'fieldsnames' => array('ongletsSWF', 'ongletsXML', '|', 'tabs2DSWF')); + $this->fields['customLinkClass'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Classe pour les liens personnalisés'), 'grade' => 5); $this->fields['permanentLinks'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Liens visibles en permanence'), 'grade' => 3); $this->fields['linkBlinkTime'] = array('type' => 'float', 'default' => 1.0, 'editable' => true, 'label' => __("Temps d'apparition du lien à l'ouverture de la page (en secondes)")); @@ -259,7 +268,5 @@ class wsBookParametres extends wsParametres { $this->forms['demo'] = array('label' => __('Lien de démo'), 'fieldsnames' => array('disableDemo', 'redirectDemo')); } - } - ?> \ No newline at end of file diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index 376aacb20..ccc1f6fd3 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -313,6 +313,15 @@ class wsDocument extends cubeMetier { for ($i = 1; $i <= $this->generalInfos['pages']; $i++) { $this->processOnePage($i); } + $this->optimizeSVG(); + } + + public function optimizeSVG(){ + $scour=new cubeCommandLine('scour.php'); + $scour->setPath(CONVERTER_PATH); + $scour->setNohup(true); + $scour->setArg(null, $this->html); + $scour->execute(); } public function processRange($pages) { @@ -593,16 +602,6 @@ class wsDocument extends cubeMetier { $this->addToLog(implode("\n", $svglog), false, $page); file_put_contents($svgFile, $svg->saveXML()); - - $scour = new cubeCommandLine('scour.py'); - $scour->setArg('shorten-ids'); - $scour->setArg('set-precision', '3'); - $scour->setArg('indent', 'none'); - $scour->setArg('create-groups'); - $scour->setArg('i', $svgFile); - $scour->setArg('o', $svgOpt); - $scour->setNohup(true); - $scour->execute(); } protected function checkObjectsNumber($file, $maxObjects, $page) { -- 2.39.5