From: vincent@cubedesigners.com Date: Thu, 30 May 2013 12:32:18 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=61ee7a40baab508d1b8b6853aa666f18ff3e4f8e;p=cubeextranet.git --- diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 67f585fc5..7e16ce0b5 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -230,11 +230,13 @@ class wsBookParametres extends wsParametres { //. $this->fields['externalArchives'] = array('type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Archives'), 'grade' => 3, 'fileFilter' => $imageFilter); + $this->fields['externalArchivesBack'] = array('type' => 'freefile', 'default' => '', 'editable' => true, + 'label' => __('Image de fond'), 'grade' => 3, 'fileFilter' => $imageFilter); $this->fields['archivesLink'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Lien'), 'grade' => 5); $this->fields['archivesLabel'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Label'), 'grade' => 5); $this->forms['archives'] = array('label' => __('Archives'), - 'fieldsnames' => array('externalArchives', '|', 'archivesLink', 'archivesLabel')); + 'fieldsnames' => array('externalArchives', 'externalArchivesBack', '|', 'archivesLink', 'archivesLabel')); // . $this->fields['basket'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Panier activé'), 'grade' => 5); $this->fields['basketManager'] = array('type' => 'combo', 'default' => 'classic', 'editable' => true, 'label' => __("Manager de panier"), diff --git a/inc/ws/Util/html5/class.ws.html5.compiler.php b/inc/ws/Util/html5/class.ws.html5.compiler.php index 8b650c254..6beb9b002 100644 --- a/inc/ws/Util/html5/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/class.ws.html5.compiler.php @@ -259,9 +259,9 @@ class wsHTML5Compiler { $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(); } @@ -571,6 +571,22 @@ class wsHTML5Compiler { 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); @@ -613,6 +629,10 @@ class wsHTML5Compiler { 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() { @@ -663,6 +683,7 @@ class wsHTML5Compiler { $allpages = range(0, $this->book->parametres->pages + 1); $allpages[] = 'aftersearch'; $allpages[] = 'background'; + $allpages[] = 'archives'; foreach ($allpages as $i) { $c = ''; @@ -945,6 +966,7 @@ class wsHTML5Compiler { $res[] = $this->_cssBackground(); + // Archives // Header $header = 'header{'; $header.='height:' . $this->theme->parametres->menuHeight . 'px;'; @@ -1007,6 +1029,15 @@ class wsHTML5Compiler { $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();