//.\r
$this->fields['externalArchives'] = array('type' => 'freefile', 'default' => '', 'editable' => true,\r
'label' => __('Archives'), 'grade' => 3, 'fileFilter' => $imageFilter);\r
+ $this->fields['externalArchivesBack'] = array('type' => 'freefile', 'default' => '', 'editable' => true,\r
+ 'label' => __('Image de fond'), 'grade' => 3, 'fileFilter' => $imageFilter);\r
$this->fields['archivesLink'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Lien'), 'grade' => 5);\r
$this->fields['archivesLabel'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Label'), 'grade' => 5);\r
\r
$this->forms['archives'] = array('label' => __('Archives'),\r
- 'fieldsnames' => array('externalArchives', '|', 'archivesLink', 'archivesLabel'));\r
+ 'fieldsnames' => array('externalArchives', 'externalArchivesBack', '|', 'archivesLink', 'archivesLabel'));\r
// .\r
$this->fields['basket'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Panier activé'), 'grade' => 5);\r
$this->fields['basketManager'] = array('type' => 'combo', 'default' => 'classic', 'editable' => true, 'label' => __("Manager de panier"),\r
$numCSS = $this->writeCSS($this->vdir . '/data/style/style_%d.css', $linksCSS);
$this->writeLangs();
$this->writeIndex($numCSS);
- $this->writeJs();
$this->writeTexts();
$this->writeExtras();
+ $this->writeJs();
$this->writeCache();
}
return '';
}
+ protected function addFilesInfos($key, $file) {
+ if (!file_exists($file)) {
+ return;
+ }
+ if (!isset($this->config->filesInfos)) {
+ $this->config->filesInfos = array();
+ }
+ $infos = array('filesize' => filesize($file));
+ $dim = getimagesize($file);
+ if ($dim !== false) {
+ $infos['width'] = $dim[0];
+ $infos['height'] = $dim[1];
+ }
+ $this->config->filesInfos[$key] = $infos;
+ }
+
protected function writeLangs() {
global $core;
$daoLang = new wsDAOLang($core->con);
if ($this->theme->parametres->afterSearch != '') {
$this->copy($this->themeRoot . '/' . $this->theme->parametres->afterSearch, $this->vdir . '/data/images/' . $this->theme->parametres->afterSearch);
}
+ if ($this->book->parametres->externalArchives != '') {
+ $this->addFilesInfos('archives', $this->wdir . '/' . $this->book->parametres->externalArchives);
+ $this->copy($this->wdir . '/' . $this->book->parametres->externalArchives, $this->vdir . '/data/images/' . $this->book->parametres->externalArchives);
+ }
}
protected function writeLinks() {
$allpages = range(0, $this->book->parametres->pages + 1);
$allpages[] = 'aftersearch';
$allpages[] = 'background';
+ $allpages[] = 'archives';
foreach ($allpages as $i) {
$c = '';
$res[] = $this->_cssBackground();
+ // Archives
// Header
$header = 'header{';
$header.='height:' . $this->theme->parametres->menuHeight . 'px;';
$res[] = '.portrait .mview{width:' . $w . ';min-height:' . $h . '}';
$res[] = '.landscape .mview{width:' . $w2 . ';min-height:' . $h . '}';
$res[] = '.mview{background-color:' . $menuColor->toCSS() . ';color:' . self::colorToCSS($this->theme->parametres->subTextColor) . ';}';
+
+ // Archives
+
+ if ($this->book->parametres->externalArchivesBack) {
+ $this->copy($this->wdir . '/' . $this->book->parametres->externalArchivesBack, $this->vdir . '/data/images/' . $this->book->parametres->externalArchivesBack);
+ $res[] = '#archivesview{background-image:url("../images/' . $this->book->parametres->externalArchivesBack . '");}';
+ }
+
+
# Topbar
$top = $menuColor->toCSS();
$bottom = $menuMultiply->toCSS();