From 45467f8d1d49f93218ae6f308847d037d1e608aa Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 2 Jan 2013 14:39:01 +0000 Subject: [PATCH] --- inc/ws/Controlleur/class.ws.flash.php | 2 +- inc/ws/Metier/class.ws.book.parametres.php | 5 +++-- inc/ws/Metier/class.ws.theme.parametres.php | 6 +++--- inc/ws/Util/packager/class.ws.packager.win.exe.php | 6 +++++- inc/ws/Util/packager/class.ws.packager.win.inst.php | 12 +++++++----- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index 5b7fba821..a82a13eca 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -159,7 +159,7 @@ class wsFlash extends cubeFlashGateway { move_uploaded_file($infos['tmp_name'], $dest); - if (isset($this->args['type']) && $this->args['type'] == 'ico') { + if (isset($this->args['type']) && $this->args['type'] == 'favicon') { $icotool = new cubeCommandLine('icotool'); $icotool->setArg('c'); $icotool->setArg('o', $dir . '/fluidbook.ico'); diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 45aaae954..7260e2e80 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -131,7 +131,7 @@ class wsBookParametres extends wsParametres { $this->fields['searchShowNoResultsPages'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Afficher les pages sans résultats")); $this->forms['search'] = array('label' => __('Moteur de recherche'), - 'fieldsnames' => array('search', 'searchHideNoResultsPages', '|', 'ignoreSearch', 'ignoreSearchSeparators', 'textExtraction')); + 'fieldsnames' => array('search', 'searchShowNoResultsPages', '|', 'ignoreSearch', 'ignoreSearchSeparators', 'textExtraction')); $this->fields['soundTheme'] = array('type' => 'combo', 'default' => 'classic', 'editable' => true, 'label' => __("Thème sonore"), 'datas' => array(__('Pas de son') => '', @@ -241,8 +241,9 @@ class wsBookParametres extends wsParametres { 'fieldsnames' => array('basket', 'basketManager', 'basketReferences', 'basketImages', 'basketPDFBackground')); // . $this->fields['offlineLink'] = array('type' => 'text', 'default' => 'http://', 'editable' => true, 'label' => __("URL du Fluidbook"), 'hint' => __('URL du fluidbook utilisée pour la version Offline (CD-ROM, clé USB, Exécutables)')); + $this->fields['offlineTitle'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre de l'application")); $this->forms['offline'] = array('label' => __('Version offline'), - 'fieldsnames' => array('offlineLink')); + 'fieldsnames' => array('offlineTitle', 'offlineLink')); $this->fields['mobileVersion'] = array('type' => 'combo', 'default' => 'html5-images', 'editable' => true, 'label' => __('Version mobile'), 'grade' => 3, 'datas' => array(__('Rediriger vers le PDF') => 'pdf', diff --git a/inc/ws/Metier/class.ws.theme.parametres.php b/inc/ws/Metier/class.ws.theme.parametres.php index 22d57d9e4..fa9ccf6c2 100644 --- a/inc/ws/Metier/class.ws.theme.parametres.php +++ b/inc/ws/Metier/class.ws.theme.parametres.php @@ -214,19 +214,19 @@ class wsThemeParametres extends wsParametres { 'label' => __('Icone (pour favicon et CD-ROM)'), 'path' => $themeRoot, 'fileFilter' => $imageFilter, - 'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&type=ico', + 'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&type=favicon', 'hint' => __('Image PNG de 256x256')); $this->fields['iosicon'] = array('type' => 'file', 'default' => '', 'editable' => true, 'label' => __('Icone (pour application iOS)'), 'path' => $themeRoot, 'fileFilter' => $imageFilter, - 'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&type=ico', + 'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&type=iosicon', 'hint' => __('Image PNG de 1024x1024')); $this->fields['androidicon'] = array('type' => 'file', 'default' => '', 'editable' => true, 'label' => __('Icone (pour application Android)'), 'path' => $themeRoot, 'fileFilter' => $imageFilter, - 'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&type=ico', + 'uploadURL' => SITE_PATH . 'flash/uploadThemeFile/?theme_id=' . $this->parent->theme_id . '&type=androidicon', 'hint' => __('Image PNG de 1024x1024')); $this->forms['logo'] = array('label' => __('Personnalisation du logo'), diff --git a/inc/ws/Util/packager/class.ws.packager.win.exe.php b/inc/ws/Util/packager/class.ws.packager.win.exe.php index fb9bfbb6c..d5d640e43 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.exe.php +++ b/inc/ws/Util/packager/class.ws.packager.win.exe.php @@ -8,7 +8,11 @@ class wsPackagerWinEXE extends wsPackager { parent::__construct($book_id); $this->version = 'win-exe'; - $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 30)) . '.exe'; + if ($this->book->parametres->offlineTitle == "") { + $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 30)) . '.exe'; + } else { + $this->exeName = cubeText::str2URL($this->book->parametres->offlineTitle) . '.exe'; + } } protected function preparePackage() { 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 b9805857d..475d16a05 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.inst.php +++ b/inc/ws/Util/packager/class.ws.packager.win.inst.php @@ -28,18 +28,21 @@ class wsPackagerWinINST extends wsPackagerWinEXE { $daoLang = new wsDAOLang($core->con); $lang = $daoLang->selectById($this->book->lang); + $fname = str_replace('.exe', '', $this->exeName); + $title = $this->book->parametres->offlineTitle == '' ? $this->book->parametres->title : $this->book->parametres->offlineTitle; + $nsi = file_get_contents(WS_COMPILE_ASSETS . '/script.nsi'); - $nsi = str_replace('$name', utf8_decode($this->book->parametres->title), $nsi); + $nsi = str_replace('$name', utf8_decode($title), $nsi); $nsi = str_replace('$htmldir', utf8_decode(WS_COMPILE_ASSETS), $nsi); - $nsi = str_replace('$fname', str_replace('.exe', '', $this->exeName), $nsi); + $nsi = str_replace('$fname', $fname, $nsi); $nsi = str_replace('$fdir', $winvdir, $nsi); - $nsi = str_replace('$titre', utf8_decode($this->book->parametres->title), $nsi); + $nsi = str_replace('$titre', utf8_decode($title), $nsi); $nsi = str_replace('$lang', utf8_decode($lang->nsis), $nsi); $nsi = str_replace('$nsisdir', '/usr/share/nsis', $nsi); $nsi = str_replace('$output', $this->getPathBase('exe'), $nsi); $favicon = $this->vdir . '/data/fluidbook.ico'; if ($this->theme->parametres->favicon == '') { - $this->copy(WS_COMPILE_ASSETS . '/fluidbook.ico',$favicon); + $this->copy(WS_COMPILE_ASSETS . '/fluidbook.ico', $favicon); } $nsi = str_replace('$favicon', $favicon, $nsi); @@ -51,7 +54,6 @@ class wsPackagerWinINST extends wsPackagerWinEXE { $url = '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