}
}
+ public static function proxy() {
+ ob_end_clean();
+ echo file_get_contents($_GET['url']);
+ exit;
+ }
}
$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>';
$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;
}
// 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);
$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;
$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);
$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']);
$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,
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)) {
}
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() {