define('MXMLC_PATH_3', '/usr/local/flex_sdk_3.6/bin/mxmlc');\r
define('AS3_SOURCES', '/home/as/sources/as/as3');\r
define('AS3_FLUIDBOOK_SOURCES', '/home/as/sources/fluidbook');\r
+define('PHONEGAP_PLUGINS','/home/as/sources/phonegap-plugins');\r
\r
define('MONITOR_PERFS', true);\r
\r
\r
$this->fields['fullscreen'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Activer le mode plein-écran'));\r
$this->fields['navOrder'] = array('type' => 'textarea', 'default' => 'index, chapters, print, friend, bookmark, pdf, archives, basket, fullscreen, sound, 3d, help', 'editable' => true, 'label' => __('Ordre des icônes dans la nav'), 'grade' => 5);\r
+ $this->fields['tooltipTimer'] = array('type' => 'float', 'default' => 3, "editable" => true, 'label' => __("Temps maximum d'apparition des infos-bulles (en secondes)"));\r
$this->forms['general'] = array('label' => __('Fonctionnalités générales'),\r
- 'fieldsnames' => array('fullscreen', 'navOrder', 'pages', 'width', 'height'));\r
+ 'fieldsnames' => array('fullscreen', 'navOrder', 'tooltipTimer', 'pages', 'width', 'height'));\r
//.\r
//\r
\r
\r
$this->fields['phonegapId'] = array('type' => 'text', 'default' => 'com.fluidbook.phonegap.$id', 'editable' => true, 'label' => __("Identifiant de l'identifiant"), 'grade' => 5, 'hint' => __('De la forme') . ' com.fluidbook.phonegap.xxxxx');\r
$this->fields['phonegapVersion'] = array('type' => 'text', 'default' => '1.0.0', 'editable' => true, 'label' => __("Version de l'application"), 'grade' => 5, 'hint' => __('De la forme') . ' 1.2.3');\r
+ $this->fields['phonegapPlugins'] = array('type' => 'textarea', 'default' => 'ChildBrowser', 'editable' => true, 'label' => __('Plugins Phonegap'), 'grade' => 5);\r
\r
$this->forms['phonegap'] = array('label' => __('Applications mobile'),\r
- 'fieldsnames' => array('phonegapId', 'phonegapVersion'));\r
+ 'fieldsnames' => array('phonegapId', 'phonegapVersion', 'phonegapPlugins'));\r
\r
$this->fields['secureURL'] = array('type' => 'text', 'default' => 'http://', 'editable' => true, 'label' => __('URL de sécurisation'), 'grade' => 5, 'hint' => __('URL intérrogé pour vérifier si le visiteur à les droits pour consulter la publication'));\r
$this->fields['secureURLRedirect'] = array('type' => 'text', 'default' => 'http://', 'editable' => true, 'label' => __('Redirection'), 'grade' => 5, 'hint' => __("Si l'authentification échoue, redirection vers cette adresse"));\r
foreach ($sheets as $sheet) {
$style[] = '<link type="text/css" rel="stylesheet" media="screen" href="' . $sheet . '">';
}
- $style[] = '<link type="text/css" rel="stylesheet" media="print" href="style/print.css">';
$style = implode("\n\t\t", $style);
$pagesContents = '';
$script = '';
if ($this->phonegap) {
$script .= '<script type="text/javascript" src="data/cordova.js"></script>' . "\n";
+
+ if ($this->phonegap == 'ios') {
+ copy($this->assets . '/js/libs/phonegap/plugins/ios/ExternalFileUtil.js', $this->vdir . '/data/ExternalFileUtil.js');
+ $script .= '<script type="text/javascript" src="data/ExternalFileUtil.js"></script>' . "\n";
+ }
+
+ $plugins = explode("\n", $this->book->parametres->phonegapPlugins);
+ foreach ($plugins as $p) {
+ $p = trim($p);
+ $pluginDir = 'data/phonegap/' . $p;
+ $d = $this->vdir . '/' . $pluginDir;
+ mkdir($d, 0777, true);
+
+ if ($this->phonegap == 'ios') {
+ $os = 'iOS';
+ } else if ($this->phonegap == 'android') {
+ $os = 'Android';
+ }
+
+ $orig = PHONEGAP_PLUGINS . '/' . $os . '/' . $p;
+ $dr = opendir($orig);
+ while ($file = readdir($dr)) {
+ if ($file == '.' || $file == '..') {
+ continue;
+ }
+ if (files::getExtension($file) == 'js') {
+ copy($orig . '/' . $file, $d . '/' . $file);
+ $script .= '<script type="text/javascript" src="' . $pluginDir . '/' . $file . '"></script>' . "\n";
+ }
+ }
+ }
}
$script .= '<script type="text/javascript" src="data/fluidbook.js"></script>' . "\n";
$script .= '<script type="text/javascript" src="data/search.js"></script>' . "\n";
}
protected function writePrint() {
- $res = '';
- /* $res .= '<div id="printpages">';
- for ($i = 1; $i <= $this->book->parametres->pages; $i++) {
- $res.='<div class="printpage"><img src="data/background/150/t' . $i . '.jpg" alt="" /></div>';
- }
- $res.='</div>'; */
- return $res;
+
+ if (!$this->book->parametres->print) {
+ return;
+ }
+
+ copy(WS_BOOKS . '/final/' . $this->book->book_id . '/data/' . $this->book->parametres->pdfName, $this->vdir . '/data/' . $this->book->parametres->pdfName);
+ return '';
}
protected function writeLangs() {
$icons = array('nav-bookmark' => $couleurI, 'nav-friend' => $couleurI, 'nav-help' => $couleurI, 'nav-index' => $couleurI, 'nav-sommaire' => $couleurI,
'next' => $arrowsColor, 'previous' => $arrowsColor, 'search' => $couleurI, 'nav-facebook' => $couleurI, 'nav-twitter' => $couleurI,
'help-fingers' => $couleurI, 'help-mouse' => $couleurI, 'nav-home' => $couleurI, 'nav-archives' => $couleurI, 'nav-map' => $couleurI,
- 'nav-tag' => $couleurI);
+ 'nav-tag' => $couleurI, 'nav-print' => $couleurI);
$this->config->iconsDimensions = array();
foreach ($icons as $icon => $color) {