theme liste des polices ok
This commit is contained in:
parent
142611e69d
commit
bafb7b3bc3
@ -618,13 +618,6 @@ class template {
|
|||||||
if($attributes['before'] AND array_key_exists($attributes['id'], common::$inputBefore)) {
|
if($attributes['before'] AND array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||||
$attributes['selected'] = common::$inputBefore[$attributes['id']];
|
$attributes['selected'] = common::$inputBefore[$attributes['id']];
|
||||||
}
|
}
|
||||||
// Liste des polices à intégrer
|
|
||||||
//var_dump(core::$fonts);
|
|
||||||
if ($attributes['fonts'] === true) {
|
|
||||||
foreach (core::$fonts as $fontId => $font) {
|
|
||||||
echo "<link href='https://fonts.cdnfonts.com/css/" . $fontId . "' rel='stylesheet' type='text/css'>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Début du wrapper
|
// Début du wrapper
|
||||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||||
// Label
|
// Label
|
||||||
|
@ -183,10 +183,6 @@ class common {
|
|||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// Fontes
|
|
||||||
public static $fonts = [
|
|
||||||
];
|
|
||||||
|
|
||||||
public static $fontsWebSafe = [
|
public static $fontsWebSafe = [
|
||||||
'arial' => 'Arial, Helvetica, sans-serif;',
|
'arial' => 'Arial, Helvetica, sans-serif;',
|
||||||
'arial-black' => 'Arial Black, Gadget, sans-serif;',
|
'arial-black' => 'Arial Black, Gadget, sans-serif;',
|
||||||
@ -422,7 +418,7 @@ class common {
|
|||||||
foreach (self::$fontsWebSafe as $fontId => $fontValue) {
|
foreach (self::$fontsWebSafe as $fontId => $fontValue) {
|
||||||
$fontName = explode (',', $fontValue);
|
$fontName = explode (',', $fontValue);
|
||||||
$f ['websafe'] [$fontId] = [
|
$f ['websafe'] [$fontId] = [
|
||||||
'name' => $fontName[0],
|
'name' => str_replace('"', '', $fontName[0]),
|
||||||
'font-family'=> $fontValue
|
'font-family'=> $fontValue
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -433,7 +429,7 @@ class common {
|
|||||||
foreach ($fontsImported as $fontId => $fontValue) {
|
foreach ($fontsImported as $fontId => $fontValue) {
|
||||||
$fontName = explode (',', $fontValue);
|
$fontName = explode (',', $fontValue);
|
||||||
$f ['imported'] [$fontId] = [
|
$f ['imported'] [$fontId] = [
|
||||||
'name' => $fontName[0],
|
'name' => str_replace('"', '', $fontName[0]),
|
||||||
'font-family'=> $fontValue
|
'font-family'=> $fontValue
|
||||||
//'ressource'
|
//'ressource'
|
||||||
];
|
];
|
||||||
@ -446,7 +442,8 @@ class common {
|
|||||||
foreach ($fontsFiles as $fontId => $fontValue) {
|
foreach ($fontsFiles as $fontId => $fontValue) {
|
||||||
$f ['files'] [$fontId] = [
|
$f ['files'] [$fontId] = [
|
||||||
'font-family'=> $fontValue ['font-family'],
|
'font-family'=> $fontValue ['font-family'],
|
||||||
'ressource'=> $fontValue ['ressource']
|
'ressource'=> $fontValue ['ressource'],
|
||||||
|
'name' => ucfirst($fontId) // A créer
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2355,7 +2352,7 @@ class core extends common {
|
|||||||
$fontFile = '';
|
$fontFile = '';
|
||||||
foreach ($fonts as $fontId) {
|
foreach ($fonts as $fontId) {
|
||||||
if ( isset($fontsAvailable['websafe'][$fontId])) {
|
if ( isset($fontsAvailable['websafe'][$fontId])) {
|
||||||
self::$fonts [$fontId] = $fontsAvailable['websafe'][$fontId]['font-family'];
|
$fonts [$fontId] = $fontsAvailable['websafe'][$fontId]['font-family'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2367,7 +2364,7 @@ class core extends common {
|
|||||||
if ( isset($fontsAvailable['imported'][$fontId])) {
|
if ( isset($fontsAvailable['imported'][$fontId])) {
|
||||||
$fontFile .= '<link href="https://fonts.cdnfonts.com/css/' . $fontId .'" rel="stylesheet">';
|
$fontFile .= '<link href="https://fonts.cdnfonts.com/css/' . $fontId .'" rel="stylesheet">';
|
||||||
// Tableau pour la construction de la feuille de style
|
// Tableau pour la construction de la feuille de style
|
||||||
self::$fonts [$fontId] = $fontsAvailable['imported'][$fontId]['font-family'];
|
$fonts [$fontId] = $fontsAvailable['imported'][$fontId]['font-family'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Enregistre la personnalisation
|
// Enregistre la personnalisation
|
||||||
@ -2385,7 +2382,7 @@ class core extends common {
|
|||||||
$css .= '@font-face {font-family:"' . $fontsAvailable['files'][$fontId]['font-family'] . '";';
|
$css .= '@font-face {font-family:"' . $fontsAvailable['files'][$fontId]['font-family'] . '";';
|
||||||
$css .= 'src: url("' . helper::baseUrl(false) . self::DATA_DIR . 'fonts/' . $fontName . '");}';
|
$css .= 'src: url("' . helper::baseUrl(false) . self::DATA_DIR . 'fonts/' . $fontName . '");}';
|
||||||
// Tableau pour la construction de la feuille de style
|
// Tableau pour la construction de la feuille de style
|
||||||
self::$fonts [$fontId] = $fontsAvailable['files'][$fontId]['font-family'];
|
$fonts [$fontId] = $fontsAvailable['files'][$fontId]['font-family'];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2393,7 +2390,7 @@ class core extends common {
|
|||||||
// Fond du body
|
// Fond du body
|
||||||
$colors = helper::colorVariants($this->getData(['theme', 'body', 'backgroundColor']));
|
$colors = helper::colorVariants($this->getData(['theme', 'body', 'backgroundColor']));
|
||||||
// Body
|
// Body
|
||||||
$css .= 'body{font-family:' . self::$fonts[$this->getData(['theme', 'text', 'font'])] . ';}';
|
$css .= 'body{font-family:' . $fonts[$this->getData(['theme', 'text', 'font'])] . ';}';
|
||||||
if($themeBodyImage = $this->getData(['theme', 'body', 'image'])) {
|
if($themeBodyImage = $this->getData(['theme', 'body', 'image'])) {
|
||||||
// Image dans html pour éviter les déformations.
|
// Image dans html pour éviter les déformations.
|
||||||
$css .= 'html {background-image:url("../file/source/' . $themeBodyImage . '");background-position:' . $this->getData(['theme', 'body', 'imagePosition']) . ';background-attachment:' . $this->getData(['theme', 'body', 'imageAttachment']) . ';background-size:' . $this->getData(['theme', 'body', 'imageSize']) . ';background-repeat:' . $this->getData(['theme', 'body', 'imageRepeat']) . '}';
|
$css .= 'html {background-image:url("../file/source/' . $themeBodyImage . '");background-position:' . $this->getData(['theme', 'body', 'imagePosition']) . ';background-attachment:' . $this->getData(['theme', 'body', 'imageAttachment']) . ';background-size:' . $this->getData(['theme', 'body', 'imageSize']) . ';background-repeat:' . $this->getData(['theme', 'body', 'imageRepeat']) . '}';
|
||||||
@ -2411,7 +2408,7 @@ class core extends common {
|
|||||||
$colors = helper::colorVariants($this->getData(['theme', 'text', 'linkColor']));
|
$colors = helper::colorVariants($this->getData(['theme', 'text', 'linkColor']));
|
||||||
$css .= 'a{color:' . $colors['normal'] . '}';
|
$css .= 'a{color:' . $colors['normal'] . '}';
|
||||||
// Couleurs de site dans TinyMCe
|
// Couleurs de site dans TinyMCe
|
||||||
$css .= 'div.mce-edit-area {font-family:' . self::$fonts[$this->getData(['theme', 'text', 'font'])] . ';}';
|
$css .= 'div.mce-edit-area {font-family:' . $fonts[$this->getData(['theme', 'text', 'font'])] . ';}';
|
||||||
// Site dans TinyMCE
|
// Site dans TinyMCE
|
||||||
$css .= '.editorWysiwyg {background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}';
|
$css .= '.editorWysiwyg {background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}';
|
||||||
$css .= 'span.mce-text{background-color: unset !important;}';
|
$css .= 'span.mce-text{background-color: unset !important;}';
|
||||||
@ -2452,7 +2449,7 @@ class core extends common {
|
|||||||
$css .= '.helpButton span:hover{color:' . $colors['darken'] . '}';
|
$css .= '.helpButton span:hover{color:' . $colors['darken'] . '}';
|
||||||
$css .= '.button:active,button[type=\'submit\']:active,.pagination a:active{background-color:' . $colors['veryDarken'] . '}';
|
$css .= '.button:active,button[type=\'submit\']:active,.pagination a:active{background-color:' . $colors['veryDarken'] . '}';
|
||||||
$colors = helper::colorVariants($this->getData(['theme', 'title', 'textColor']));
|
$colors = helper::colorVariants($this->getData(['theme', 'title', 'textColor']));
|
||||||
$css .= 'h1,h2,h3,h4,h5,h6,h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{color:' . $colors['normal'] . ';font-family:' . self::$fonts[$this->getData(['theme', 'title', 'font'])] . ';font-weight:' . $this->getData(['theme', 'title', 'fontWeight']) . ';text-transform:' . $this->getData(['theme', 'title', 'textTransform']) . '}';
|
$css .= 'h1,h2,h3,h4,h5,h6,h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{color:' . $colors['normal'] . ';font-family:' . $fonts[$this->getData(['theme', 'title', 'font'])] . ';font-weight:' . $this->getData(['theme', 'title', 'fontWeight']) . ';text-transform:' . $this->getData(['theme', 'title', 'textTransform']) . '}';
|
||||||
$css .= 'h1 a:hover,h2 a:hover,h3 a:hover,h4 a:hover,h5 a:hover,h6 a:hover{color:' . $colors['darken'] . '}';
|
$css .= 'h1 a:hover,h2 a:hover,h3 a:hover,h4 a:hover,h5 a:hover,h6 a:hover{color:' . $colors['darken'] . '}';
|
||||||
// Les blocs
|
// Les blocs
|
||||||
$colors = helper::colorVariants($this->getData(['theme', 'block', 'backgroundColor']));
|
$colors = helper::colorVariants($this->getData(['theme', 'block', 'backgroundColor']));
|
||||||
@ -2486,7 +2483,7 @@ class core extends common {
|
|||||||
$css .= 'header{background-image:url("../file/source/' . $themeHeaderImage . '");background-position:' . $this->getData(['theme', 'header', 'imagePosition']) . ';background-repeat:' . $this->getData(['theme', 'header', 'imageRepeat']) . '}';
|
$css .= 'header{background-image:url("../file/source/' . $themeHeaderImage . '");background-position:' . $this->getData(['theme', 'header', 'imagePosition']) . ';background-repeat:' . $this->getData(['theme', 'header', 'imageRepeat']) . '}';
|
||||||
}
|
}
|
||||||
$colors = helper::colorVariants($this->getData(['theme', 'header', 'textColor']));
|
$colors = helper::colorVariants($this->getData(['theme', 'header', 'textColor']));
|
||||||
$css .= 'header span{color:' . $colors['normal'] . ';font-family:' . self::$fonts[$this->getData(['theme', 'header', 'font'])] . ';font-weight:' . $this->getData(['theme', 'header', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'header', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'header', 'textTransform']) . '}';
|
$css .= 'header span{color:' . $colors['normal'] . ';font-family:' . $fonts[$this->getData(['theme', 'header', 'font'])] . ';font-weight:' . $this->getData(['theme', 'header', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'header', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'header', 'textTransform']) . '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bannière au contenu personnalisé
|
// Bannière au contenu personnalisé
|
||||||
@ -2535,7 +2532,7 @@ class core extends common {
|
|||||||
$css .= 'nav{padding:0 10px;}';
|
$css .= 'nav{padding:0 10px;}';
|
||||||
}
|
}
|
||||||
|
|
||||||
$css .= '#toggle span,#menu a{padding:' . $this->getData(['theme', 'menu', 'height']) .';font-family:' . self::$fonts[$this->getData(['theme', 'menu', 'font'])] . ';font-weight:' . $this->getData(['theme', 'menu', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'menu', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'menu', 'textTransform']) . '}';
|
$css .= '#toggle span,#menu a{padding:' . $this->getData(['theme', 'menu', 'height']) .';font-family:' . $fonts[$this->getData(['theme', 'menu', 'font'])] . ';font-weight:' . $this->getData(['theme', 'menu', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'menu', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'menu', 'textTransform']) . '}';
|
||||||
// Pied de page
|
// Pied de page
|
||||||
|
|
||||||
$colors = helper::colorVariants($this->getData(['theme', 'footer', 'backgroundColor']));
|
$colors = helper::colorVariants($this->getData(['theme', 'footer', 'backgroundColor']));
|
||||||
@ -2545,7 +2542,7 @@ class core extends common {
|
|||||||
$css .= 'footer{padding:0}';
|
$css .= 'footer{padding:0}';
|
||||||
}
|
}
|
||||||
|
|
||||||
$css .= 'footer span, #footerText > p {color:' . $this->getData(['theme', 'footer', 'textColor']) . ';font-family:' . self::$fonts[$this->getData(['theme', 'footer', 'font'])] . ';font-weight:' . $this->getData(['theme', 'footer', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'footer', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'footer', 'textTransform']) . '}';
|
$css .= 'footer span, #footerText > p {color:' . $this->getData(['theme', 'footer', 'textColor']) . ';font-family:' . $fonts[$this->getData(['theme', 'footer', 'font'])] . ';font-weight:' . $this->getData(['theme', 'footer', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'footer', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'footer', 'textTransform']) . '}';
|
||||||
$css .= 'footer {background-color:' . $colors['normal'] . ';color:' . $this->getData(['theme', 'footer', 'textColor']) . '}';
|
$css .= 'footer {background-color:' . $colors['normal'] . ';color:' . $this->getData(['theme', 'footer', 'textColor']) . '}';
|
||||||
$css .= 'footer a{color:' . $this->getData(['theme', 'footer', 'textColor']) . '}';
|
$css .= 'footer a{color:' . $this->getData(['theme', 'footer', 'textColor']) . '}';
|
||||||
$css .= 'footer #footersite > div {margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}';
|
$css .= 'footer #footersite > div {margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}';
|
||||||
@ -2589,7 +2586,7 @@ class core extends common {
|
|||||||
$fontFile = '';
|
$fontFile = '';
|
||||||
foreach ($fonts as $fontId) {
|
foreach ($fonts as $fontId) {
|
||||||
if ( isset($fontsAvailable['websafe'][$fontId])) {
|
if ( isset($fontsAvailable['websafe'][$fontId])) {
|
||||||
self::$fonts [$fontId] = $fontsAvailable['websafe'][$fontId]['font-family'];
|
$fonts [$fontId] = $fontsAvailable['websafe'][$fontId]['font-family'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2601,7 +2598,7 @@ class core extends common {
|
|||||||
if ( isset($fontsAvailable['imported'][$fontId])) {
|
if ( isset($fontsAvailable['imported'][$fontId])) {
|
||||||
$fontFile .= '<link href="https://fonts.cdnfonts.com/css/' . $fontId .'" rel="stylesheet">';
|
$fontFile .= '<link href="https://fonts.cdnfonts.com/css/' . $fontId .'" rel="stylesheet">';
|
||||||
// Tableau pour la construction de la feuille de style
|
// Tableau pour la construction de la feuille de style
|
||||||
self::$fonts [$fontId] = $fontsAvailable['imported'][$fontId]['font-family'];
|
$fonts [$fontId] = $fontsAvailable['imported'][$fontId]['font-family'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Enregistre la personnalisation
|
// Enregistre la personnalisation
|
||||||
@ -2619,7 +2616,7 @@ class core extends common {
|
|||||||
$css .= '@font-face {font-family:"' . $fontsAvailable['files'][$fontId]['font-family'] . '";';
|
$css .= '@font-face {font-family:"' . $fontsAvailable['files'][$fontId]['font-family'] . '";';
|
||||||
$css .= 'src: url("' . helper::baseUrl(false) . self::DATA_DIR . 'fonts/' . $fontName . '");}';
|
$css .= 'src: url("' . helper::baseUrl(false) . self::DATA_DIR . 'fonts/' . $fontName . '");}';
|
||||||
// Tableau pour la construction de la feuille de style
|
// Tableau pour la construction de la feuille de style
|
||||||
self::$fonts [$fontId] = $fontsAvailable['files'][$fontId]['font-family'];
|
$fonts [$fontId] = $fontsAvailable['files'][$fontId]['font-family'];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2627,8 +2624,8 @@ class core extends common {
|
|||||||
// Thème Administration
|
// Thème Administration
|
||||||
$colors = helper::colorVariants($this->getData(['admin','backgroundColor']));
|
$colors = helper::colorVariants($this->getData(['admin','backgroundColor']));
|
||||||
$css .= '#site{background-color:' . $colors['normal']. ';}';
|
$css .= '#site{background-color:' . $colors['normal']. ';}';
|
||||||
$css .= '.row > div {font:' . self::$fonts[$this->getData(['admin','fontText'])] . ';font-size:' . $this->getData(['admin','fontSize']) .'}';
|
$css .= '.row > div {font:' . $fonts[$this->getData(['admin','fontText'])] . ';font-size:' . $this->getData(['admin','fontSize']) .'}';
|
||||||
$css .= 'body h1, h2, h3, h4 a, h5, h6 {font-family:' . self::$fonts[$this->getData(['admin','fontTitle'])] . ';color:' . $this->getData(['admin','colorTitle' ]) . ';}';
|
$css .= 'body h1, h2, h3, h4 a, h5, h6 {font-family:' . $fonts[$this->getData(['admin','fontTitle'])] . ';color:' . $this->getData(['admin','colorTitle' ]) . ';}';
|
||||||
|
|
||||||
// TinyMCE
|
// TinyMCE
|
||||||
$css .= 'body:not(.editorWysiwyg),span .zwiico-help {color:' . $this->getData(['admin','colorText']) . ';}';
|
$css .= 'body:not(.editorWysiwyg),span .zwiico-help {color:' . $this->getData(['admin','colorText']) . ';}';
|
||||||
|
@ -396,7 +396,8 @@ class theme extends common {
|
|||||||
unset(self::$pagesList[$page]);
|
unset(self::$pagesList[$page]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Lire les fontes installées
|
||||||
|
$this->enumFonts();
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => 'Personnalisation du pied de page',
|
'title' => 'Personnalisation du pied de page',
|
||||||
@ -475,6 +476,8 @@ class theme extends common {
|
|||||||
'state' => true
|
'state' => true
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
// Lire les fontes installées
|
||||||
|
$this->enumFonts();
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => 'Personnalisation de la bannière',
|
'title' => 'Personnalisation de la bannière',
|
||||||
@ -534,6 +537,8 @@ class theme extends common {
|
|||||||
'state' => true
|
'state' => true
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
// Lire les fontes installées
|
||||||
|
$this->enumFonts();
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => 'Personnalisation du menu',
|
'title' => 'Personnalisation du menu',
|
||||||
@ -549,10 +554,14 @@ class theme extends common {
|
|||||||
*/
|
*/
|
||||||
public function fonts() {
|
public function fonts() {
|
||||||
|
|
||||||
$this->listFonts();
|
// Peuple la variable de module fontsList de la liste des fonts disponibles clé : fontid - valeur nom de la fonte
|
||||||
|
$this->enumFonts();
|
||||||
//echo "<pre>";
|
//echo "<pre>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Polices liées au thème
|
// Polices liées au thème
|
||||||
$used = [
|
$used = [
|
||||||
'Bannière' => $this->getData (['theme', 'header', 'font']),
|
'Bannière' => $this->getData (['theme', 'header', 'font']),
|
||||||
@ -564,16 +573,18 @@ class theme extends common {
|
|||||||
'Admin (texte)' => $this->getData (['admin', 'fontText' ])
|
'Admin (texte)' => $this->getData (['admin', 'fontText' ])
|
||||||
];
|
];
|
||||||
|
|
||||||
// Parcourir les fontes installées et construire le tableau pour le formulaire
|
// Parcourir les fontes disponibles et construire le tableau pour le formulaire
|
||||||
foreach (self::$fonts as $fontId => $fontName) {
|
foreach ($fonts as $fontId => $fontName) {
|
||||||
|
|
||||||
// Fontes utilisées par le thème
|
// Fontes utilisées par les thèmes
|
||||||
$fontUsed[$fontId] = '';
|
$fontUsed[$fontId] = '';
|
||||||
foreach ($used as $key => $value) {
|
foreach ($used as $key => $value) {
|
||||||
if ( $value === $fontId) {
|
if ( $value === $fontId) {
|
||||||
$fontUsed[$fontId] .= $key . '<br/>';
|
$fontUsed[$fontId] .= $key . '<br/>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
self::$fontsList [] = [
|
self::$fontsList [] = [
|
||||||
'<span style="font-family:' . $fontName . '">' . $fontName . '</span>' ,
|
'<span style="font-family:' . $fontName . '">' . $fontName . '</span>' ,
|
||||||
$fontId,
|
$fontId,
|
||||||
@ -787,6 +798,8 @@ class theme extends common {
|
|||||||
'state' => true
|
'state' => true
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
// Lire les fontes installées
|
||||||
|
$this->enumFonts();
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => 'Personnalisation du site',
|
'title' => 'Personnalisation du site',
|
||||||
@ -1048,16 +1061,19 @@ class theme extends common {
|
|||||||
return ($count);
|
return ($count);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Peule la variable self:$fonts avec les fontes disponibles.
|
// Retourne un tableau simple des fonts installées idfont avec le nom
|
||||||
public function listFonts() {
|
// Cette fonction est utile aux sélecteurs de fonts dans les formulaires.
|
||||||
|
public function enumFonts() {
|
||||||
// Récupère la liste des fontes installées
|
// Récupère la liste des fontes installées
|
||||||
$f = $this->getFonts();
|
$f = $this->getFonts();
|
||||||
// Construit un tableau avec leur ID et leur famille
|
// Construit un tableau avec leur ID et leur famille
|
||||||
foreach(['websafe', 'imported', 'files'] as $type) {
|
foreach(['websafe', 'imported', 'files'] as $type) {
|
||||||
foreach ($f[$type] as $fontId => $fontValue ) {
|
foreach ($f[$type] as $fontId => $fontValue ) {
|
||||||
self::$fonts [$fontId] = $fontValue['name'];
|
$fonts [$fontId] = $fontValue['name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ksort($fonts);
|
||||||
|
self::$fontsList = $fonts;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@
|
|||||||
<h4>Mise en forme du texte</h4>
|
<h4>Mise en forme du texte</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col3">
|
<div class="col3">
|
||||||
<?php echo template::select('themeFooterFont', self::$fonts, [
|
<?php echo template::select('themeFooterFont', $module::$fontsList, [
|
||||||
'label' => 'Police',
|
'label' => 'Police',
|
||||||
'selected' => $this->getData(['theme', 'footer', 'font']),
|
'selected' => $this->getData(['theme', 'footer', 'font']),
|
||||||
'fonts' => true
|
'fonts' => true
|
||||||
|
@ -106,7 +106,7 @@
|
|||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
<?php echo template::select('themeHeaderFont', self::$fonts, [
|
<?php echo template::select('themeHeaderFont', $module::$fontsList, [
|
||||||
'label' => 'Police',
|
'label' => 'Police',
|
||||||
'selected' => $this->getData(['theme', 'header', 'font']),
|
'selected' => $this->getData(['theme', 'header', 'font']),
|
||||||
'fonts' => true
|
'fonts' => true
|
||||||
|
@ -183,7 +183,7 @@
|
|||||||
<h4>Mise en forme du texte</h4>
|
<h4>Mise en forme du texte</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::select('themeMenuFont', self::$fonts, [
|
<?php echo template::select('themeMenuFont', $module::$fontsList, [
|
||||||
'label' => 'Police',
|
'label' => 'Police',
|
||||||
'selected' => $this->getData(['theme', 'menu', 'font']),
|
'selected' => $this->getData(['theme', 'menu', 'font']),
|
||||||
'fonts' => true
|
'fonts' => true
|
||||||
|
@ -158,7 +158,7 @@
|
|||||||
<h4>Mise en forme du texte</h4>
|
<h4>Mise en forme du texte</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::select('themeTextFont', self::$fonts, [
|
<?php echo template::select('themeTextFont', $module::$fontsList, [
|
||||||
'label' => 'Police',
|
'label' => 'Police',
|
||||||
'selected' => $this->getData(['theme', 'text', 'font']),
|
'selected' => $this->getData(['theme', 'text', 'font']),
|
||||||
'fonts' => true
|
'fonts' => true
|
||||||
@ -179,7 +179,7 @@
|
|||||||
<h4>Mise en forme des titres</h4>
|
<h4>Mise en forme des titres</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
<?php echo template::select('themeTitleFont', self::$fonts, [
|
<?php echo template::select('themeTitleFont', $module::$fontsList, [
|
||||||
'label' => 'Police',
|
'label' => 'Police',
|
||||||
'selected' => $this->getData(['theme', 'title', 'font']),
|
'selected' => $this->getData(['theme', 'title', 'font']),
|
||||||
'fonts' => true
|
'fonts' => true
|
||||||
|
Loading…
Reference in New Issue
Block a user