From 24cd0dc6122db7c2f1146a05cf7fd376607447d1 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 12 Apr 2012 09:33:12 +0000 Subject: [PATCH] --- inc/ws/DAO/class.ws.dao.book.php | 17 ++++++++++++++++- inc/ws/Metier/class.ws.book.parametres.php | 6 ++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 2bfb062fb..97f3de3c6 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -887,7 +887,7 @@ class wsDAOBook extends commonDAO { public function compileFlex($book_id, $complete, $compilerDir, $finalDir, &$filesToCopy, $book, $pages, $flex, $flexLight) { cubePHP::neverStop(); - + /* @var $flex cubeFlexCompiler */ $workingDir = WS_BOOKS . '/working/' . $book_id . '/'; @@ -1065,6 +1065,21 @@ class wsDAOBook extends commonDAO { $flex->addBitmap($iconsRoot . 'nav-' . $file . '.png', 'nav_' . $file); } + // Multilang + if ($book->parametres->multilang) { + $langs = explode("\n", $book->parametres->multilang); + $langNames = array(); + $iso = l10n::getISOcodes(); + $chars = ''; + foreach ($langs as $l) { + list($lang, $flag, $url) = explode(',', trim($l), 3); + $flex->addBitmap(cubeMedia::getFlagFile($flag), 'flag_' . $flag); + $langNames[$lang] = $iso[$lang]; + $chars.=$iso[$lang]; + } + $flex->addVariable('langNames', $langNames, false, true, 'JSONObject'); + } + // Basket if ($book->parametres->basket) { $formats = array('jpg', 'png', 'jpeg'); diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index bdadfaf71..79801c0e7 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -187,6 +187,10 @@ class wsBookParametres extends wsParametres { $this->forms['multimedia'] = array('label' => __('Liens et multimédia'), 'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass', 'linkTooltipManager', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkMultimediaPerformanceMode')); // . + $this->fields['multilang'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => 'Langues'); + $this->forms['multilang'] = array('label' => __('Interface multilangue'), + 'fieldsnames' => array('multilang')); + //. $this->fields['externalArchives'] = array('type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Archives'), 'grade' => 3, 'fileFilter' => $swfFilter); @@ -268,5 +272,7 @@ class wsBookParametres extends wsParametres { $this->forms['demo'] = array('label' => __('Lien de démo'), 'fieldsnames' => array('disableDemo', 'redirectDemo')); } + } + ?> \ No newline at end of file -- 2.39.5