$this->forms['mobile'] = array('label' => __('Version mobile'),\r
'fieldsnames' => array('mobileLVersion', '|', 'mobileVersion', 'mobileTransitions', 'mobileIconVector'));\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
+\r
+ $this->forms['phonegap'] = array('label' => __('Applications mobile'),\r
+ 'fieldsnames' => array('phonegapId', 'phonegapVersion'));\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
$this->forms['secure'] = array('label' => __('Sécurisation'),\r
protected function preparePackage() {
parent::preparePackage();
- $compiler = wsHTML5Compiler::factory($this->book_id, null, true, $this->vdir . '/www');
+ $compiler = wsHTML5Compiler::factory($this->book_id, null, true, $this->vdir);
$compiler->compile();
- unlink($this->vdir . '/www/indext.html');
- unlink($this->vdir . '/www/indexu.html');
- unlink($this->vdir . '/www/widget.html');
- unlink($this->vdir . '/www/cache.appcache');
- rmdir($this->vdir . '/data');
+ unlink($this->vdir . '/indext.html');
+ unlink($this->vdir . '/indexu.html');
+ unlink($this->vdir . '/widget.html');
+ unlink($this->vdir . '/cache.appcache');
+ //rmdir($this->vdir . '/data');
$this->makeConfig();
}
protected function makeConfig() {
- $config = simplexml_load_string('<?xml version="1.0" encoding="UTF-8"?><widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" version="1.0.0" id="com.fluidbook.phonegap.' . $this->book_id . '" />');
- $ns = $config->getNamespaces();
+
+ $appId = $this->book->parametres->phonegapId;
+ $appId = str_replace('$id', $this->book_id, $appId);
+
+ $config = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" version="' . $this->book->parametres->phonegapVersion . '" id="' . $appId . '" />');
+ $ns = $config->getDocNamespaces();
$config->addChild('name', $this->book->parametres->title);
$config->addChild('description');
$author = $config->addChild('author', 'Fluidbook');
list($width, $height) = explode('x', $size);
$this->_makeSplash($width, $height);
- $s = $config->addChild('splash');
- $s->addAttribute('src', 'splash/' . $size . '.png', $ns['gap']);
+ $s = $config->addChild('gap:splash', null, $ns['gap']);
+ $s->addAttribute('src', 'splash/' . $size . '.png');
$s->addAttribute('width', $width);
$s->addAttribute('height', $height);
}
list($width, $height) = explode('x', $size);
$this->_makeSplash($width, $height);
- $s = $config->addChild('splash', null, $ns['gap']);
+ $s = $config->addChild('gap:splash', null, $ns['gap']);
$s->addAttribute('src', 'splash/' . $size . '.png');
- $s->addAttribute('platform', 'android', $ns['gap']);
- $s->addAttribute('density', $density, $ns['gap']);
+ $s->addAttribute('gap:platform', 'android', $ns['gap']);
+ $s->addAttribute('gap:density', $density, $ns['gap']);
}
copy($this->vdir . '/splash/768x1024.png', $this->vdir . '/splash.png');
file_put_contents($this->vdir . '/config.xml', $config->asXML());
$im = imagecreatetruecolor($width, $height);
// Draw Background
- $back = imagecolorhexallocate($this->theme->parametres->backgroundColor);
+ $back = imagecolorhexallocate($im, $this->theme->parametres->backgroundColor);
imagefill($im, 0, 0, $back);
// Draw image
$this->_drawBackImage($im, $width, $height);