From: vincent@cubedesigners.com Date: Wed, 15 Jun 2016 08:30:44 +0000 (+0000) Subject: #439 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7dce52c9533dd2de3d697c10a43a4711d4d34d0a;p=cubeextranet.git #439 --- diff --git a/inc/commons/class.common.tools.php b/inc/commons/class.common.tools.php index 548a20b09..68a54ecde 100644 --- a/inc/commons/class.common.tools.php +++ b/inc/commons/class.common.tools.php @@ -1197,4 +1197,9 @@ class commonTools { } } + public static function proxy() { + ob_end_clean(); + echo file_get_contents($_GET['url']); + exit; + } } diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 98fb9bd01..280b317b1 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -307,6 +307,7 @@ class wsUrl { $res .= ''; $res .= ''; $res .= ''; + $res .= ''; $res .= ''; $res .= ''; $res .= ''; @@ -1884,7 +1885,7 @@ html{height:100%}' . "\n"; $collection = $dao->cree(); } - $res .= ''; + $res = ''; $res .= ''; return $res; } diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 81e82654a..e4af314f2 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -1384,7 +1384,7 @@ class wsDAOBook extends commonDAO { // Basket if ($book->parametres->basket) { $formats = array('jpg', 'png', 'jpeg'); - $referencesFile = $workingDir . 'commerce/' . $book->parametres->basketReferences; + $referencesFile = self::getWorkingFile($book->parametres->basketReferences, $book_id, 'commerce'); if (file_exists($referencesFile)) { $ext = CubeIT_Files::getExtension($referencesFile); @@ -1460,6 +1460,15 @@ class wsDAOBook extends commonDAO { $flexLight->addVariable('checksum', $hash, false, true, 'String'); } + public static function getWorkingFile($path, $book_id, $dir = "") { + if (substr($path, 0, 1) == '/' && file_exists($path)) { + return $path; + } + + $workingDir = WS_BOOKS . '/working/' . $book_id . '/'; + return $workingDir . $dir . '/' . $path; + } + public function compileWidget($book, $pages) { if (!$book->parametres->widget) { return; diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 491b60ee8..7fadfc4d9 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -397,12 +397,13 @@ class wsBookParametres extends wsParametres { $this->forms['theme'] = array('label' => __('Options du thème'), 'fieldsnames' => array('themeEnableAfterSearch')); + $this->fields['forceCompileOnDownload'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Forcer la compilation lors du téléchargement'), 'grade' => 3); $this->fields['htmlExtension'] = array('type' => 'text', 'default' => 'html', 'editable' => true, 'label' => __('Extension des fichiers html'), 'grade' => 5, 'hint' => __('Ex : php, htm, html, phtml, asp'), 'grade' => 5); $this->fields['htmlPrepend'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Code à insérer en tête des fichiers'), 'grade' => 5); $this->fields['baseUrl'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Base de l\'url'), 'grade' => 5, 'grade' => 5); $this->forms['package'] = array('label' => __('Option d\'export'), - 'fieldsnames' => array('htmlExtension', 'htmlPrepend', 'baseUrl')); + 'fieldsnames' => array('htmlExtension', 'htmlPrepend', 'baseUrl', 'forceCompileOnDownload')); $this->fields['disableDemo'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Désactiver le lien de démo'), 'grade' => 5); $this->fields['redirectDemo'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Rediriger le lien de démo vers'), 'grade' => 5); diff --git a/inc/ws/Util/class.ws.exporter.php b/inc/ws/Util/class.ws.exporter.php index 74e98a525..c0865c179 100644 --- a/inc/ws/Util/class.ws.exporter.php +++ b/inc/ws/Util/class.ws.exporter.php @@ -45,6 +45,9 @@ class wsExporter { $phonegap->setAuthor('Fluidbook', 'contact@fluidbook.com', 'http://www.fluidbook.com'); $phonegap->setVersion($collection->settings['version']); $phonegap->setBuild($collection->settings['build']); + if ($os == 'android') { + $phonegap->setLicenseKey($collection->settings['license_key']); + } $phonegap->setNamespace($collection->settings['namespace']); $phonegap->setActivity($collection->settings['activity']); @@ -64,21 +67,19 @@ class wsExporter { $manifestType = isset($collection->settings['offline']) ? 'Offline' : 'Online'; $phonegap->setManifest(WS_COMPILE_ASSETS . '/_html5app/_android/AndroidManifest' . $manifestType . '.xml'); $phonegap->setMain(WS_COMPILE_ASSETS . '/_html5app/_android/Main' . $manifestType . '.java'); + $phonegap->setMainDir(WS_COMPILE_ASSETS . '/_html5app/_android/'); $phonegap->addLibrary(WS_COMPILE_ASSETS . '/_html5app/_android/lib'); $phonegap->setDistantCompiler(self::VINCENT, 'Vincent', 's77vpo*wu5', 'h:/Phonegap/Projects/' . $d, '/mnt/vincent/cygdrive/h/Phonegap/Projects/' . $d, 22322, SSH_KEY); $phonegap->setSourceVariables(array('background' => '0xff' . $collection->settings['couleurD'], 'orientation' => $collection->settings['orientation']) ); } - $phonegap->setPreference('orientation', CubeIT_Mobile_Phonegap::ORIENTATION_PORTRAIT); - $phonegap->setPreference('target-device', CubeIT_Mobile_Phonegap::TARGET_TABLET); + $phonegap->setPreference('show-splash-screen-spinner', false); $phonegap->setPreference('auto-hide-splash-screen', false); $phonegap->setPreference('ios-statusbarstyle', CubeIT_Mobile_Phonegap::BARSTYLE_TRANSLUCENT); $phonegap->setPreference('iosPersistentFileLocation', 'Library'); - if ($collection->settings['orientation'] != 'portrait') { - $phonegap->setPreference('EnableViewportScale', true); - } + $phonegap->setPreference('EnableViewportScale', true); $phonegap->addFeatures(array( CubeIT_Mobile_Phonegap::FEATURE_CONNECTION, CubeIT_Mobile_Phonegap::FEATURE_DEVICE, diff --git a/inc/ws/Util/packager/class.ws.packager.html.php b/inc/ws/Util/packager/class.ws.packager.html.php index 45627de33..b6cef2c18 100644 --- a/inc/ws/Util/packager/class.ws.packager.html.php +++ b/inc/ws/Util/packager/class.ws.packager.html.php @@ -211,7 +211,7 @@ class wsPackagerHTML extends wsPackager { return; } - $this->daoBook->compile($this->book_id, 'html5'); + $this->daoBook->compile($this->book_id, 'html5', false, $this->book->parametres->forceCompileOnDownload); $dest = $this->vdir . 'm'; if (!file_exists($dest)) { diff --git a/inc/ws/Util/packager/class.ws.packager.php b/inc/ws/Util/packager/class.ws.packager.php index b7d6c4587..c5d680bd6 100644 --- a/inc/ws/Util/packager/class.ws.packager.php +++ b/inc/ws/Util/packager/class.ws.packager.php @@ -71,7 +71,7 @@ class wsPackager { } protected function compile() { - $this->daoBook->compile($this->book_id, '2'); + $this->daoBook->compile($this->book_id, '2', false, $this->book->parametres->forceCompileOnDownload); } protected function preparePackage() {
' . __('Activity') . '' . form::field(array('settings[activity]', 'activity'), 20, 64, $collection->settings['activity']) . '
' . __('Build') . '' . form::field(array('settings[build]', 'build'), 10, 64, $collection->settings['build']) . '
' . __('Android License Key') . '' . form::textArea(array('settings[license_key]', 'license_key'),50,3, $collection->settings['license_key']) . '
' . __('Version') . '' . form::field(array('settings[version]', 'version'), 10, 64, $collection->settings['version']) . '
' . __('Orientation') . '' . form::combo(array('settings[orientation]', 'orientation'), array(__('Portrait et Paysage') => 'unspecified', __('Portrait') => 'portrait', __('Paysage') => 'landscape'), $collection->settings['orientation']) . '
' . __('Full offline') . '' . form::checkbox(array('settings[offline]', 'offline'), 1, $collection->settings['offline']) . '
#' . form::hidden('collection_id', $collection->collection_id) . $collection->collection_id . '
#' . form::hidden('collection_id', $collection->collection_id) . $collection->collection_id . '
Nom de la collection' . form::field('nom', 20, 64, $collection->nom) . '