From 870f2cd1caff59ea11dfe78862bfd57c184924cd Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 28 Jun 2021 10:49:40 +0000 Subject: [PATCH] wip #4561 @1 --- inc/ws/Metier/class.ws.book.parametres.php | 6 ++++-- inc/ws/Metier/class.ws.theme.parametres.php | 11 ++++------ .../html5/master/class.ws.html5.compiler.php | 21 ++++++++++++++++++- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 2dc6545a6..9de8067c1 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -2,6 +2,8 @@ class wsBookParametres extends wsParametres { + public static $fonts = [ + 'Open Sans (défaut)' => 'OpenSans', 'Montserrat' => 'Montserrat', 'Arial, Helvetica, sans-serif (police système)' => 'Arial', 'Police système sans-serif' => 'sans-serif']; /** * wsBookParametres::initFields() @@ -292,6 +294,7 @@ class wsBookParametres extends wsParametres $this->fields['imageFormat'] = array('type' => 'combo', 'default' => 'jpg', 'editable' => true, 'datas' => array(/*__('Le plus léger') => 'best', */ 'JPEG' => 'jpg', 'PNG' => 'png'), 'grade' => 2, 'label' => __('Format des images')); $this->fields['dynamicBackgroundColor'] = ['type' => 'textarea', 'default' => '', 'editable' => true, 'label' => 'Couleur de fond dynamique', 'grade' => 3]; + $this->forms['3d_mode'] = array('label' => __('Options de visualisation'), 'fieldsnames' => array('mobileNavigationType', '|', 'mobileTransitions', 'mobileTransitionDuration', '|', 'forceWhiteBackground', 'rasterizePages', 'vectorPages', 'visualisationMode', 'antialiasReading', 'correctCenter', 'pagesBaseAngle', 'centerBook', '|', 'extraXSpace', 'mobileExtraXSpace', 'extraYSpace', '|', 'viewMode', '|', 'dynamicBackgroundColor', '|', 'imageFormat', 'maxResolution')); @@ -636,8 +639,7 @@ class wsBookParametres extends wsParametres $this->fields['articlesFile'] = ['type' => 'freefile', 'default' => '', 'editable' => true, 'label' => 'Articles', 'grade' => 3, 'fileFilter' => $articlesFilter]; $this->fields['articlesFormat'] = ['type' => 'combo', 'default' => 'fluidbook', 'editable' => true, 'label' => 'Format', 'grade' => 3, 'datas' => [__('Fluidbook') => 'fluidbook', 'Business Immo' => 'business-immo']]; - $this->fields['articlesFont'] = ['type' => 'combo', 'label' => __('Police des articles'), 'default' => 'OpenSans', 'datas' => [ - 'Open Sans (police du Fluidbook)' => 'OpenSans', 'Montserrat' => 'Montserrat', 'Police système' => 'sans-serif'], 'editable' => 'true', 'grade' => 3]; + $this->fields['articlesFont'] = ['type' => 'combo', 'label' => __('Police des articles'), 'default' => 'OpenSans', 'datas' => $fonts, 'editable' => 'true', 'grade' => 3]; $this->fields['articlesImages'] = ['type' => 'freefile', 'label' => __('Images des articles'), 'default' => '', 'hint' => __('Les noms des fichiers doivent être les même que ceux des balises du XML'), 'editable' => true, 'grade' => 3, 'dir' => 'articles', 'multiple' => true]; $this->fields['articlesShare'] = ['type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Activer le partage'), 'grade' => 3]; $this->fields['articlesStyle'] = ['type' => 'combo', 'default' => true, 'editable' => true, 'label' => __('Style'), 'grade' => 3, 'datas' => ['Défaut' => 'default', 'Atlantic' => 'atlantic', 'Harmonie Mutuelle' => 'harmonie-mutuelle', 'Business Immo' => 'business-immo']]; diff --git a/inc/ws/Metier/class.ws.theme.parametres.php b/inc/ws/Metier/class.ws.theme.parametres.php index 9ebeb8349..6a6f64e27 100644 --- a/inc/ws/Metier/class.ws.theme.parametres.php +++ b/inc/ws/Metier/class.ws.theme.parametres.php @@ -103,15 +103,12 @@ class wsThemeParametres extends wsParametres $this->fields['iconsHMargin'] = array('type' => 'integer', 'default' => 15, 'editable' => true, 'label' => __('Espace entre les icônes'), 'min' => 0, 'max' => 50); - $this->fields['fontKit'] = array('type' => 'combo', 'default' => 'auto', 'editable' => true, - 'label' => __('Police de caractères'), 'datas' => array(__('Automatique') => 'auto', - 'VAG Rounded' => 'vagrounded', - 'Gill' => 'gill')); - $this->forms['icones'] = array('label' => __('Personnalisation des icônes'), - 'fieldsnames' => array('iconSet', 'iconShadeColor', '|', 'iconsHMargin', '|', 'colorizeIcons', 'couleurI', '|', 'fontKit')); + 'fieldsnames' => array('iconSet', 'iconShadeColor', '|', 'iconsHMargin', '|', 'colorizeIcons', 'couleurI')); /* Book */ + $this->fields['interfaceFont'] = ['type' => 'combo', 'default' => 'OpenSans', 'datas' => wsBookParametres::$fonts, 'editable' => true, 'label' => __('Police de l\'interface')]; + $this->fields['interfaceFontUppercase'] = ['type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Forcer les textes en majuscule')]; $this->fields['bookShadeColor'] = array('type' => 'couleurAlpha', 'default' => '66000000', 'editable' => true, 'label' => __("Couleur de l'ombre sous la publication")); $this->fields['shadeAlpha'] = array('type' => 'integer', 'default' => 100, 'editable' => true, @@ -153,7 +150,7 @@ class wsThemeParametres extends wsParametres 'label' => __("Couleur de l'étoile activée")); $this->forms['book'] = array('label' => __('Personnalisation de la publication'), - 'fieldsnames' => array('pageReflection', 'shadeAlpha', + 'fieldsnames' => array('interfaceFont','interfaceFontUppercase','|','pageReflection', 'shadeAlpha', '|', 'usePageEdges', 'pageEdgeOpacity', 'pageEdgeLeftOffset', 'pageEdgeRightOffset', 'pageEdgeColor', 'pageEdgeThickness', '|', 'bookShadeColor', '|', 'displayPageNumber', 'colorPageNumber', diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 9ea41ef90..485df024c 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -1315,7 +1315,6 @@ height="0" width="0" style="display:none;visibility:hidden"> } - $svg = ''; foreach ($this->svgfiles as $svgfile) { if (file_exists($svgfile)) { @@ -2242,6 +2241,23 @@ height="0" width="0" style="display:none;visibility:hidden"> return $val ? 'true' : 'false'; } + protected function _font($f) + { + $default = 'Arial, Helvetica, sans-serif'; + switch ($f) { + case 'Montserrat': + case 'OpenSans': + $this->addFontKit($f); + return "'" . $f . "' " . $default; + case 'sans-serif': + return $f; + case 'Arial': + return $default; + default: + return "'OpenSans', Arial, Helverica, sans-serif"; + } + } + protected function writeCSS($links) { $res = array(); @@ -2250,6 +2266,9 @@ height="0" width="0" style="display:none;visibility:hidden"> $lessContents = ''; + $this->lessVariables['font'] = $this->_font($this->theme->parametres->interfaceFont); + $this->lessVariables['text-transform'] = $this->theme->parametres->interfaceFontUppercase ? 'uppercase' : ''; + $this->lessVariables['css-scale'] = $this->cssScale; $this->lessVariables['slider-display'] = $this->_lessBoolean($this->theme->parametres->pagesBar); $this->lessVariables['slider-thumb-background'] = wsHTML5::colorToCSS($this->theme->parametres->pageBarThumbBack); -- 2.39.5