// .
//
$this->fields['print'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Activer l'impression"));
+ $this->fields['printFullBrochure'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Autoriser l'impression de la brochure complète"));
+ $this->fields['printPageRange'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Activer l'option pour imprimer une plage de pages"));
$this->fields['printMode'] = array('type' => 'combo', 'default' => 'vector', 'editable' => true, 'label' => __("Mode d'impression"),
'datas' => array(__('Bitmap') => 'bitmap',
__('Vectoriel') => 'vector',
__('PDF') => 'pdf'));
$this->fields['printCoverWithMarks'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Imprimer les couvertures avec les pages marquées"), 'grade' => 3);
$this->forms['print'] = array('label' => __('Impression'),
- 'fieldsnames' => array('print', 'printMode', 'printCoverWithMarks'));
+ 'fieldsnames' => array('print', 'printFullBrochure', 'printPageRange', 'printMode', 'printCoverWithMarks'));
$this->fields['search'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Activer le moteur de recherche'));
public $logtime = null;
public $beginBody = array();
public $seoArticles = [];
- public $securityPolicyWhitelist = ['*.google-analytics.com', '*.youtube.com', '*.ytimg.com'];
+ public $securityPolicyWhitelist = ['*.google-analytics.com', '*.youtube.com', '*.ytimg.com', '*.googletagmanager.com'];
public $writeLinksData = false;
public $content_lock = [];
protected $_indexVars = null;
public $_signature;
/**
- * @var wsHTML5Seo
+ * @var wsHTML5SeolinksData
*/
public $seo = null;
$this->writeExtras();
$this->log('Extras written');
$this->populateConfig();
- $this->writeCSS('data/style/style_%d.css', $linksCSS);
+ $this->writeCSS($linksCSS);
$this->log('CSS written');
$this->writeIndex();
$this->log('Index written');
}
$this->writeJs();
$this->log('Js written');
- $this->vdir->sync($delete);
+ $this->vdir->sync($delete, $this);
$this->log('Files Synced');
}
protected function _writeIndex($page)
{
-
if (!isset($this->seo->pages[$page])) {
return;
}
$seo = $this->seo->pages[$page];
$html = $seo->getHTML();
- $iv = $this->getIndexVars();
-
- foreach ($iv as $k => $v) {
- $html = str_replace($k, $v, $html);
- }
-
if ($this->book->parametres->seoVersion) {
$seo->writePage($html, $this->vdir);
}
if ($page == 1) {
$seo->writePage($html, $this->vdir, 'index.html');
}
+
+ if ($page % 10 == 0) {
+ $this->log('Written page ' . $page);
+ }
}
public function getIndexVars()
protected function writeIndex()
{
+ $iv = $this->getIndexVars();
+ foreach ($iv as $k => $v) {
+ $this->seo->html = str_replace($k, $v, $this->seo->html);
+ }
if ($this->book->parametres->seoVersion) {
foreach ($this->pages as $page => $infos) {
$this->_writeIndex($page);
copy($tmp, $minimized);
}
- if (!file_exists($minimized)) {
+ if (!file_exists($minimized) || filesize($minimized) == 0) {
die('An error occured while uglifying : ' . $uglify->output);
}
}
$this->_makeCover($docdir . 'html/t36-' . $infos['document_page'] . '.jpg');
}
- $this->log('Copied image ' . $page);
+ if ($page % 10 == 0) {
+ $this->log('Copied image ' . $page);
+ }
}
return $val ? 'true' : 'false';
}
- protected function writeCSS($file, $links)
+ protected function writeCSS($links)
{
$res = array();
$left = $w;
+ $centerOffset = 0;
if ($this->book->parametres->correctCenter) {
$centerOffset = 3;
$left = ($cssWidth - $centerOffset) . 'px';
$res[] = '.doublePage._3d .page.left{left:-' . ($centerOffset + 1) . 'px !important;}';
}
+ $lessVariables['correct-center'] = ($centerOffset * -1);
$res[] = '.doublePage._3d{left:' . $left . ';}';
$res[] = '#links.right{left:-' . $left . ';}';
# ZoomPopup close button background
$res[] = '.zoomPopupClose {background-color:' . wsHTML5::colorToCSS($this->theme->parametres->couleurB) . ';}';
+ if ($this->book->parametres->textPopupStylesheet) {
+ $res[] = file_get_contents($this->wdir . '/' . $this->book->parametres->textPopupStylesheet);
+ }
$this->_writeLess($lessVariables, $lessContents);
-
- $res = array_chunk($res, 3500);
- foreach ($res as $k => $css) {
- $this->stylesheets[] = 'data/style/style_' . $k . '.css';
- $this->vdir->file_put_contents(sprintf($file, $k), implode("\n", $css));
- $this->log('Write CSS ' . sprintf($file, $k));
- }
- return count($res);
+ $this->stylesheets[] = 'data/style/style.css';
+ $this->vdir->file_put_contents('data/style/style.css', implode("\n", $res));
+ $this->log('Write CSS');
}
protected function _writeLess($variables, $lessContents = '')