]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 30 May 2013 12:32:18 +0000 (12:32 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 30 May 2013 12:32:18 +0000 (12:32 +0000)
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/class.ws.html5.compiler.php

index 67f585fc591694e9877b4075382863dd4ed922c9..7e16ce0b5d7c06e21c0dc17272b0aef5017d8241 100644 (file)
@@ -230,11 +230,13 @@ class wsBookParametres extends wsParametres {
                //.\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
index 8b650c25447f29720e88cdfb2802f618189456a4..6beb9b0028afaddfbf8556d694be816cc9fbbfc6 100644 (file)
@@ -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();