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()
$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'));
$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 <image> 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']];
$this->fields['iconsHMargin'] = array('type' => 'integer', 'default' => 15, 'editable' => true,\r
'label' => __('Espace entre les icônes'), 'min' => 0, 'max' => 50);\r
\r
- $this->fields['fontKit'] = array('type' => 'combo', 'default' => 'auto', 'editable' => true,\r
- 'label' => __('Police de caractères'), 'datas' => array(__('Automatique') => 'auto',\r
- 'VAG Rounded' => 'vagrounded',\r
- 'Gill' => 'gill'));\r
-\r
$this->forms['icones'] = array('label' => __('Personnalisation des icônes'),\r
- 'fieldsnames' => array('iconSet', 'iconShadeColor', '|', 'iconsHMargin', '|', 'colorizeIcons', 'couleurI', '|', 'fontKit'));\r
+ 'fieldsnames' => array('iconSet', 'iconShadeColor', '|', 'iconsHMargin', '|', 'colorizeIcons', 'couleurI'));\r
\r
/* Book */\r
+ $this->fields['interfaceFont'] = ['type' => 'combo', 'default' => 'OpenSans', 'datas' => wsBookParametres::$fonts, 'editable' => true, 'label' => __('Police de l\'interface')];\r
+ $this->fields['interfaceFontUppercase'] = ['type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Forcer les textes en majuscule')];\r
$this->fields['bookShadeColor'] = array('type' => 'couleurAlpha', 'default' => '66000000', 'editable' => true,\r
'label' => __("Couleur de l'ombre sous la publication"));\r
$this->fields['shadeAlpha'] = array('type' => 'integer', 'default' => 100, 'editable' => true,\r
'label' => __("Couleur de l'étoile activée"));\r
\r
$this->forms['book'] = array('label' => __('Personnalisation de la publication'),\r
- 'fieldsnames' => array('pageReflection', 'shadeAlpha',\r
+ 'fieldsnames' => array('interfaceFont','interfaceFontUppercase','|','pageReflection', 'shadeAlpha',\r
'|', 'usePageEdges', 'pageEdgeOpacity', 'pageEdgeLeftOffset', 'pageEdgeRightOffset', 'pageEdgeColor', 'pageEdgeThickness',\r
'|', 'bookShadeColor',\r
'|', 'displayPageNumber', 'colorPageNumber',\r
}
-
$svg = '';
foreach ($this->svgfiles as $svgfile) {
if (file_exists($svgfile)) {
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();
$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);