<!doctype html>\r
<html>\r
<head>\r
+ <title>$titre</title>\r
+ <meta charset="utf-8">\r
<meta name="viewport" content="width=device-width">\r
+ $description\r
+ $opengraph\r
+ $twittercard\r
+ <style type="text/css">\r
+ * {\r
+ padding: 0;\r
+ margin: 0;\r
+ }\r
+ body, html {\r
+ background-color: #$bgcolor;\r
+ width: 100%;\r
+ height: 100%;\r
+ }\r
+ footer {\r
+ visibility: hidden;\r
+ }\r
+ </style>\r
<script>\r
var redirect;\r
var locationWithoutHash = window.location.href.split('#')[0];\r
window.location = './' + redirect + '/index.html?hybrid=1&from=' + encodeURIComponent(locationWithoutHash) + hash;\r
</script>\r
</head>\r
-<body style="background-color: #$bgcolor;">\r
+<body>\r
+ <footer id="credits">$credits</footer>\r
</body>\r
</html>
\ No newline at end of file
public static $pagesOfBookCache = array();
+ /** @var wsHTML5Compiler */
+ public static $lastHTML5Compiler = null;
+
/**
* wsDAOBook::singleton()
*
$numerotation = array();
$nb_pages = 0;
foreach ($pages as $p) {
- if($setNumerotation) {
+ if ($setNumerotation) {
$numerotation[] = $p->virtual;
}
$nb_pages++;
$c = $this->con->openCursor('books');
$c->parametres = serialize($parametres);
- if($setNumerotation) {
+ if ($setNumerotation) {
$c->numerotation = implode(',', $numerotation);
}
$c->changedate = TIME;
$htmlCompiler = wsHTML5::compilerFactory($book_id, $version, false, 'latest', null, false, false, false, $book);
$htmlCompiler->compile($delete);
+
+ self::$lastHTML5Compiler = $htmlCompiler;
+
}
/* public function indexPDF($book, $pages) {
$text = str_replace(array_keys($replace), array_values($replace), $text);
- if( $this->book->parametres->audiodescriptionVoice) {
+ if ($this->book->parametres->audiodescriptionVoice) {
$hash = hash('sha256', $this->book->parametres->audiodescriptionVoice . '_^_' . $text);
$fname = $hash . '.mp3';
$dir = WS_BOOKS . '/audiodescription/';
$socialImageWidth = $dim[0];
$socialImageHeight = $dim[1];
+ $titre = $this->book->parametres->title;
+
+ $description = '<meta name="description" content="' . $this->seo->pages[1]->description . '">';
+
$twittercard = '<meta name="twitter:title" content="' . $socialTitle . '">
<meta name="twitter:description" content="' . $socialDescription . '">
<meta name="twitter:image" content="' . $socialImage . '">
if ($this->phonegap) {
$csp = "<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'self' data: gap: 'unsafe-inline' *; style-src 'self' 'unsafe-inline'; font-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' " . implode(' ', array_unique($this->securityPolicyWhitelist)) . "; img-src * data:\">";
}
- $vars = array('credits', 'style', 'script', 'pagesContents', 'print', 'hiddenContents', 'splash', 'splashstyles', 'cache', 'bgcolor', 'message', 'favicon', 'svg', 'beginbody', 'csp', 'opengraph', 'twittercard');
+ $vars = array('titre', 'credits', 'style', 'script', 'pagesContents', 'print', 'hiddenContents', 'splash', 'splashstyles', 'cache', 'bgcolor', 'message', 'favicon', 'svg', 'beginbody', 'csp', 'opengraph', 'twittercard', 'description');
$res = [];
foreach ($vars as $v) {
* @var wsHTML5Compiler\r
*/\r
public $compiler;\r
+ /**\r
+ * @var wsHTML5SeoPage[]\r
+ */\r
public $pages;\r
public $html;\r
protected $_nav = null;\r
if ($mfid != '' && (int)$mfid > 0) {
$mfbook = $this->daoBook->selectById($mfid);
$this->_compileHTML5($this->book_id, $this->book, $dest . '/d');
+ $vars = wsDAOBook::$lastHTML5Compiler->getIndexVars();
$this->_compileHTML5($mfid, $mfbook, $dest . '/mf');
$hybrid = file_get_contents(WS_COMPILE_ASSETS . '/hybrid/index.html');
$replace = [
+ 'titre' => $vars['<!-- $titre -->'],
'breakpoint' => $this->book->parametres->mobilefirstBreakpoint . 'px',
- 'bgcolor' => $this->theme->parametres->loadingBackColor
+ 'bgcolor' => $this->theme->parametres->loadingBackColor,
+ 'description' => $vars['<!-- $description -->'],
+ 'twittercard' => $vars['<!-- $twittercard -->'],
+ 'opengraph' => $vars['<!-- $opengraph -->'],
+ 'credits' => $vars['<!-- $credits -->'],
];
foreach ($replace as $var => $value) {
$hybrid = str_replace('$' . $var, $value, $hybrid);