'fieldsnames' => array('fullscreen', 'navOrder', 'tooltipTimer', 'preload', 'pages', 'width', 'height'));\r
//.\r
//\r
- \r
+\r
$this->fields['bookmark'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Activer les marques-pages'));\r
$this->fields['bookmark_email_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut'));\r
$this->fields['bookmark_email_body'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Corps de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut'));\r
$this->forms['help'] = array('label' => __('Aide'),\r
'fieldsnames' => array('help', '|', 'helpStartup', 'helpStartupTime', '|', 'helpBookmarks', '|', 'helpArrowTooltip'));\r
// .\r
- // \r
+ //\r
$this->fields['indexAutoScroll'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Activer le scroll automatique'));\r
$this->forms['index'] = array('label' => __('Index'), 'fieldsnames' => array('indexAutoScroll'));\r
\r
// .\r
- // \r
+ //\r
$this->fields['print'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Activer l'impression"));\r
$this->fields['printMode'] = array('type' => 'combo', 'default' => 'vector', 'editable' => true, 'label' => __("Mode d'impression"),\r
'datas' => array(__('Bitmap') => 'bitmap',\r
$this->fields['videoReset'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Réinitialiser les vidéos après la lecture'), 'grade' => 3);\r
$this->fields['videoBigPlay'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Afficher le gros bouton Play'), 'grade' => 3);\r
$this->forms['multimedia'] = array('label' => __('Liens et multimédia'),\r
- 'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass','ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'videoReset', 'videoBigPlay'));\r
+ 'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass', 'ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'videoReset', 'videoBigPlay'));\r
//.\r
$this->fields['externalArchives'] = array('type' => 'freefile', 'default' => '', 'editable' => true,\r
'label' => __('Archives'), 'grade' => 3, 'fileFilter' => $swfFilter);\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
+ $defaultScreenshots = "P,0\nL,2\nL,index";\r
+ $this->fields['appScreenshots'] = array('type' => 'textarea', 'default' => $defaultScreenshots, 'editable' => true, 'label' => 'Générer les screenshots', 'grade' => 5, 'hint' => __('Une ligne par vue à générer de la forme X,Y (X : P(ortrait) ou L(andscape), Y : numéro de page ou vue (1, index))'));\r
\r
$this->forms['phonegap'] = array('label' => __('Applications mobile'),\r
- 'fieldsnames' => array('phonegapId', 'phonegapVersion', 'phonegapPlugins'));\r
+ 'fieldsnames' => array('phonegapId', 'phonegapVersion', 'phonegapPlugins', 'appScreenshots'));\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
unlink($vdir . '/widget.html');
unlink($vdir . '/cache.appcache');
+ $this->makeScreenshots();
if ($this->makeResources) {
if ($os == 'ios') {
}
}
+ protected function makeScreenshots() {
+ $resolutions = array('ipad' => '1024x768', 'iphone3-5' => '960x640', 'iphone-4' => '1136x640');
+
+ $views = array();
+ $s=str_replace("\r","\n", $this->book->parametres->appScreenshots);
+ $screenshots=explode("\n",$s);
+
+ foreach ($screenshots as $v) {
+ $v = trim($v);
+ if ($v == '') {
+ continue;
+ }
+ list($orientation, $view) = explode(',', $v);
+
+ if (is_numeric($view)) {
+ $url = '/page/' . $view;
+ } else {
+ $url = '/' . $view;
+ }
+ $views[] = array('orientation' => $orientation, 'url' => $url);
+ }
+
+ $baseUrl = 'http://workshop.fluidbook.com/viewerh/' . $this->book->book_id . '_' . $this->book->hash . '_' . $this->book->compilehtml5date . '/index.html#';
+
+
+ foreach ($resolutions as $n => $res) {
+
+ list($w, $h) = explode('x', $res);
+ $dir = $this->vdir . '/screenshots/' . $n . '/';
+ if(!file_exists($dir)){
+ mkdir($dir,0777,true);
+ }
+
+ foreach ($views as $k => $view) {
+ if ($view['orientation'] == 'P') {
+ $screenWidth = $w;
+ $screenHeight = $h;
+ } else {
+ $screenWidth = $h;
+ $screenHeight = $w;
+ }
+ $url = $baseUrl . $view['url'];
+ $out = $dir . '/' . $k . '.png';
+
+ $cl = new cubeCommandLine('xvfb-run');
+ $cl->setArg('server-args', '-screen 0, ' . $screenWidth . 'x' . $screenHeight . 'x24');
+ $cl->setArg(null, 'cutycapt');
+ $cl->setArg('min-width',$screenWidth);
+ $cl->setArg('min-height',$screenHeight);
+ $cl->setArg('user-styles','http://workshop.fluidbook.com/style/ws/html5-screenshot.css');
+ $cl->setArg('url', $url);
+ $cl->setArg('delay', '1000');
+ $cl->setArg('out', $out);
+ $cl->execute();
+ }
+ }
+ }
+
protected function makeAndroidResources($resources) {
$icons = array('drawable' => 96,
'drawable-hdpi' => 72,
protected function _makeIcon($size, $name, $dir, $os = '') {
$os = strtolower($os);
- $icoos = $os.'icon';
+ $icoos = $os . 'icon';
if (isset($this->theme->parametres->$icoos) && $this->theme->parametres->$icoos != '') {
$base = $this->themeRoot . '/' . $this->theme->parametres->$icoos;
$it = new cubeImageTools();
$it->loadImage($base);
- $it->resize($size, $size, 'ratio',false,'C','M','transparent');
+ $it->resize($size, $size, 'ratio', false, 'C', 'M', 'transparent');
$it->output('png', $dir . '/' . $name . '.png');
}