function getLocation(){\r
return window.location.toString();\r
}\r
-function parseGet(){\r
+function getFlashvars(junk){\r
var couples=window.location.search.substr(1).split('&');\r
var res=new Array();\r
var couple=new Array();\r
couple=couples[i].split('=');\r
res[couple[0]]=couple[1];\r
}\r
+ res['junk']=junk;\r
return res;\r
}\r
function getLang(){\r
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$lang" lang="$lang">\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
+$robots\r
$facebook\r
<title>$title</title>\r
-<link href="style.css" rel="stylesheet" type="text/css" />\r
-<script type="text/javascript" src="fluidbook.js"></script>\r
+<link href="style.css?junk=$junk" rel="stylesheet" type="text/css" />\r
+<script type="text/javascript" src="fluidbook.js?junk=$junk"></script>\r
<script type="text/javascript">FB_DEFAULT_LANG='$lang';</script>\r
$redirectScript\r
</head>\r
if(isMobile()){\r
$redirectMobile\r
}else{\r
- swfobject.embedSWF("$pathToIndex", "fluidbook", "100%", "100%", "10.0.22","", parseGet(), {"allowScriptAccess":"always","quality":"high","scale":"noscale","wmode":getWmode(),"allowFullScreen":"true"},{"bgcolor":"#$bgcolor"});\r
+ swfobject.embedSWF("$pathToIndex?junk=$junk", "fluidbook", "100%", "100%", "10.0.22","", getFlashvars($junk), {"allowScriptAccess":"always","quality":"high","scale":"noscale","wmode":getWmode(),"allowFullScreen":"true"},{"bgcolor":"#$bgcolor"});\r
}\r
</script>\r
$ga\r
\r
$dao = new wsDAODocument($core->con);\r
$dao->setLinksAndRulers($book_id, json_encode($links), json_encode($rulers), 'Import from excel', $core->user->utilisateur_id);\r
+ \r
+ $specialLinks=array();\r
+ foreach($links as $l){\r
+ if(is_int($l['page'])){\r
+ continue;\r
+ }\r
+ $specialLinks[]=$l;\r
+ }\r
+ $specialRulers=array();\r
+ foreach($rulers as $r){\r
+ if(is_int($r['page'])){\r
+ continue;\r
+ }\r
+ $specialRulers[]=$r;\r
+ }\r
+ \r
+ \r
+ $daoBook = new wsDAOBook($core->con);\r
+ $daoBook->setSpecialLinksAndRulers($book_id, json_encode($specialLinks), json_encode($specialRulers));\r
+ \r
}\r
\r
}\r
$rulers = array();\r
\r
foreach ($t as $page => $tt) {\r
+ if(!is_int($page)){\r
+ continue;\r
+ }\r
$infos = $pages[$page];\r
$doc_id = $infos['document_id'];\r
$doc_page = $infos['document_page'];\r
$this->forms['secure'] = array('label' => __('Sécurisation'),\r
'fieldsnames' => array('secureURL', 'secureURLRedirect'));\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
+\r
+ $this->forms['seo'] = array('label' => __('Optimisation pour les moteurs de recherche'),\r
+ 'fieldsnames' => array('seoVersion', 'seoRobots'));\r
\r
$this->fields['widget'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Générer le widget'), 'grade' => 5);\r
$this->fields['widgetCover'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Afficher la couverture') . ')', 'grade' => 5);\r
$origDir = WS_BOOKS . '/working/' . $this->book_id . '/';
$types = array('mp4', 'ogv', 'webm', 'jpg');
if ($video) {
- wsTools::encodeWebVideos($origDir . $source, null, false);
+ wsTools::encodeWebVideos($origDir . $source, null, true);
$e = explode('.', $source);
array_pop($e);
$base = implode('.', $e);
$this->prepareHTML5();\r
}\r
\r
+ $seoVersion = true;\r
+ if (isset($this->book->parametres->seoVersion)) {\r
+ $seoVersion = $this->book->parametres->seoVersion;\r
+ }\r
+\r
+ $seoRobot = true;\r
+ if (isset($this->book->parametres->seoRobot)) {\r
+ $seoRobot = $this->book->parametres->seoRobot;\r
+ }\r
+\r
+ $robots = '';\r
+ if (!$seoRobot) {\r
+ $robots='<meta name="robots" content="noindex, nofollow" />';\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, 'facebook' => $facebook,\r
'bgcolor' => $this->theme->parametres->loadingBackColor,\r
- 'redirectMobile' => $redirectMobile);\r
+ 'redirectMobile' => $redirectMobile,\r
+ 'junk' => TIME,\r
+ 'robots' => $robots);\r
\r
$this->origHTML = file_get_contents($this->vdir . '/index.html');\r
$this->origHTML = $this->replaceHTML($toReplace);\r
\r
$htmlfile = WS_DOCS . '/' . $infos['document_id'] . '/h' . $infos['document_page'] . '.txt';\r
\r
- if (file_exists($htmlfile)) {\r
+ if ($seoVersion && file_exists($htmlfile)) {\r
$html = file_get_contents($htmlfile);\r
$alt .= "\n" . $html . "\n";\r
- }\r
\r
- if ($page == 1) {\r
- $alt .= $nav1;\r
- } else {\r
- $alt .= $nav;\r
+\r
+ if ($page == 1) {\r
+ $alt .= $nav1;\r
+ } else {\r
+ $alt .= $nav;\r
+ }\r
}\r
+\r
+\r
$alt .= $footer;\r
\r
$data = str_replace('$alt', $alt, $this->origHTML);\r
$data = str_replace('$redirectScript', $redirectScript, $data);\r
\r
file_put_contents($this->vdir . $dest, $data);\r
+\r
+ if (!$seoVersion) {\r
+ break;\r
+ }\r
}\r
}\r
\r
$cp = new cubeCommandLine('cp');\r
$cp->setPath(CONVERTER_PATH);\r
$cp->setArg('r');\r
- $cp->setArg(null,WS_BOOKS . '/html5/' . $this->book_id . '/*');\r
- $cp->setArg(null,$dest);\r
+ $cp->setArg(null, WS_BOOKS . '/html5/' . $this->book_id . '/*');\r
+ $cp->setArg(null, $dest);\r
$cp->execute();\r
\r
$filesToDelete = array('indext.html', 'indexu.html', 'data/datas.js');\r
$rm = new cubeCommandLine('rm');\r
$rm->setPath(CONVERTER_PATH);\r
foreach ($filesToDelete as $f) {\r
- $rm->setArg(null, $dest.'/'.$f);\r
+ $rm->setArg(null, $dest . '/' . $f);\r
}\r
$rm->execute();\r
}\r
url : SITE_PATH+'ajax/'+$(this).attr('action'),\r
success : function(data){\r
window.opener.document.getElementById("composerSwf").reloadLinks();\r
- window.close(); \r
+ //window.close(); \r
}\r
});\r
return false;\r
$.ajax({\r
url : SITE_PATH+'ajax/restoreLinksVersion/'+$(this).attr('rel'),\r
success : function(data){\r
- //window.opener.location=window.opener.location;\r
window.opener.document.getElementById("composerSwf").reloadLinks();\r
window.close();\r
}\r