]> _ Git - cubeextranet.git/commitdiff
Merge changes from master branch. WIP #1852 @0.25
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 30 Jan 2018 19:25:25 +0000 (19:25 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 30 Jan 2018 19:25:25 +0000 (19:25 +0000)
inc/ws/Util/html5/landing-page/class.ws.html5.compiler.php
inc/ws/Util/html5/landing-page/class.ws.html5.links.php

index 339a2853ee5b76bdf625f61bcb069ae8a1936d02..760ff5cc27c31db099a6214081b24a6dc70e6cd8 100644 (file)
@@ -1293,6 +1293,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);
@@ -1360,11 +1362,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();
 
@@ -1449,6 +1449,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);
@@ -1469,7 +1483,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) {
@@ -1480,7 +1494,7 @@ class wsHTML5Compiler {
                return count($res);
        }
 
-       protected function _writeLess($variables) {
+       protected function _writeLess($variables, $lessContents = '') {
                if ($this->widget) {
                        $this->lessFiles[] = 'widget';
                }
@@ -1498,9 +1512,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 4781c065551c4c555fb4f74b069e46c39f750dd5..997d37a810ffe7703b38cd7a5a1f31b70a8299c9 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);