INDEX_EXT = '$index_ext';
var backgroundColor = "$bgcolor";
function redirect() {
+
+
if (isMobile() || $alwaysHTML5) {
$redirectMobile
} else if (isBadMobile()) {
$redirectPDF
} else {
+ if ($html5priority && supportHTML5Version() && !swfobject.hasFlashPlayerVersion("$flashversion")) {
+ $redirectMobile
+ return;
+ }
+
document.getElementById('fluidbook').style.opacity = 1;
swfobject.embedSWF("$pathToIndex?junk=$junk", "fluidbook", "100%", "100%", "$flashversion", "", getFlashvars($junk, $fv), {
"allowScriptAccess": "always",
$this->forms['offline'] = array('label' => __('Version offline'),
'fieldsnames' => array('offlineTitle', 'offlineLink'));
- $this->fields['alwaysHTML5'] = array('type' => 'boolean', 'default' => 'false', 'editable' => true, 'label' => __('Toujours utiliser la version HTML5'), 'grade' => 3);
+ $this->fields['alwaysHTML5'] = array('type' => 'boolean', 'default' => 'true', 'editable' => true, 'label' => __('Toujours utiliser la version HTML5'), 'grade' => 3);
$this->fields['mobileVersion'] = array('type' => 'combo', 'default' => 'html5-images', 'editable' => true, 'label' => __('Version mobile'), 'grade' => 3,
'datas' => array(__('Rediriger vers le PDF') => 'pdf',
__('Version HTML5') => 'html5',
__("Version HTML5 en images") => 'html5-images')
);
+ $this->fields['html5priority'] = array('type' => 'boolean', 'default' => 'true', 'editable' => true, 'label' => __("Si flash n'est pas installé, rediriger vers la version HTML5"), 'grade' => 3);
+
$this->fields['navOrderH'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Ordre des icônes dans la nav') . ' (' . __('Si différente') . ')', 'grade' => 3);
$this->fields['mobileIgnoreBackgroundLinks'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Ignorer les liens de background'));
$this->forms['mobile'] = array('label' => __('Version mobile'),
- 'fieldsnames' => array('alwaysHTML5', 'mobileLVersion', 'mobileVersion', 'mobileNavigationType', '|', 'mobileNavScale', '|', 'mobileTransitions', 'mobileTransitionDuration', '|', 'navOrderH', '|', 'mobileIconVector', 'mobileServerConfig', 'mobilePlugins', '|', 'mobileVideosPath', '|', 'mobileExtraXSpace', '|', 'mobileIgnoreBackgroundLinks'));
+ 'fieldsnames' => array('alwaysHTML5', 'html5priority', 'mobileLVersion', 'mobileVersion', 'mobileNavigationType', '|', 'mobileNavScale', '|', 'mobileTransitions', 'mobileTransitionDuration', '|', 'navOrderH', '|', 'mobileIconVector', 'mobileServerConfig', 'mobilePlugins', '|', 'mobileVideosPath', '|', 'mobileExtraXSpace', '|', 'mobileIgnoreBackgroundLinks'));
$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');
$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');
$alwaysHTML5 = 'false';
}
+ if (!isset($this->book->parametres->html5priority)) {
+ $this->book->parametres->html5priority = true;
+ }
+ $html5priority = CubeIT_Util_Bool::boolval($this->book->parametres->html5priority, false, true);
+
// Stuffs to replace in html
$toReplace = array('lang' => strtolower($this->book->lang),
'ga' => $ga,
'flashversion' => $this->getMinFlashVersion(),
'fv' => json_encode($this->getFlashvars()),
'alwaysHTML5' => $alwaysHTML5,
+ 'html5priority' => $html5priority,
'keywords' => $keywords,
'allowNetworking' => $this->_allowNeworking);
-
$this->origHTML = $this->book->parametres->htmlPrepend . file_get_contents($this->vdir . '/index.html');
unlink($this->vdir . '/index.html');
$this->origHTML = $this->replaceHTML($toReplace);