]> _ Git - cubeextranet.git/commitdiff
#1903
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 30 Jan 2018 15:07:55 +0000 (15:07 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 30 Jan 2018 15:07:55 +0000 (15:07 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 8682fcd39a62a26e9a46fdb2c1b160365da2b02c..ffcaa223737ecb0e7660351ab78dd940b737fe2c 100644 (file)
@@ -1286,6 +1286,8 @@ class wsHTML5Compiler {
        protected function writeCSS($file, $links) {
                $res = array();
 
+               $lessContents = '';
+
                $lessVariables = array();
                $lessVariables['slider-display'] = $this->_lessBoolean($this->theme->parametres->pagesBar);
                $lessVariables['slider-thumb-background'] = wsHTML5::colorToCSS($this->theme->parametres->pageBarThumbBack);
@@ -1353,11 +1355,9 @@ class wsHTML5Compiler {
                $res[] = $shade;
 
                // SVG
-
                $res[] = 'svg .fill-c-menu-back{fill:' . wsHTML5::colorToCSS($this->theme->parametres->couleurB) . ';}';
                $res[] = 'svg .fill-c-menu-text{fill:' . wsHTML5::colorToCSS($this->theme->parametres->subTextColor) . ';}';
 
-
                // Background
                $res[] = $this->_cssBackground();
 
@@ -1442,6 +1442,20 @@ class wsHTML5Compiler {
                $lessVariables['icon-color'] = wsHTML5::colorToCSS($this->theme->parametres->couleurI);
                $lessVariables['menu-overlay'] = wsHTML5::colorToCSS($this->theme->parametres->popupVideoOverlay);
 
+               // Chapters
+
+
+               foreach ($this->book->chapters as $chapter) {
+                       if (substr($chapter->page, 0, 1) != '#') {
+                               continue;
+                       }
+                       if ($chapter->color == '') {
+                               continue;
+                       }
+                       $color = trim($chapter->color, '#');
+                       $lessContents .= '.mview.c_' . $color . '{.menu-color(#' . $color . ');}';
+               }
+
                // Archives
                if ($this->book->parametres->externalArchivesBack) {
                        $this->vdir->copy($this->wdir . '/' . $this->book->parametres->externalArchivesBack, 'data/images/' . $this->book->parametres->externalArchivesBack);
@@ -1462,7 +1476,7 @@ class wsHTML5Compiler {
                $res[] = '.zoomPopupClose {background-color:' . wsHTML5::colorToCSS($this->theme->parametres->couleurB) . ';}';
 
 
-               $this->_writeLess($lessVariables);
+               $this->_writeLess($lessVariables, $lessContents);
 
                $res = array_chunk($res, 3500);
                foreach ($res as $k => $css) {
@@ -1473,7 +1487,7 @@ class wsHTML5Compiler {
                return count($res);
        }
 
-       protected function _writeLess($variables) {
+       protected function _writeLess($variables, $lessContents = '') {
                if ($this->widget) {
                        $this->lessFiles[] = 'widget';
                }
@@ -1491,9 +1505,9 @@ class wsHTML5Compiler {
                        $bookVariables[] = '@' . trim($k) . ':' . $v . ';';
                }
                file_put_contents($tmp . '/book-variables.less', implode("\n", $bookVariables));
+               file_put_contents($tmp . '/additional.less', $lessContents);
 
                foreach ($this->lessFiles as $f) {
-
                        $source_less = $this->assets . '/style/' . $f . '.less';
                        $destination_less = $tmp . '/' . $f . '.less';
                        $destination_css = $tmp . '/' . $f . '.css';
index 497fc39b19a4407e423f480adf6c983e2794cef0..0e1a1a0f73a7e83bf44848beb89c932371dc0247 100644 (file)
@@ -91,7 +91,6 @@ class wsHTML5Link {
                        case 11:
                                return new actionLink($id, $init, $compiler);
                        case 12:
-
                                return new basketLink($id, $init, $compiler);
                        case 13: // zoom area
                                return new zoomLink($id, $init, $compiler);