]> _ Git - cubeextranet.git/commitdiff
#2249
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 19 Dec 2018 17:53:58 +0000 (17:53 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 19 Dec 2018 17:53:58 +0000 (17:53 +0000)
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php

index c223466af86ea9289849f302fecf8bf6263700ed..08993ddedf33e3944205bde833865780d492f6c5 100644 (file)
@@ -61,6 +61,10 @@ class wsBookParametres extends wsParametres
                $seoFilter->name = __('Fichier Excel') . ' (.xlsx)';
                $seoFilter->extensions = '*.xlsx';
 
+               $cssFilter = new stdClass();
+               $cssFilter->name = __('Feuille de style') . ' (.css)';
+               $cssFilter->extensions = '*.css';
+
                $branches = array('master : git (stable)' => 'stable',
                        'master : local (dev)' => 'dev');
                $gitbranches = json_decode(file_get_contents(WS_CACHE . '/activebranches'));
@@ -385,8 +389,10 @@ class wsBookParametres extends wsParametres
                $this->fields['brightcovePlayerSecret'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Brightcove Player Secret'), 'grade' => 3);
                $this->fields['inlineSlideshowTransitionDuration'] = array('type' => 'float', 'default' => 0.75, 'editable' => true, 'label' => __('Durée de la transition des diaporamas intégrés aux pages (s)'));
                $this->fields['inlineSlideshowDuration'] = array('type' => 'float', 'default' => 7, 'editable' => true, 'label' => __('Temps d\'attente des diaporamas intégrés aux pages (s)'));
+               $this->fields['textPopupStylesheet'] = ['type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Feuille de style des popups de texte'), 'fileFilter' => $cssFilter];
+               $this->fields['textPopupWidth'] = ['type' => 'integer', 'default' => '600', 'editable' => true, 'label' => __('Largeur optimale des popups')];
                $this->forms['multimedia'] = array('label' => __('Liens et multimédia'),
-                       'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass', 'ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', 'linkTooltipMaxWidth', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkFilePrefix', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'inlineSlideshowTransitionDuration', 'inlineSlideshowDuration', '|', 'videoReset', 'videoBigPlay', '|', 'brightcovePlayerId', 'brightcovePlayerSecret'));
+                       'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass', 'ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', 'linkTooltipMaxWidth', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkFilePrefix', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'inlineSlideshowTransitionDuration', 'inlineSlideshowDuration', '|', 'videoReset', 'videoBigPlay', '|', 'brightcovePlayerId', 'brightcovePlayerSecret', '|', 'textPopupWidth', 'textPopupStylesheet'));
                //.
                $this->fields['externalArchives'] = array('type' => 'freefile', 'default' => '', 'editable' => true,
                        'label' => __('Archives'), 'grade' => 3, 'fileFilter' => $imageFilter);
index e712590e4ba204929b3aabfebef657450a4f894c..c3f5d27f9d84a902b354309ed7b39247e7e1b416 100644 (file)
@@ -493,7 +493,7 @@ class wsHTML5Compiler
                $this->writeExtras();
                $this->log('Extras written');
                $this->populateConfig();
-               $this->writeCSS('data/style/style_%d.css', $linksCSS);
+               $this->writeCSS($linksCSS);
                $this->log('CSS written');
                $this->writeIndex();
                $this->log('Index written');
@@ -1563,7 +1563,7 @@ class wsHTML5Compiler
                return $val ? 'true' : 'false';
        }
 
-       protected function writeCSS($file, $links)
+       protected function writeCSS($links)
        {
                $res = array();
 
@@ -1766,16 +1766,14 @@ class wsHTML5Compiler
                # ZoomPopup close button background
                $res[] = '.zoomPopupClose {background-color:' . wsHTML5::colorToCSS($this->theme->parametres->couleurB) . ';}';
 
+               if ($this->book->parametres->textPopupStylesheet) {
+                       $res[] = file_get_contents($this->wdir . '/' . $this->book->parametres->textPopupStylesheet);
+               }
 
                $this->_writeLess($lessVariables, $lessContents);
-
-               $res = array_chunk($res, 3500);
-               foreach ($res as $k => $css) {
-                       $this->stylesheets[] = 'data/style/style_' . $k . '.css';
-                       $this->vdir->file_put_contents(sprintf($file, $k), implode("\n", $css));
-                       $this->log('Write CSS ' . sprintf($file, $k));
-               }
-               return count($res);
+               $this->stylesheets[] = 'data/style/style.css';
+               $this->vdir->file_put_contents('data/style/style.css', implode("\n", $res));
+               $this->log('Write CSS');
        }
 
        protected function _writeLess($variables, $lessContents = '')