]> _ Git - cubeextranet.git/commitdiff
#439
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 15 Jun 2016 08:30:44 +0000 (08:30 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 15 Jun 2016 08:30:44 +0000 (08:30 +0000)
inc/commons/class.common.tools.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/class.ws.exporter.php
inc/ws/Util/packager/class.ws.packager.html.php
inc/ws/Util/packager/class.ws.packager.php

index 548a20b09dd545e431b571e3538155c447a4ab8a..68a54ecde22a24b4b471da238010743a9268e978 100644 (file)
@@ -1197,4 +1197,9 @@ class commonTools {
                }
        }
 
+       public static function proxy() {
+               ob_end_clean();
+               echo file_get_contents($_GET['url']);
+               exit;
+       }
 }
index 98fb9bd01cb2fe9aec0a69edb0d5035a6205e6a3..280b317b1b922659da26198e4498a8095864b9fa 100644 (file)
@@ -307,6 +307,7 @@ class wsUrl {
                $res .= '<table class="max">';
                $res .= '<tr><td class="min nowrap">' . __('Activity') . '</td><td>' . form::field(array('settings[activity]', 'activity'), 20, 64, $collection->settings['activity']) . '</td></tr>';
                $res .= '<tr><td class="min nowrap">' . __('Build') . '</td><td>' . form::field(array('settings[build]', 'build'), 10, 64, $collection->settings['build']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Android License Key') . '</td><td>' . form::textArea(array('settings[license_key]', 'license_key'),50,3, $collection->settings['license_key']) . '</td></tr>';
                $res .= '<tr><td class="min nowrap">' . __('Version') . '</td><td>' . form::field(array('settings[version]', 'version'), 10, 64, $collection->settings['version']) . '</td></tr>';
                $res .= '<tr><td class="min nowrap">' . __('Orientation') . '</td><td>' . form::combo(array('settings[orientation]', 'orientation'), array(__('Portrait et Paysage') => 'unspecified', __('Portrait') => 'portrait', __('Paysage') => 'landscape'), $collection->settings['orientation']) . '</td></tr>';
                $res .= '<tr><td class="min nowrap">' . __('Full offline') . '</td><td>' . form::checkbox(array('settings[offline]', 'offline'), 1, $collection->settings['offline']) . '</td></tr>';
@@ -1884,7 +1885,7 @@ html{height:100%}' . "\n";
                        $collection = $dao->cree();
                }
 
-               $res .= '<tr><td>#</td><td>' . form::hidden('collection_id', $collection->collection_id) . $collection->collection_id . '</td></tr>';
+               $res = '<tr><td>#</td><td>' . form::hidden('collection_id', $collection->collection_id) . $collection->collection_id . '</td></tr>';
                $res .= '<tr><td>Nom de la collection</td><td>' . form::field('nom', 20, 64, $collection->nom) . '</td></tr>';
                return $res;
        }
index 81e82654af1777b312837c4ee5314b2cb7755e67..e4af314f24f2541764068eac27b556d20b58fafb 100644 (file)
@@ -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;
index 491b60ee823af79ac5cc5370b6601a20a3d0696a..7fadfc4d962b9e9f6e2e483aa3150b4c1f8b759d 100644 (file)
@@ -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);
index 74e98a5255fb59cda87461cbb1dcf2dea6e192bb..c0865c1798cc07da623657b49a41f8679a82ec8b 100644 (file)
@@ -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,
index 45627de33f88418541f07fee78ad69a78d7e09ba..b6cef2c18fce9c12ecfbf62b8a54d91c7d7e1009 100644 (file)
@@ -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)) {
index b7d6c4587efe1b0ddaae8defddeb55ff64fc7e26..c5d680bd6cb2d0aff75fae99c7d7446e31b54670 100644 (file)
@@ -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() {