Reformulation

This commit is contained in:
fredtempez 2018-11-20 22:57:52 +01:00
commit 07760364e4
139 changed files with 5954 additions and 529 deletions

10
.gitignore vendored
View File

@ -1,3 +1,4 @@
<<<<<<< HEAD
# Fichiers temporaires
site/tmp/*
@ -11,8 +12,17 @@ site/data/*
site/file/source/*
site/file/thumb/*
# Fichiers de données
site/*
# Dossiers vides dans GitHub
!.gitkeep
# PHPStorm
.idea/
#Visual Code
.vscode

5
.htaccess Executable file → Normal file
View File

@ -1,7 +1,8 @@
# Cache le PHPSESSID de l'url
# Cache le PHPSESSID de l'url
SetEnv SESSION_USE_TRANS_SID 0
# Bloque l'accès à la liste des fichiers
Options -Indexes
# Attention, surtout ne rien modifier ci-dessous !
# Attention, surtout ne rien modifier ci-dessous !
# URL rewriting

View File

@ -1,12 +1,63 @@
# ChangeLog
# ChangeLog
## Version 8.4.6
* corrections :
- Encodage des dates dans la liste des articles news et blog
- Variable itemsperpage stockée dans le mauvais type
## Préversion 8.3.13 :
## Version 8.4.5
* corrections :
- nettoyage du code core.php
- W3C ajout de balise title manquante
- Inversion de deux balises dans Socials
## Version 8.4.4
* Correction :
- Valeur par défaut et d'update des éléments du footer dans les blocks
## Version 8.4.3
* Correction :
- URL incorrecte dans Metaimage
- Erreur dans la génération du sitemap
- Taille du texte de la bannnière maximale relative (vmax)
- Préfixe des en-têtes html pour OpenGraph
- Balise Titre dans Socials
- Conformité W3C des URL dans socials
## Version 8.4.2
* Correction :
- Modifications de la présentation des en-têtes d'articles de Blog et de News
- Format du mois au format long et en français
## Version 8.4.1
* Correction :
- Erreur de type empêchant l'affichage des articles du blog (nombre d'articles par page)
## Version 8.4.0
* Modifications :
- Footer dans 3 blocs contenant dans l'ordre : Texte, Réseaux sociaux, Copyright
- Pagination variable du nombres d'articles par page (news, blog et form)
- Position des modules Galerie et Form dans une page ; haut ; bas ou libre avec les doubles crochets insérés dans l'article []
- Prise en compte des balises OpenGraph obligatoires title , description, type et images
- Modification de la position des boutons retour et éditer lors de l'affichage d'un article si connecté
- Mise en forme de la composition des articles et des news
- Suppression du message de l'édition des redirections
* Corrections :
- Accès aux pages désactivées par le sitemap
- Réduction du temps d'affichage des notifications
- Image responsive en en-tête de l'article d'un blog
- Mise à jour du gestionnaire de fichiers en version 9.13.1
## version 8.3.13 :
* Modifications :
- Bannière "responsive", nouvelles options de positionnement
- Bouton Edit dans Blog
- Options de position des menus selon la position de la bannière
- Mise à jour TinyMCE
- Bouton Edition dans un article du blog
- Balise ALT dans les images du menu
- Correction RFM
## version 8.3.12 :
* Modification :

View File

@ -192,11 +192,11 @@ core.start = function() {
// Disparition de la notification
notificationTimer = setTimeout(function() {
$("#notification").fadeOut();
}, 4000);
}, 1500);
// Barre de progression
$("#notificationProgress").animate({
"width": "0%"
}, 4000, "linear");
}, 1500, "linear");
})
.trigger("mouseleave");
$("#notificationClose").on("click", function() {

View File

@ -24,7 +24,7 @@ class common {
const GROUP_MEMBER = 1;
const GROUP_MODERATOR = 2;
const GROUP_ADMIN = 3;
const ZWII_VERSION = '8.3.13';
const ZWII_VERSION = '8.4.6';
public static $actions = [];
public static $coreModuleIds = [
@ -55,7 +55,8 @@ class common {
'youtubeId' => ''
],
'timezone' => 'Europe/Paris',
'title' => 'Zwii, votre site en quelques clics !'
'title' => 'Zwii, votre site en quelques clics !',
'ItemsperPage' => 10
],
'core' => [
'dataVersion' => 0,
@ -66,14 +67,15 @@ class common {
'accueil' => [
// menu image
'typeMenu' => 'text',
'iconUrl' => '',
'disable' => false,
'iconUrl' => '',
'disable' => false,
// menu image
'content' => "<h3>Bienvenue sur votre nouveau site Zwii !</h3>\r\n<p><strong>Un email contenant le récapitulatif de votre installation vient de vous être envoyé.</strong></p>\r\n<p>Connectez-vous dès maintenant à votre espace membre afin de créer un site à votre image ! Vous allez pouvoir personnaliser le thème, créer des pages, ajouter des utilisateurs et bien plus encore !</p>\r\n<p>Si vous avez besoin d'aide ou si vous cherchez des informations sur Zwii, n'hésitez pas à jeter un œil à notre <a title=\"Forum\" href=\"http://forum.zwiicms.com/\">forum</a>.</p>",
'hideTitle' => false,
'metaDescription' => '',
'metaTitle' => '',
'moduleId' => '',
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 1,
'group' => self::GROUP_VISITOR,
@ -84,13 +86,14 @@ class common {
// menu image
'typeMenu' => 'text',
'iconUrl' => '',
'disable' => false,
// menu image
'disable' => false,
// menu image
'content' => "<p>Vous pouvez assigner des parents à vos pages afin de mieux organiser votre menu !</p>\r\n<div class=\"row\">\r\n<div class=\"col4\">\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam interdum, neque non vulputate hendrerit, arcu turpis dapibus nisl, id scelerisque metus lectus vitae nisi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec feugiat dolor et turpis finibus condimentum. Cras sit amet ligula sagittis justo.</p>\r\n</div>\r\n<div class=\"col4\">\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam interdum, neque non vulputate hendrerit, arcu turpis dapibus nisl, id scelerisque metus lectus vitae nisi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec feugiat dolor et turpis finibus condimentum. Cras sit amet ligula sagittis justo.</p>\r\n</div>\r\n<div class=\"col4\">\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam interdum, neque non vulputate hendrerit, arcu turpis dapibus nisl, id scelerisque metus lectus vitae nisi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec feugiat dolor et turpis finibus condimentum. Cras sit amet ligula sagittis justo.</p>\r\n</div>\r\n</div>",
'hideTitle' => false,
'metaDescription' => '',
'metaTitle' => '',
'moduleId' => '',
'modulePosition' => 'bottom',
'parentPageId' => 'accueil',
'position' => 1,
'group' => self::GROUP_VISITOR,
@ -101,29 +104,32 @@ class common {
// menu image
'typeMenu' => 'text',
'iconUrl' => '',
'disable' => false,
// menu image
'disable' => false,
// menu image
'content' => "<p>Cette page n'est visible que par les membres de votre site !</p>\r\n<div class=\"row\">\r\n<div class=\"col6\">\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam interdum, neque non vulputate hendrerit, arcu turpis dapibus nisl, id scelerisque metus lectus vitae nisi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec feugiat dolor et turpis finibus condimentum. Cras sit amet ligula sagittis justo.</p>\r\n</div>\r\n<div class=\"col6\">\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam interdum, neque non vulputate hendrerit, arcu turpis dapibus nisl, id scelerisque metus lectus vitae nisi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec feugiat dolor et turpis finibus condimentum. Cras sit amet ligula sagittis justo.</p>\r\n</div>r\n</div>",
'hideTitle' => false,
'metaDescription' => '',
'metaTitle' => '',
'moduleId' => '',
'parentPageId' => '',
'modulePosition' => 'bottom',
'position' => 2,
'group' => self::GROUP_MEMBER,
'targetBlank' => false,
'title' => 'Cachée'
],
'blog' => [
// menu image
'typeMenu' => 'text',
'iconUrl' => '',
'disable' => false,
'disable' => false,
// menu image
'content' => "<p>Cette page contient une instance du module de blog. Cliquez sur un article afin de le lire et de poster des commentaires.</p>",
'hideTitle' => false,
'metaDescription' => '',
'metaTitle' => '',
'moduleId' => 'blog',
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 3,
'group' => self::GROUP_VISITOR,
@ -134,13 +140,14 @@ class common {
// menu image
'typeMenu' => 'text',
'iconUrl' => '',
'disable' => false,
// menu image
'disable' => false,
// menu image
'content' => "<p>Cette page contient une instance du module de galeries photos. Cliquez sur la galerie ci-dessous afin de voir les photos qu'elle contient.</p>",
'hideTitle' => false,
'metaDescription' => '',
'metaTitle' => '',
'moduleId' => 'gallery',
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 4,
'group' => self::GROUP_VISITOR,
@ -150,14 +157,15 @@ class common {
'site-de-zwii' => [
// menu image
'typeMenu' => 'text',
'iconUrl' => '',
'disable' => false,
// menu image
'iconUrl' => '',
'disable' => false,
// menu image
'content' => "",
'hideTitle' => false,
'metaDescription' => '',
'metaTitle' => '',
'moduleId' => 'redirection',
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 5,
'group' => self::GROUP_VISITOR,
@ -168,13 +176,14 @@ class common {
// menu image
'typeMenu' => 'text',
'iconUrl' => '',
'disable' => false,
// menu image
'disable' => false,
// menu image
'content' => "<p>Cette page contient un exemple de formulaire conçu à partir du module de génération de formulaires. Il est configuré pour envoyer les données saisies par mail aux administrateurs du site.</p>",
'hideTitle' => false,
'metaDescription' => '',
'metaTitle' => '',
'moduleId' => 'form',
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 6,
'group' => self::GROUP_VISITOR,
@ -307,7 +316,10 @@ class common {
'socialsAlign' => 'center',
'text' => '',
'textAlign' => 'center',
'textColor' => 'rgba(33, 34, 35, 1)'
'textColor' => 'rgba(33, 34, 35, 1)',
'copyrightPosition' => 'center',
'textPosition' => 'hide',
'socialsPosition' => 'hide'
],
'header' => [
'backgroundColor' => 'rgba(255, 255, 255, 1)',
@ -589,6 +601,28 @@ class common {
}
}
/**
* Récupérer une copie d'écran du site Web pour le tag image si le fichier n'existe pas
* En local, copie du site décran de ZwiiCMS
*/
public function makeImageTag () {
if (!file_exists('site/file/source/screenshot.png'))
{
if ( strpos(helper::baseUrl(false),'localhost') == 0 AND strpos(helper::baseUrl(false),'127.0.0.1') == 0) {
$googlePagespeedData = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url='. helper::baseUrl(false) .'&screenshot=true');
$googlePagespeedData = json_decode($googlePagespeedData, true);
$screenshot = $googlePagespeedData['screenshot']['data'];
$screenshot = str_replace(array('_','-'),array('/','+'),$screenshot);
$data = 'data:image/jpeg;base64,'.$screenshot;
$data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $data));
file_put_contents( 'site/file/source/screenshot.png',$data);
}
}
}
/**
* Accède aux données
* @param array $keys Clé(s) des données
@ -852,12 +886,12 @@ class common {
if($this->getData(['core', 'dataVersion']) < 822) {
$this->setData(['config', 'maintenance', false]);
$this->setData(['core', 'dataVersion', 822]);
$this->saveData();
$this->saveData();
}
// Version 8.2.6
if($this->getData(['core', 'dataVersion']) < 826) {
$this->setData(['theme','header','linkHome',false]);
$this->setData(['core', 'dataVersion', 826]);
$this->setData(['core', 'dataVersion', 826]);
$this->SaveData();
}
// Version 8.3.13
@ -865,8 +899,33 @@ class common {
$this->setData(['theme','header','imageContainer','auto']);
$this->setData(['core', 'dataVersion', 8313]);
$this->SaveData();
}
// Version 8.4.0
if($this->getData(['core', 'dataVersion']) < 840) {
$this->setData(['theme','footer','socialsPosition','1']);
$this->setData(['theme','footer','textPosition','2']);
$this->setData(['theme','footer','copyrightPosition','3']);
$this->setData(['config','ItemsperPage',10]);
$this->setData(['core', 'dataVersion', 840]);
$this->SaveData();
}
// Version 8.4.4
if($this->getData(['core', 'dataVersion']) < 844) {
$this->setData(['theme','footer','socialsPosition','none']);
$this->setData(['theme','footer','textPosition','none']);
$this->setData(['theme','footer','copyrightPosition','center']);
$this->setData(['core', 'dataVersion', 844]);
$this->SaveData();
}
// Version 8.4.6
if($this->getData(['core', 'dataVersion']) < 846) {
$this->setData(['config','ItemsperPage',10]);
$this->setData(['core', 'dataVersion', 846]);
$this->SaveData();
}
}
}
@ -976,10 +1035,8 @@ class core extends common {
}
}
$css .= 'header{background-size:' . $this->getData(['theme','header','imageContainer']).'}';
$css .= 'header{background-color:' . $colors['normal'] . ';height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) . ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}';
// Modif CrowueWeb pour la bannière
$css .= 'header{background-color:' . $colors['normal'] . ';height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) . ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}';
$css .= '@media (max-width: 767px) {header{height:' . $this->getData(['theme', 'header', 'height'])/2 . 'px;line-height:' . $this->getData(['theme', 'header', 'height'])/2 . 'px;}}';
// Fin modif Croque Web
if($themeHeaderImage = $this->getData(['theme', 'header', 'image'])) {
$css .= 'header{background-image:url("../file/source/' . $themeHeaderImage . '");background-position:' . $this->getData(['theme', 'header', 'imagePosition']) . ';background-repeat:' . $this->getData(['theme', 'header', 'imageRepeat']) . '}';
}
@ -1133,7 +1190,7 @@ class core extends common {
// Menu image
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']),
'disable' => $this->getData(['page', $this->getUrl(0), 'disable'])
'disable' => $this->getData(['page', $this->getUrl(0), 'disable'])
// Menu image
]);
$pageContent = $this->getData(['page', $this->getUrl(0), 'content']);
@ -1162,7 +1219,7 @@ class core extends common {
if(array_key_exists($action, $module::$actions)) {
$module->$action();
$output = $module->output;
// Check le groupe de l'utilisateur
// Check le groupe de l'utilisateur
if(
(
$module::$actions[$action] === self::GROUP_VISITOR
@ -1174,7 +1231,7 @@ class core extends common {
AND $output['access'] === true
) {
// Enregistrement du contenu de la méthode POST lorsqu'une notice est présente
if(common::$inputNotices) {
if(common::$inputNotices) {
foreach($_POST as $postId => $postValue) {
if(is_array($postValue)) {
foreach($postValue as $subPostId => $subPostValue) {
@ -1251,9 +1308,22 @@ class core extends common {
if(file_exists($viewPath)) {
ob_start();
include $viewPath;
$this->addOutput([
'content' => ($output['showPageContent'] ? $pageContent : '') . ob_get_clean()
]);
$modpos = $this->getData(['page', $this->getUrl(0), 'modulePosition']);
if ($modpos === 'top') {
$this->addOutput([
'content' => ob_get_clean() . ($output['showPageContent'] ? $pageContent : '')]);
}
else if ($modpos === 'free') {
$begin = strstr($pageContent, '[]', true);
$end = strstr($pageContent, '[]');
$cut=2;
$end=substr($end,-strlen($end)+$cut);
$this->addOutput([
'content' => ($output['showPageContent'] ? $begin : '') . ob_get_clean() . ($output['showPageContent'] ? $end : '')]); }
else {
$this->addOutput([
'content' => ($output['showPageContent'] ? $pageContent : '') . ob_get_clean()]);
}
}
}
// Librairies
@ -1604,10 +1674,11 @@ class helper {
* Crée un système de pagination (retourne un tableau contenant les informations sur la pagination (first, last, pages))
* @param array $array Tableau de donnée à utiliser
* @param string $url URL à utiliser, la dernière partie doit correspondre au numéro de page, par défaut utiliser $this->getUrl()
* @param string $item pagination nombre d'éléments par page
* @param null|int $sufix Suffixe de l'url
* @return array
*/
public static function pagination($array, $url, $sufix = null) {
public static function pagination($array, $url, $item, $sufix = null) {
// Scinde l'url
$url = explode('/', $url);
// Url de pagination
@ -1617,13 +1688,13 @@ class helper {
// Nombre d'éléments à afficher
$nbElements = count($array);
// Nombre de page
$nbPage = ceil($nbElements / 10);
$nbPage = ceil($nbElements / $item);
// Page courante
$currentPage = is_numeric($urlPagination) ? self::filter($urlPagination, self::FILTER_INT) : 1;
// Premier élément de la page
$firstElement = ($currentPage - 1) * 10;
$firstElement = ($currentPage - 1) * $item;
// Dernier élément de la page
$lastElement = $firstElement + 10;
$lastElement = $firstElement + $item;
$lastElement = ($lastElement > $nbElements) ? $nbElements : $lastElement;
// Mise en forme de la liste des pages
$pages = '';
@ -1765,8 +1836,8 @@ class layout extends common {
*/
public function showCopyright() {
$items = '<div id="footerCopyright">';
$items .= 'Motorisé par <a href="http://zwiicms.com/" target="_blank">Zwii</a>';
$items .= ' | <a href="' . helper::baseUrl() . 'sitemap">Plan du site</a>';
$items .= 'Motorisé par <a href="http://zwiicms.com/" onclick="window.open(this.href);return false" title="Zwii CMS sans base de données, très léger et performant">Zwii</a>';
$items .= ' | <a href="' . helper::baseUrl() . 'sitemap" title="Plan du site" >Plan du site</a>';
if(
(
$this->getData(['theme', 'footer', 'loginLink'])
@ -1774,7 +1845,7 @@ class layout extends common {
)
OR $this->getUrl(0) === 'theme'
) {
$items .= '<span id="footerLoginLink" ' . ($this->getUrl(0) === 'theme' ? 'class="displayNone"' : '') . '> | <a href="' . helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()) . '">Connexion</a></span>';
$items .= '<span id="footerLoginLink" ' . ($this->getUrl(0) === 'theme' ? 'class="displayNone"' : '') . '> | <a href="' . helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()) . '" title="Connexion à l\'administration" >Connexion</a></span>';
}
$items .= '</div>';
echo $items;
@ -1813,12 +1884,12 @@ class layout extends common {
$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') )
{$items .= '<a href="#">';}
else {
$items .= '<a href="' . helper::baseUrl() . $parentPageId . '"' . $active . $targetBlank . '>'; }
$items .= '<a href="' . helper::baseUrl() . $parentPageId . '" title="'.$this->getData(['page', $parentPageId, 'title']).'" ' . $active . $targetBlank . '>'; }
switch ($this->getData(['page', $parentPageId, 'typeMenu'])) {
@ -1827,52 +1898,52 @@ class layout extends common {
break;
case 'text' :
$items .= $this->getData(['page', $parentPageId, 'title']);
break;
break;
case 'icon' :
if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") {
$items .= '<img src="'. helper::baseUrl(false) .'site/file/source/'.$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']).'" />';
} else {
$items .= $this->getData(['page', $parentPageId, 'title']);
}
break;
case 'icontitle' :
if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") {
$items .= '<img 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']).'"/>';
} else {
$items .= $this->getData(['page', $parentPageId, 'title']);
}
}
break;
case 'icontext' :
if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") {
$items .= '<img src="'. helper::baseUrl(false) .'site/file/source/'.$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;
break;
}
// Menu Image
if($childrenPageIds) {
$items .= template::ico('down', 'left');
}
$items .= '</a>';
$items .= '<ul>';
foreach($childrenPageIds as $childKey) {
// Propriétés de l'item
$active = ($childKey === $currentPageId) ? ' class="active"' : '';
$targetBlank = $this->getData(['page', $childKey, 'targetBlank']) ? ' target="_blank"' : '';
// Mise en page du sous-item
// Menu Image
if ( $this->getData(['page',$childKey,'disable']) === true
if ( $this->getData(['page',$childKey,'disable']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') )
{$items .= '<a href="#">';}
@ -1885,30 +1956,30 @@ class layout extends common {
break;
case 'text' :
$items .= $this->getData(['page', $childKey, 'title']);
break;
break;
case 'icon' :
if ($this->getData(['page', $childKey, 'iconUrl']) != "") {
$items .= '<img src="'. helper::baseUrl(false) .'site/file/source/'.$this->getData(['page', $childKey, 'iconUrl']).'" />';
$items .= '<img alt="'.$this->getData(['page', $parentPageId, 'title']).'" src="'. helper::baseUrl(false) .'site/file/source/'.$this->getData(['page', $childKey, 'iconUrl']).'" />';
} else {
$items .= $this->getData(['page', $parentPageId, 'title']);
}
break;
case 'icontitle' :
if ($this->getData(['page', $childKey, 'iconUrl']) != "") {
$items .= '<img src="'. helper::baseUrl(false) .'site/file/source/'.$this->getData(['page', $childKey, 'iconUrl']).'" title="';
$items .= '<img alt="'.$this->getData(['page', $parentPageId, 'title']).'" src="'. helper::baseUrl(false) .'site/file/source/'.$this->getData(['page', $childKey, 'iconUrl']).'" title="';
$items .= $this->getData(['page', $childKey, 'title']).'"/>';
} else {
$items .= $this->getData(['page', $childKey, 'title']);
}
}
break;
case 'icontext' :
if ($this->getData(['page', $childKey, 'iconUrl']) != "") {
$items .= '<img src="'. helper::baseUrl(false) .'site/file/source/'.$this->getData(['page', $childKey, 'iconUrl']).'" />';
$items .= '<img alt="'.$this->getData(['page', $parentPageId, 'title']).'" src="'. helper::baseUrl(false) .'site/file/source/'.$this->getData(['page', $childKey, 'iconUrl']).'" />';
$items .= $this->getData(['page', $childKey, 'title']);
} else {
$items .= $this->getData(['page', $childKey, 'title']);
}
break;
break;
}
$items .= '</a></li>';
// Menu Image
@ -1937,15 +2008,33 @@ class layout extends common {
*/
public function showMetaTitle() {
echo '<title>' . $this->core->output['metaTitle'] . '</title>';
echo '<meta property="og:title" content="' . $this->core->output['metaTitle'] . '" />';
}
/**
* Affiche la meta description
*/
public function showMetaDescription() {
echo '<meta name="description" content="' . $this->core->output['metaDescription'] . '">';
echo '<meta name="description" content="' . $this->core->output['metaDescription'] . '" />';
echo '<meta property="og:description" content="' . $this->core->output['metaDescription'] . '" />';
}
/**
* Affiche le meta type
*/
public function showMetaType() {
echo '<meta property="og:type" content="website" />';
}
/**
* Affiche la meta image (site screenshot)
*/
public function showMetaImage() {
echo '<meta property="og:image" content="' . helper::baseUrl() .'/site/file/source/screenshot.png" />';
}
/**
* Affiche la notification
*/
@ -2055,18 +2144,23 @@ class layout extends common {
switch($socialName) {
case 'facebookId':
$socialUrl = 'https://www.facebook.com/';
$title = 'Facebook';
break;
case 'googleplusId':
$socialUrl = 'https://plus.google.com/';
$title = 'Google +';
break;
case 'instagramId':
$socialUrl = 'https://www.instagram.com/';
$title = 'Instagram';
break;
case 'pinterestId':
$socialUrl = 'https://pinterest.com/';
$title = 'Pinterest';
break;
case 'twitterId':
$socialUrl = 'https://twitter.com/';
$title = 'Twitter';
break;
case 'youtubeId':
$socialUrl = 'https://www.youtube.com/channel/';
@ -2075,7 +2169,7 @@ class layout extends common {
$socialUrl = '';
}
if($socialId !== '') {
$socials .= '<a href="' . $socialUrl . $socialId . '" target="_blank">' . template::ico(substr($socialName, 0, -2)) . '</a>';
$socials .= '<a href="' . $socialUrl . $socialId . '" onclick="window.open(this.href);return false" title="' . $title . '">' . template::ico(substr($socialName, 0, -2)) . '</a>';
}
}
if($socials !== '') {

View File

@ -1,11 +1,13 @@
<?php $layout = new layout($this); ?>
<!DOCTYPE html>
<html>
<html prefix="og: http://ogp.me/ns#" lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php $layout->showMetaTitle(); ?>
<?php $layout->showMetaDescription(); ?>
<?php $layout->showMetaType(); ?>
<?php $layout->showMetaImage(); ?>
<?php $layout->showFavicon(); ?>
<?php $layout->showVendor(); ?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">

View File

@ -45,7 +45,7 @@ h3 {
font-size: 1.4em;
}
h4 {
font-size: 1.2em;
font-size: 1.0em;
}
/* Listes */
@ -86,6 +86,16 @@ img[align='right'] {
margin-left: 10px;
}
/*
Signature dans les articles blog et news
*/
.signature {
font-size: 0.8em;
font-style: italic;
text-align: right;
}
/* Tableau */
:not([class^="col"]) > .tableWrapper {
margin: 10px 0;
@ -305,6 +315,11 @@ header .container {
body > nav {
margin: 0 -10px;
}
/* Items du menu */
nav a > img {
margin: -4px 0;
vertical-align: middle;
}
nav #toggle {
cursor: pointer;
text-align: right;
@ -398,9 +413,15 @@ footer {
text-align: center;
font-size: .8em;
padding: 10px 20px;
vertical-align:middle;
}
footer .col4 {
vertical-align: middle;
}
footer #footerSocials {
font-size: 1.6em;
font-size: 1.0em;
}
footer #footerSocials span {
color: #FFF;

View File

@ -1,11 +1,13 @@
<?php $layout = new layout($this); ?>
<!DOCTYPE html>
<html>
<html prefix="og: http://ogp.me/ns#" lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php $layout->showMetaTitle(); ?>
<?php $layout->showMetaDescription(); ?>
<?php $layout->showMetaType(); ?>
<?php $layout->showMetaImage(); ?>
<?php $layout->showFavicon(); ?>
<?php $layout->showVendor(); ?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">

View File

@ -1,11 +1,13 @@
<?php $layout = new layout($this); ?>
<!DOCTYPE html>
<html>
<html prefix="og: http://ogp.me/ns#" lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php $layout->showMetaTitle(); ?>
<?php $layout->showMetaDescription(); ?>
<?php $layout->showMetaType(); ?>
<?php $layout->showMetaImage(); ?>
<?php $layout->showFavicon(); ?>
<?php $layout->showVendor(); ?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
@ -135,11 +137,53 @@
)
): ?>
<!-- Pied de page dans le site -->
<footer <?php if($this->getData(['theme', 'footer', 'position']) === 'hide'): ?>class="displayNone"<?php endif; ?>>
<div class="container">
<?php $layout->showSocials(); ?>
<?php $layout->showFooterText(); ?>
<?php $layout->showCopyright(); ?>
<div class="row">
<div class="col4" id="siteLeft"> <!-- bloc gauche -->
<?php
if($this->getData(['theme', 'footer', 'textPosition']) === 'left') {
$layout->showFooterText();}
?>
<?php
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'left') {
$layout->showSocials(); }
?>
<?php
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'left') {
$layout->showCopyright(); }
?>
</div>
<div class="col4" id="siteCenter"> <!-- bloc central -->
<?php
if($this->getData(['theme', 'footer', 'textPosition']) === 'center') {
$layout->showFooterText(); }
?>
<?php
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') {
$layout->showSocials(); }
?>
<?php
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') {
$layout->showCopyright(); }
?>
</div>
<div class="col4" id="siteRight"> <!-- bloc droite -->
<?php
if($this->getData(['theme', 'footer', 'textPosition']) === 'right') {
$layout->showFooterText(); }
?>
<?php
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') {
$layout->showSocials(); }
?>
<?php
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') {
$layout->showCopyright(); }
?>
</div>
</div>
</div>
</footer>
<?php endif; ?>
@ -147,10 +191,51 @@
<?php if($this->getData(['theme', 'footer', 'position']) === 'body'): ?>
<!-- Pied de page dans le fond du site -->
<footer>
<div class="container">
<?php $layout->showSocials(); ?>
<?php $layout->showFooterText(); ?>
<?php $layout->showCopyright(); ?>
<div class="container-large">
<div class="row">
<div class="col4" id="bodyLeft"> <!-- bloc gauche -->
<?php
if($this->getData(['theme', 'footer', 'textPosition']) === 'left') {
$layout->showFooterText(); }
?>
<?php
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'left') {
$layout->showSocials(); }
?>
<?php
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'left') {
$layout->showCopyright(); }
?>
</div>
<div class="col4" id="bodyCenter"> <!-- bloc central -->
<?php
if($this->getData(['theme', 'footer', 'textPosition']) === 'center') {
$layout->showFooterText(); }
?>
<?php
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') {
$layout->showSocials(); }
?>
<?php
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') {
$layout->showCopyright(); }
?>
</div>
<div class="col4" id="bodyRight"> <!-- bloc droite -->
<?php
if($this->getData(['theme', 'footer', 'textPosition']) === 'right') {
$layout->showFooterText(); }
?>
<?php
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') {
$layout->showSocials(); }
?>
<?php
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') {
$layout->showCopyright();}
?>
</div>
</div>
</div>
</footer>
<?php endif; ?>

View File

@ -134,11 +134,20 @@ class config extends common {
'Pacific/Fiji' => '(GMT+12:00) Fiji',
'Asia/Kamchatka' => '(GMT+12:00) Kamchatka'
];
// Nombre d'objets par page
public static $ItemsList = [
5 => '5 articles',
10 => '10 articles',
15 => '15 articles',
20 => '20 articles'
];
/**
* Sauvegarde des données
*/
public function backup() {
// Creation du ZIP
$fileName = date('Y-m-d-h-i-s', time()) . '.zip';
$zip = new ZipArchive();
@ -159,6 +168,34 @@ class config extends common {
]);
}
/**
* Réalise une copie d'écran
* https://www.codexworld.com/capture-screenshot-website-url-php-google-api/
*/
public function configmetaimage() {
// fonction désactivée pour un site local
if ( strpos(helper::baseUrl(false),'localhost') > 0 OR strpos(helper::baseUrl(false),'127.0.0.1') > 0) {
$site = 'https://ZwiiCMS.com'; } else {
$site = helper::baseUrl(false); }
$googlePagespeedData = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url='. $site .'&screenshot=true&key=AIzaSyA_JOJidlWFgEiyxTlSGi2_fORgYsCZFtA');
$googlePagespeedData = json_decode($googlePagespeedData, true);
$screenshot = $googlePagespeedData['screenshot']['data'];
$screenshot = str_replace(array('_','-'),array('/','+'),$screenshot);
$data = 'data:image/jpeg;base64,'.$screenshot;
$data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $data));
file_put_contents( 'site/file/source/screenshot.png',$data);
// Valeurs en sortie
$this->addOutput([
'notification' => 'Image tag réinitialisée',
'redirect' => helper::baseUrl() . 'config',
'state' => true
]);
}
/**
* Configuration
*/
@ -184,7 +221,8 @@ class config extends common {
'youtubeId' => $this->getInput('configSocialYoutubeId')
],
'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)
]
]);
if(self::$inputNotices === []) {

View File

@ -1,3 +1,4 @@
<?php $this->makeImageTag(); ?>
<?php echo template::formOpen('configForm'); ?>
<div class="row">
<div class="col2">
@ -16,18 +17,22 @@
<div class="col6">
<div class="block">
<h4>Informations générales</h4>
<?php echo template::text('configTitle', [
'label' => 'Titre du site',
'value' => $this->getData(['config', 'title'])
]); ?>
<?php echo template::textarea('configMetaDescription', [
'label' => 'Description du site',
'value' => $this->getData(['config', 'metaDescription'])
]); ?>
<?php echo template::select('configHomePageId', helper::arrayCollumn($this->getData(['page']), 'title', 'SORT_ASC'), [
'label' => 'Page d\'accueil',
'selected' => $this->getData(['config', 'homePageId'])
]); ?>
<?php echo template::text('configTitle', [
'label' => 'Titre du site',
'value' => $this->getData(['config', 'title']),
'help' => 'Affiché dans la barre de titre et inclus lors des partages sur les réseaux sociaux'
]); ?>
<?php echo template::textarea('configMetaDescription', [
'label' => 'Description du site',
'value' => $this->getData(['config', 'metaDescription']),
'help' => 'La description est incluse lors des partages sur les réseaux sociaux'
]); ?>
</div>
<div class="block">
<h4>Options avancées</h4>
@ -45,11 +50,18 @@
]); ?>
<?php echo template::checkbox('configCookieConsent', true, 'Message de consentement pour l\'utilisation des cookies', [
'checked' => $this->getData(['config', 'cookieConsent'])
]); ?>
]); ?>
<?php echo template::checkbox('rewrite', true, 'Réécriture d\'URL', [
'checked' => helper::checkRewrite(),
'help' => 'Afin d\'éviter de bloquer votre site pensez à vérifier que le module de réécriture d\'URL est bien actif sur votre serveur avant d\'activer cette fonctionnalité.'
]); ?>
<?php echo template::select('ItemsperPage', $module::$ItemsList, [
'label' => 'Pagination Blog et News',
'selected' => $this->getData(['config', 'ItemsperPage']),
'help' => 'Nombre d\'articles de blog ou de news par page'
]); ?>
</div>
</div>
<div class="col6">
@ -132,6 +144,24 @@
</div>
</div>
</div>
<div class="block">
<h4>Copie d'écran pour OpenGraph :</h4>
<div class="col3">
<!--
Bouton inutile
<?php echo template::button('configmetaImage', [
'href' => helper::baseUrl() . 'config/metaimage',
'value' => 'Rafraîchir la capture <br /> d\'écran du site'
]); ?>
-->
</div>
<div class="col6">
<p><img src='<?php echo helper::baseUrl(false) . 'site/file/source/screenshot.png';?>' />
</div>
<div class="col3">
</div>
<p>Cette copie d'écran est nécessaire aux partages sur les réseaux sociaux. Elle est régénérée lorsque le fichier screenshot.png est effacé du gestionnaire de fichiers.</p>
</div>
</div>
</div>
<?php echo template::formClose(); ?>

View File

@ -32,7 +32,12 @@ class page extends common {
'icontext' => 'Icône et texte'
];
// menu image
// Position du module
public static $modulePosition = [
'bottom' => 'En bas',
'top' => 'En haut',
'free' => 'Libre'
];
/**
* Création
*/
@ -54,6 +59,7 @@ class page extends common {
'metaTitle' => '',
'moduleId' => '',
'parentPageId' => '',
'modulePosition' => 'bottom',
'position' => 0,
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
@ -183,6 +189,7 @@ class page extends common {
'metaDescription' => $this->getInput('pageEditMetaDescription', helper::FILTER_STRING_LONG),
'metaTitle' => $this->getInput('pageEditMetaTitle'),
'moduleId' => $this->getInput('pageEditModuleId'),
'modulePosition' => $this->getInput('configModulePosition'),
'parentPageId' => $this->getInput('pageEditParentPageId'),
'position' => $position,
'group' => $this->getInput('pageEditGroup', helper::FILTER_INT),

View File

@ -1,9 +1,11 @@
<?php echo template::formOpen('pageEditForm'); ?>
<div class="row">
<div class="col2">
<div class="col2">
<?php $href = helper::baseUrl() . $this->getUrl(2); ?>
<?php if ($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'redirection')$href = helper::baseUrl(); ?>
<?php echo template::button('pageEditBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(2),
'href' => $href,
'ico' => 'left',
'value' => 'Retour'
]); ?>
@ -128,6 +130,13 @@
'maxlength' => '500',
'value' => $this->getData(['page', $this->getUrl(2), 'metaDescription'])
]); ?>
<?php if (($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'form') or ($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'gallery')) {
echo template::select('configModulePosition', $module::$modulePosition,[
'help' => 'En position libre ajoutez manuellement le module en plaçant deux crochets [] à l\'endroit voulu dans votre page.',
'label' => 'Position du module dans la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'modulePosition'])
]);
} ?>
<?php echo template::checkbox('pageEditHideTitle', true, 'Cacher le titre', [
'checked' => $this->getData(['page', $this->getUrl(2), 'hideTitle'])
]); ?>

View File

@ -1,11 +1,17 @@
<ul>
<?php foreach($this->getHierarchy() as $parentId => $childIds): ?>
<li>
<a href="<?php echo helper::baseUrl() . $parentId; ?>"><?php echo $this->getData(['page', $parentId, 'title']); ?></a>
<?php if ($this->getData(['page', $parentId, 'disable']) == false) { ?>
<a href="<?php echo helper::baseUrl() . $parentId; ?>"><?php echo $this->getData(['page', $parentId, 'title']); ?></a>
<?php } else { ?>
<?php echo $this->getData(['page', $parentId, 'title']); }?>
<ul>
<?php foreach($childIds as $childId): ?>
<li>
<a href="<?php echo helper::baseUrl() . $childId; ?>"><?php echo $this->getData(['page', $childId, 'title']); ?></a>
<?php if ($this->getData(['page', $childId, 'disable']) == false) { ?>
<a href="<?php echo helper::baseUrl() . $childId; ?>"><?php echo $this->getData(['page', $childId, 'title']); ?></a>
<?php } else { ?>
<?php echo $this->getData(['page', $childId, 'title']); }?>
</li>
<?php endforeach; ?>
</ul>

View File

@ -10,6 +10,7 @@
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3
* @link http://zwiicms.com/
* @Edition : 23/9/18 Frédéric Tempez <frederic.tempez@outlook.com>
*/
class theme extends common {
@ -62,6 +63,12 @@ class theme extends common {
'Ubuntu' => 'Ubuntu',
'Vollkorn' => 'Vollkorn'
];
public static $footerblocks = [
'hide' => 'Masqué',
'left' => 'Bloc Gauche',
'center' => 'Bloc Central',
'right' => 'Bloc Droite'
];
public static $fontWeights = [
'normal' => 'Normal',
'bold' => 'Gras'
@ -83,7 +90,7 @@ class theme extends common {
'1.8em' => 'Petite',
'2em' => 'Moyenne',
'2.2em' => 'Grande',
'2.4em' => 'Très grande'
'2.4vmax' => 'Très grande'
];
public static $headerHeights = [
'100px' => 'Très petite (100 pixels)',
@ -266,7 +273,10 @@ class theme extends common {
'socialsAlign' => $this->getInput('themeFooterSocialsAlign'),
'text' => $this->getInput('themeFooterText', null),
'textAlign' => $this->getInput('themeFooterTextAlign'),
'textColor' => $this->getInput('themeFooterTextColor')
'textColor' => $this->getInput('themeFooterTextColor'),
'copyrightPosition' => $this->getInput('themeFooterCopyrightPosition'),
'textPosition' => $this->getInput('themeFooterTextPosition'),
'socialsPosition' => $this->getInput('themeFooterSocialsPosition')
]]);
// Valeurs en sortie
$this->addOutput([

View File

@ -8,6 +8,7 @@
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3
* @link http://zwiicms.com/
* @Author 23/9/18 Frédéric Tempez <frederic.tempez@outlook.com>
*/
/**
@ -21,6 +22,7 @@ $("input, select").on("change", function() {
css += "footer a{color:" + textColor + "}";
// Hauteur du pied de page
css += "footer .container > div{margin:" + $("#themeFooterHeight").val() + " 0}";
css += "footer .container-large > div{margin:" + $("#themeFooterHeight").val() + " 0}";
// Alignement du contenu
css += "#footerSocials{text-align:" + $("#themeFooterSocialsAlign").val() + "}";
css += "#footerText{text-align:" + $("#themeFooterTextAlign").val() + "}";
@ -52,6 +54,71 @@ $("input, select").on("change", function() {
break;
}
});
// Position dans les blocs FT
// Bloc texte personnalisé
$("#themeFooterForm").on("change",function() {
switch($("#themeFooterTextPosition").val()) {
case 'hide':
$("#footerText").hide();
break;
case 'left':
$("#footerText").show().appendTo("#bodyLeft");
$("#footerText").show().appendTo("#siteLeft");
break;
case 'center':
$("#footerText").show().appendTo("#bodyCenter");
$("#footerText").show().appendTo("#siteCenter");
break;
case 'right':
$("#footerText").show().appendTo("#bodyRight");
$("#footerText").show().appendTo("#siteRight");
break;
}
switch($("#themeFooterSocialsPosition").val()) {
case 'hide':
$("#footerSocials").hide();
break;
case 'left':
$("#footerSocials").show().appendTo("#bodyLeft");
$("#footerSocials").show().appendTo("#siteLeft");
break;
case 'center':
$("#footerSocials").show().appendTo("#bodyCenter");
$("#footerSocials").show().appendTo("#siteCenter");
break;
case 'right':
$("#footerSocials").show().appendTo("#bodyRight");
$("#footerSocials").show().appendTo("#siteRight");
break;
}
switch($("#themeFooterCopyrightPosition").val()) {
case 'hide':
$("#footerCopyright").hide();
break;
case 'left':
$("#footerCopyright").show().appendTo("#bodyLeft");
$("#footerCopyright").show().appendTo("#siteLeft");