v8.5.0 : choix police theme menu - supp title dans menu - supp icontext

This commit is contained in:
fredtempez 2018-12-09 00:52:05 +01:00
parent da4167c762
commit 02d25afc56
11 changed files with 64 additions and 49 deletions

View File

@ -1,5 +1,12 @@
# ChangeLog # ChangeLog
## Version 8.5.0
* Correction :
- Suppression popup active par défaut dans le menu
- Suppression option de titre de page dans le menu Icone + Texte
* Modification :
- Thème du menu : sélection de la police de caractère
## Version 8.4.9 ## Version 8.4.9
* Correction : * Correction :
- Adresse d'une page inactive - Adresse d'une page inactive
@ -17,7 +24,7 @@
## Version 8.4.6 ## Version 8.4.6
* corrections : * corrections :
- Encodage des dates dans la liste des articles news et blog - Encodage des dates dans la liste des articles news et blog
- Variable itemsperpage stockée dans le mauvais type - Variable itemsperPage stockée dans le mauvais type
## Version 8.4.5 ## Version 8.4.5
* corrections : * corrections :

View File

@ -24,7 +24,7 @@ class common {
const GROUP_MEMBER = 1; const GROUP_MEMBER = 1;
const GROUP_MODERATOR = 2; const GROUP_MODERATOR = 2;
const GROUP_ADMIN = 3; const GROUP_ADMIN = 3;
const ZWII_VERSION = '8.4.9'; const ZWII_VERSION = '8.5.0';
public static $actions = []; public static $actions = [];
public static $coreModuleIds = [ public static $coreModuleIds = [
@ -56,7 +56,7 @@ class common {
], ],
'timezone' => 'Europe/Paris', 'timezone' => 'Europe/Paris',
'title' => 'Zwii, votre site en quelques clics !', 'title' => 'Zwii, votre site en quelques clics !',
'ItemsperPage' => 10 'itemsperPage' => 10
], ],
'core' => [ 'core' => [
'dataVersion' => 0, 'dataVersion' => 0,
@ -345,6 +345,7 @@ class common {
], ],
'menu' => [ 'menu' => [
'backgroundColor' => 'rgba(74, 105, 189, 1)', 'backgroundColor' => 'rgba(74, 105, 189, 1)',
'font' => 'Oswald',
'fontSize' => '1em', 'fontSize' => '1em',
'fontWeight' => 'normal', 'fontWeight' => 'normal',
'height' => '15px 10px', 'height' => '15px 10px',
@ -906,7 +907,7 @@ class common {
$this->setData(['theme','footer','socialsPosition','1']); $this->setData(['theme','footer','socialsPosition','1']);
$this->setData(['theme','footer','textPosition','2']); $this->setData(['theme','footer','textPosition','2']);
$this->setData(['theme','footer','copyrightPosition','3']); $this->setData(['theme','footer','copyrightPosition','3']);
$this->setData(['config','ItemsperPage',10]); $this->setData(['config','itemsperPage',10]);
$this->setData(['core', 'dataVersion', 840]); $this->setData(['core', 'dataVersion', 840]);
$this->SaveData(); $this->SaveData();
} }
@ -917,14 +918,19 @@ class common {
$this->setData(['theme','footer','copyrightPosition','center']); $this->setData(['theme','footer','copyrightPosition','center']);
$this->setData(['core', 'dataVersion', 844]); $this->setData(['core', 'dataVersion', 844]);
$this->SaveData(); $this->SaveData();
} }
// Version 8.4.6 // Version 8.4.6
if($this->getData(['core', 'dataVersion']) < 846) { if($this->getData(['core', 'dataVersion']) < 846) {
$this->setData(['config','ItemsperPage',10]); $this->setData(['config','iItemsperPage',10]);
$this->setData(['core', 'dataVersion', 846]); $this->setData(['core', 'dataVersion', 846]);
$this->SaveData(); $this->SaveData();
} }
// Version 8.5.0
if($this->getData(['core', 'dataVersion']) < 850) {
$this->setData(['theme','menu','font',10]);
$this->setData(['core', 'dataVersion', 850]);
$this->SaveData();
}
} }
} }
@ -997,7 +1003,7 @@ class core extends common {
// Version // Version
$css = '/*' . md5(json_encode($this->getData(['theme']))) . '*/'; $css = '/*' . md5(json_encode($this->getData(['theme']))) . '*/';
// Import des polices de caractères // Import des polices de caractères
$css .= '@import url("https://fonts.googleapis.com/css?family=' . $this->getData(['theme', 'text', 'font']) . '|' . $this->getData(['theme', 'title', 'font']) . '|' . $this->getData(['theme', 'header', 'font']) . '");'; $css .= '@import url("https://fonts.googleapis.com/css?family=' . $this->getData(['theme', 'text', 'font']) . '|' . $this->getData(['theme', 'title', 'font']) . '|' . $this->getData(['theme', 'header', 'font']) . '|' . $this->getData(['theme', 'menu', 'font']) . '");';
// Fond du site // Fond du site
$colors = helper::colorVariants($this->getData(['theme', 'body', 'backgroundColor'])); $colors = helper::colorVariants($this->getData(['theme', 'body', 'backgroundColor']));
$css .= 'body{background-color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}'; $css .= 'body{background-color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}';
@ -1058,7 +1064,7 @@ class core extends common {
$css .= 'nav{margin:0 20px 0}'; $css .= 'nav{margin:0 20px 0}';
} }
} }
$css .= '#toggle span,#menu a{padding:' . $this->getData(['theme', 'menu', 'height']) . ';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:"' . str_replace('+', ' ', $this->getData(['theme', 'menu', 'font'])) . '",sans-serif;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']));
if($this->getData(['theme', 'footer', 'margin'])) { if($this->getData(['theme', 'footer', 'margin'])) {
@ -1880,14 +1886,14 @@ class layout extends common {
$targetBlank = $this->getData(['page', $parentPageId, 'targetBlank']) ? ' target="_blank"' : ''; $targetBlank = $this->getData(['page', $parentPageId, 'targetBlank']) ? ' target="_blank"' : '';
// Mise en page de l'item // Mise en page de l'item
$items .= '<li>'; $items .= '<li>';
// Menu image
if ( $this->getData(['page',$parentPageId,'disable']) === true if ( $this->getData(['page',$parentPageId,'disable']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') )
{$items .= '<a href="'.$this->getUrl(1).'">';} {$items .= '<a href="'.$this->getUrl(1).'">';
else { } else {
$items .= '<a href="' . helper::baseUrl() . $parentPageId . '" title="'.$this->getData(['page', $parentPageId, 'title']).'" ' . $active . $targetBlank . '>'; } $items .= '<a href="' . helper::baseUrl() . $parentPageId . '"' . $active . $targetBlank . '>';
}
switch ($this->getData(['page', $parentPageId, 'typeMenu'])) { switch ($this->getData(['page', $parentPageId, 'typeMenu'])) {
@ -1906,22 +1912,13 @@ class layout extends common {
break; break;
case 'icontitle' : case 'icontitle' :
if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") { if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") {
$items .= '<img alt="'.$this->getData(['page', $parentPageId, 'title']).'" src="'. helper::baseUrl(false) .'site/file/source/'.$this->getData(['page', $parentPageId, 'iconUrl']).'" title="'; $items .= '<img alt="'.$this->getData(['page', $parentPageId, 'title']).'" src="'. helper::baseUrl(false) .'site/file/source/'.$this->getData(['page', $parentPageId, 'iconUrl']).'" title="';
$items .= $this->getData(['page', $parentPageId, 'title']).'"/>'; $items .= $this->getData(['page', $parentPageId, 'title']).'"/>';
} else { } else {
$items .= $this->getData(['page', $parentPageId, 'title']); $items .= $this->getData(['page', $parentPageId, 'title']);
} }
break; break;
case 'icontext' :
if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") {
$items .= '<img alt="'.$this->getData(['page', $parentPageId, 'title']).'" src="'. helper::baseUrl(false) .'site/file/source/'.$this->getData(['page', $parentPageId, 'iconUrl']).'" />';
$items .= $this->getData(['page', $parentPageId, 'title']);
} else {
$items .= $this->getData(['page', $parentPageId, 'title']);
}
break;
} }
// Menu Image

View File

@ -222,7 +222,7 @@ class config extends common {
], ],
'timezone' => $this->getInput('configTimezone', helper::FILTER_STRING_SHORT, true), 'timezone' => $this->getInput('configTimezone', helper::FILTER_STRING_SHORT, true),
'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true), 'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true),
'ItemsperPage' => $this->getInput('ItemsperPage', helper::FILTER_INT,true) 'itemsperPage' => $this->getInput('itemsperPage', helper::FILTER_INT,true)
] ]
]); ]);
if(self::$inputNotices === []) { if(self::$inputNotices === []) {

View File

@ -57,9 +57,9 @@
]); ?> ]); ?>
<?php echo template::select('ItemsperPage', $module::$ItemsList, [ <?php echo template::select('itemsperPage', $module::$ItemsList, [
'label' => 'Pagination Blog et News', 'label' => 'Pagination Blog et News',
'selected' => $this->getData(['config', 'ItemsperPage']), 'selected' => $this->getData(['config', 'itemsperPage']),
'help' => 'Nombre d\'articles de blog ou de news par page' 'help' => 'Nombre d\'articles de blog ou de news par page'
]); ?> ]); ?>
</div> </div>

View File

@ -28,8 +28,7 @@ class page extends common {
public static $typeMenu = [ public static $typeMenu = [
'text' => 'Texte', 'text' => 'Texte',
'icon' => 'Icône', 'icon' => 'Icône',
'icontitle' => 'Icône et bulle', 'icontitle' => 'Icône et bulle'
'icontext' => 'Icône et texte'
]; ];
// menu image // menu image
// Position du module // Position du module

View File

@ -356,6 +356,7 @@ class theme extends common {
if($this->isPost()) { if($this->isPost()) {
$this->setData(['theme', 'menu', [ $this->setData(['theme', 'menu', [
'backgroundColor' => $this->getInput('themeMenuBackgroundColor'), 'backgroundColor' => $this->getInput('themeMenuBackgroundColor'),
'font' => $this->getInput('themeMenuFont'),
'fontSize' => $this->getInput('themeMenuFontSize'), 'fontSize' => $this->getInput('themeMenuFontSize'),
'fontWeight' => $this->getInput('themeMenuFontWeight'), 'fontWeight' => $this->getInput('themeMenuFontWeight'),
'height' => $this->getInput('themeMenuHeight'), 'height' => $this->getInput('themeMenuHeight'),

View File

@ -14,14 +14,17 @@
* Aperçu en direct * Aperçu en direct
*/ */
$("input, select").on("change", function() { $("input, select").on("change", function() {
// Couleurs du menu // Import des polices de caractères
var menuFont = $("#themeMenuFont").val();
var css = "@import url('https://fonts.googleapis.com/css?family=" + menuFont + "');";
var colors = core.colorVariants($("#themeMenuBackgroundColor").val()); var colors = core.colorVariants($("#themeMenuBackgroundColor").val());
var css = "nav,nav a{background-color:" + colors.normal + "}"; // Couleurs du menu
css += "nav,nav a{background-color:" + colors.normal + "}";
css += "nav a,#toggle span,nav a:hover{color:" + $("#themeMenuTextColor").val() + "}"; css += "nav a,#toggle span,nav a:hover{color:" + $("#themeMenuTextColor").val() + "}";
css += "nav a:hover{background-color:" + colors.darken + "}"; css += "nav a:hover{background-color:" + colors.darken + "}";
css += "nav a.active{background-color:" + colors.veryDarken + "}"; css += "nav a.active{background-color:" + colors.veryDarken + "}";
// Taille, hauteur, épaisseur et capitalisation de caractères du menu // Taille, hauteur, épaisseur et capitalisation de caractères du menu
css += "#toggle span,#menu a{padding:" + $("#themeMenuHeight").val() + ";font-weight:" + $("#themeMenuFontWeight").val() + ";font-size:" + $("#themeMenuFontSize").val() + ";text-transform:" + $("#themeMenuTextTransform").val() + "}"; css += "#toggle span,#menu a{padding:" + $("#themeMenuHeight").val() + ";font-family:'" + menuFont.replace(/\+/g, " ") + "',sans-serif;font-weight:" + $("#themeMenuFontWeight").val() + ";font-size:" + $("#themeMenuFontSize").val() + ";text-transform:" + $("#themeMenuTextTransform").val() + "}";
// Alignement du menu // Alignement du menu
css += "#menu{text-align:" + $("#themeMenuTextAlign").val() + "}"; css += "#menu{text-align:" + $("#themeMenuTextAlign").val() + "}";
// Marge // Marge

View File

@ -38,25 +38,33 @@
<div class="block"> <div class="block">
<h4>Mise en forme du texte</h4> <h4>Mise en forme du texte</h4>
<div class="row"> <div class="row">
<div class="col4"> <div class="col6">
<?php echo template::select('themeMenuTextTransform', $module::$textTransforms, [ <?php echo template::select('themeMenuTextTransform', $module::$textTransforms, [
'label' => 'Caractères', 'label' => 'Caractères',
'selected' => $this->getData(['theme', 'menu', 'textTransform']) 'selected' => $this->getData(['theme', 'menu', 'textTransform'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col6">
<?php echo template::select('themeMenuFontWeight', $module::$fontWeights, [ <?php echo template::select('themeMenuFontWeight', $module::$fontWeights, [
'label' => 'Style', 'label' => 'Style',
'selected' => $this->getData(['theme', 'menu', 'fontWeight']) 'selected' => $this->getData(['theme', 'menu', 'fontWeight'])
]); ?> ]); ?>
</div> </div>
<div class="col4">
<?php echo template::select('themeMenuFontSize', $module::$menuFontSizes, [
'label' => 'Taille',
'selected' => $this->getData(['theme', 'menu', 'fontSize'])
]); ?>
</div>
</div> </div>
<div class='row'>
<div class="col6">
<?php echo template::select('themeMenuFont', $module::$fonts, [
'label' => 'Police',
'selected' => $this->getData(['theme', 'menu', 'font'])
]); ?>
</div>
<div class="col6">
<?php echo template::select('themeMenuFontSize', $module::$menuFontSizes, [
'label' => 'Taille',
'selected' => $this->getData(['theme', 'menu', 'fontSize'])
]); ?>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -99,7 +99,7 @@ class blog extends common {
// Ids des commentaires par ordre de création // Ids des commentaires par ordre de création
$commentIds = array_keys(helper::arrayCollumn($comments, 'createdOn', 'SORT_DESC')); $commentIds = array_keys(helper::arrayCollumn($comments, 'createdOn', 'SORT_DESC'));
// Pagination // Pagination
$pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['config','ItemsperPage'])); $pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['config','itemsperPage']));
// Liste des pages // Liste des pages
self::$pages = $pagination['pages']; self::$pages = $pagination['pages'];
// Commentaires en fonction de la pagination // Commentaires en fonction de la pagination
@ -155,7 +155,7 @@ class blog extends common {
// Ids des articles par ordre de publication // Ids des articles par ordre de publication
$articleIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0)]), 'publishedOn', 'SORT_DESC')); $articleIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0)]), 'publishedOn', 'SORT_DESC'));
// Pagination // Pagination
$pagination = helper::pagination($articleIds, $this->getUrl(),$this->getData(['config','ItemsperPage'])); $pagination = helper::pagination($articleIds, $this->getUrl(),$this->getData(['config','itemsperPage']));
// Liste des pages // Liste des pages
self::$pages = $pagination['pages']; self::$pages = $pagination['pages'];
// Articles en fonction de la pagination // Articles en fonction de la pagination
@ -318,7 +318,7 @@ class blog extends common {
// Ids des commentaires par ordre de publication // Ids des commentaires par ordre de publication
$commentIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'comment']), 'createdOn', 'SORT_DESC')); $commentIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'comment']), 'createdOn', 'SORT_DESC'));
// Pagination // Pagination
$pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['config','ItemsperPage']),'#comment'); $pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['config','itemsperPage']),'#comment');
// Liste des pages // Liste des pages
self::$pages = $pagination['pages']; self::$pages = $pagination['pages'];
// Commentaires en fonction de la pagination // Commentaires en fonction de la pagination
@ -346,7 +346,7 @@ class blog extends common {
} }
} }
// Pagination // Pagination
$pagination = helper::pagination($articleIds, $this->getUrl(),$this->getData(['config','ItemsperPage'])); $pagination = helper::pagination($articleIds, $this->getUrl(),$this->getData(['config','itemsperPage']));
// Liste des pages // Liste des pages
self::$pages = $pagination['pages']; self::$pages = $pagination['pages'];
// Articles en fonction de la pagination // Articles en fonction de la pagination

View File

@ -104,7 +104,7 @@ class form extends common {
$data = $this->getData(['module', $this->getUrl(0), 'data']); $data = $this->getData(['module', $this->getUrl(0), 'data']);
if($data) { if($data) {
// Pagination // Pagination
$pagination = helper::pagination($data, $this->getUrl(),$this->getData(['config','ItemsperPage'])); $pagination = helper::pagination($data, $this->getUrl(),$this->getData(['config','itemsperPage']));
// Liste des pages // Liste des pages
self::$pagination = $pagination['pages']; self::$pagination = $pagination['pages'];
// Inverse l'ordre du tableau // Inverse l'ordre du tableau

View File

@ -82,7 +82,7 @@ class news extends common {
// Ids des news par ordre de publication // Ids des news par ordre de publication
$newsIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0)]), 'publishedOn', 'SORT_DESC')); $newsIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0)]), 'publishedOn', 'SORT_DESC'));
// Pagination // Pagination
$pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['config','ItemsperPage'])); $pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['config','itemsperPage']));
// Liste des pages // Liste des pages
self::$pages = $pagination['pages']; self::$pages = $pagination['pages'];
// News en fonction de la pagination // News en fonction de la pagination
@ -205,7 +205,7 @@ class news extends common {
} }
} }
// Pagination // Pagination
$pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['config','ItemsperPage'])); $pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['config','itemsperPage']));
// Liste des pages // Liste des pages
self::$pages = $pagination['pages']; self::$pages = $pagination['pages'];
// News en fonction de la pagination // News en fonction de la pagination