-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$lang" lang="$lang">\r
+<!DOCTYPE html>\r
+<html>\r
<head>\r
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
- <meta http-equiv="Cache-Control" content="max-age=0" />\r
- <meta http-equiv="Cache-Control" content="no-cache" />\r
- <meta http-equiv="Expires" content="0" />\r
- <meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />\r
- <meta http-equiv="Pragma" content="no-cache" />\r
- <meta http-equiv="X-UA-Compatible" content="IE=Edge" />\r
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\r
+ <meta http-equiv="Cache-Control" content="max-age=0">\r
+ <meta http-equiv="Cache-Control" content="no-cache">\r
+ <meta http-equiv="Expires" content="0">\r
+ <meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT">\r
+ <meta http-equiv="Pragma" content="no-cache">\r
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=IE8">\r
$favicon\r
$robots\r
$facebook\r
+ $description\r
<title>$title</title>\r
- <link href="style.css?junk=$junk" rel="stylesheet" type="text/css" />\r
+ <link href="style.css?junk=$junk" rel="stylesheet" type="text/css">\r
<style type="text/css" media="print">*{ visibility: hidden; display: none }</style>\r
<script type="text/javascript" src="fluidbook.js?junk=$junk"></script>\r
<script type="text/javascript">FB_DEFAULT_LANG='$lang';</script>\r
$res = commonPage::barre();
$res .= commonPage::tMain();
$res .= commonPage::bh();
+ $res.='<style type="text/css">
+ @media all and (orientation: portrait) {
+ #ol{display:none;}
+ }
+
+ @media all and (orientation: landscape) {
+ #op{display:none;}
+ } </style>';
$res.='<table class="liste">';
$res.='<tr><th colspan="2"><strong>' . __('Informations concernant votre navigateur') . '</strong></th></tr>';
$res.='<tr><td>' . __('Navigateur') . '</td><td>' . $_SERVER['HTTP_USER_AGENT'] . '</td></tr>';
$res.='H264 : <span class="f" data-feature="video.h264"></span><br />';
$res.='WEBM : <span class="f" data-feature="video.webm"></span><br />';
$res.='</td></tr>';
+ $res.='<tr><td>' . __("Orientation de l'écran") . '</td><td><span id="op">'.__('Portrait').'</span><span id="ol">'.__('Paysage').'</span></td></tr>';
+ $res.='<tr><td>' . __("Largeur de l'écran") . '</td><td id="swidth"></td></tr>';
+ $res.='<tr><td>' . __("Hauteur de l'écran") . '</td><td id="sheight"></td></tr>';
$res.='</table>';
$res .= '</div>';
$res .= commonPage::bf();
\r
$s->setTitle(cubeText::str2URL($lang_name));\r
\r
- $tab = cubeLang::getTranslationsList(PLAYER_SOURCES, array('php', 'as'), array(), $lang->traductions);\r
+ $tab = cubeLang::getTranslationsList(array(PLAYER_SOURCES, WS_COMPILE_ASSETS . '/_html5/js'), array('php', 'as','js'), array(), $lang->traductions);\r
\r
$s->setCellValueByColumnAndRow(0, 1, 'ID', true);\r
$s->setCellValueByColumnAndRow(1, 1, $ref_name, true);\r
\r
$this->fields['seoVersion'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Générer une version pour les moteurs de recherche'));\r
$this->fields['seoRobots'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Autoriser le parcours par les moteurs de recherche'));\r
+ $this->fields['seoDescription'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Meta tag Description'));\r
\r
$this->forms['seo'] = array('label' => __('Optimisation pour les moteurs de recherche'),\r
- 'fieldsnames' => array('seoVersion', 'seoRobots'));\r
+ 'fieldsnames' => array('seoVersion', 'seoRobots', 'seoDescription'));\r
\r
$this->fields['plv'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Activer le mode PLV'), 'grade' => 3);\r
$this->fields['plvTimer'] = array('type' => 'integer', 'min' => 1, 'max' => 60, 'default' => 5, 'editable' => true, 'label' => __('Temps'), 'grade' => 3);\r
}
$style = array();
foreach ($sheets as $sheet) {
- $style[] = '<link type="text/css" rel="stylesheet" href="' . $sheet . '" />';
+ $style[] = '<link type="text/css" rel="stylesheet" href="' . $sheet . '">';
}
$style = implode("\n\t\t", $style);
$script = '<script type="text/javascript" src="data/fluidbook.js"></script>';
- $vars = array('titre', 'credits', 'ga', 'style', 'script', 'pagesContents');
+ $description = '';
+ if ($this->book->parametres->seoDescription) {
+ $description = '<meta name="description" content="' . html::escapeHTML($this->book->parametres->seoDescription) . '">';
+ }
+
+ $vars = array('titre', 'credits', 'ga', 'style', 'script', 'pagesContents', 'description');
foreach ($vars as $v) {
$html = str_replace('<!-- $' . $v . ' -->', $$v, $html);
}
$favicon = '';\r
\r
if ($this->theme->parametres->favicon != '') {\r
- $favicon = '<link rel="shortcut icon" href="data/fluidbook.ico" />';\r
+ $favicon = '<link rel="shortcut icon" href="data/fluidbook.ico">';\r
}\r
\r
$redirectPDF = 'window.location="data/document.pdf";';\r
\r
$robots = '';\r
if (!$seoRobot) {\r
- $robots = '<meta name="robots" content="noindex, nofollow" />';\r
+ $robots = '<meta name="robots" content="noindex, nofollow">';\r
+ }\r
+\r
+ $description = '';\r
+ if ($this->book->parametres->seoDescription) {\r
+ $description = '<meta name="description" content="' . self::escape($this->book->parametres->seoDescription) . '">';\r
}\r
\r
// Stuffs to replace in html\r
$toReplace = array('lang' => strtolower($this->book->lang),\r
- 'title' => self::escape($this->book->parametres->title),\r
'ga' => $ga,\r
'facebook' => $facebook,\r
'bgcolor' => $this->theme->parametres->loadingBackColor,\r
'redirectMobile' => $redirectMobile,\r
'redirectPDF' => $redirectPDF,\r
'junk' => TIME,\r
+ 'description' => $description,\r
'robots' => $robots,\r
'favicon' => $favicon,\r
'flashversion' => $this->getMinFlashVersion(),\r
'fv' => json_encode($this->getFlashvars()));\r
\r
+\r
$this->origHTML = file_get_contents($this->vdir . '/index.html');\r
$this->origHTML = $this->replaceHTML($toReplace);\r
\r
$redirectScript = '';\r
if ($page == 1) {\r
$dest = 'index.html';\r
+ $title = $this->book->parametres->title;\r
} else {\r
- $dest = 'pages/page' . $page . '.html';\r
+ $label = $this->_getLabelOfPage($page);\r
+ $title = $label . ' - ' . $this->book->parametres->title;\r
+ $dest = 'pages/' . $page . '-' . cubeText::str2URL($label) . '.html';\r
$pathToIndex = '../index.swf';\r
$pathToGetflash = '../getflash.gif';\r
$redirectScript = '<script type="text/javascript">window.location=\'../index.html#/' . $page . '\';</script>';\r
\r
$data = str_replace('$alt', $alt, $this->origHTML);\r
$data = str_replace('$pathToIndex', $pathToIndex, $data);\r
+ $data = str_replace('$title', $this->escape($title), $data);\r
$data = str_replace('$pathToGetflash', $pathToGetflash, $data);\r
$data = str_replace('$redirectScript', $redirectScript, $data);\r
\r
protected function makeHTMLNav($root) {\r
$res = '<ul id="nav">';\r
foreach ($this->pages as $page => $infos) {\r
+ $label = $this->_getLabelOfPage($page);\r
if ($page == 1) {\r
if ($root) {\r
$url = 'index.html';\r
}\r
} else {\r
if ($root) {\r
- $url = 'pages/page' . $page . '.html';\r
+ $url = 'pages/' . $page . '-' . cubeText::str2URL($label) . '.html';\r
} else {\r
- $url = 'page' . $page . '.html';\r
+ $url = $page . '-' . cubeText::str2URL($label) . '.html';\r
}\r
}\r
- $res .= '<li><a href="' . $url . '">Page ' . $page . '</a></li>';\r
+ $res .= '<li><a href="' . $url . '">' . $label . '</a></li>';\r
}\r
$res .= '</ul>';\r
return $res;\r
}\r
\r
+ protected function _getLabelOfPage($page) {\r
+ if($page==1){\r
+ return $this->book->parametres->title;\r
+ }\r
+ \r
+ $chapters = $this->book->chapters;\r
+ $virtual = $this->_getVirtualPage($page);\r
+ \r
+ \r
+\r
+ $candidates = array();\r
+ foreach ($chapters as $c) {\r
+ if ($c->page == $virtual) {\r
+ $candidates[] = $c;\r
+ }\r
+ }\r
+ if (!count($candidates)) {\r
+ return $this->_getLabelOfPage($page-1);\r
+ }\r
+\r
+ usort($candidates, array($this, '_sortCandidates'));\r
+ $c=array_shift($candidates);\r
+ return $c->label;\r
+ }\r
+\r
+ protected function _sortCandidates($a, $b) {\r
+ if ($a->level > $b->level) {\r
+ return 1;\r
+ } else if ($a->level < $b->level) {\r
+ return -1;\r
+ } else {\r
+ return 0;\r
+ }\r
+ }\r
+\r
+ protected function _getVirtualPage($page) {\r
+ $num = explode(',',$this->book->numerotation);\r
+ if (isset($num[$page - 1])) {\r
+ return $num[$page - 1];\r
+ }\r
+ return 1;\r
+ }\r
+\r
protected function escape($txt) {\r
return htmlentities($txt, ENT_COMPAT, 'UTF-8');\r
}\r
$('.f').each(function(){
$(this).html(getModernizrValue($(this).attr('data-feature')));
});
+
+ $(window).resize(infosResize);
+ infosResize();
+}
+
+function infosResize(){
+ $("#swidth").html(screen.width);
+ $("#sheight").html(screen.height);
}
function getModernizrValue(f){