Merge branch '10400' into editeur

This commit is contained in:
fredtempez 2020-12-13 17:41:33 +01:00
commit 396fe6ce26
75 changed files with 1353 additions and 1066 deletions

15
.gitignore vendored
View File

@ -36,9 +36,12 @@ site/data/journal.log
.DS_Store
site/.DS_Store
site/file/.DS_Store
site/tmp/5f7f5e998762c.png
site/tmp/5f7f5e9987628.png
site/tmp/5f7f5ea3e983b.png
site/tmp/5f7f5ea3e9837.png
site/tmp/5f7f5ea20d5eb.png
site/tmp/5f7f5ea20d5ee.png
site/data/es/locale.json
site/data/es/module.json
site/data/es/page.json
site/data/en/locale.json
site/data/en/module.json
site/data/en/page.json
site/data/de/locale.json
site/data/de/module.json
site/data/de/page.json

View File

@ -15,7 +15,38 @@
- Approbation des commentaires
- Gestion des thèmes :
- Bouton de réinitialisation avec confirmation
- Traduction automatique dans la langue du navigateur.
- Amélioration de la structure du flux RSS.
## Version 10.3.11
Modification :
- Message sur l'utilisation des cookies
Coorection :
- Recherche inopérante dans les articles des blogs.
## Version 10.3.10
Corrections :
- Conflit page inactive et droit d'un membre.
- Module de recherche, correction dans les pages enfants.
- Module formulaire, perte des données en cas d'édition du fomulaire ou des champs.
Modification :
- TinyMCE nettoyage init.js d'options non supportées.
## Version 10.3.09
Corrections :
- Configuration : persistance de l'ouverture des blocs.
- Réinitialisation du mot de passe :
- Remise à zéro du timer après renouvellement du mot de passe.
- Affichage de le fenêtre "Nouveau mot de passe" allégée.
- Redirection sur la page d'accueil.
- Modules news et blog : transparence icône RSS.
- Position de l'écran de configuration
## Version 10.3.08
Corrections :
- Notification de mise à jour d'update bloqué
- Backup : double commentaire entraînant un bug d'affichage
## Version 10.3.07
- Petites corrections
- Bouton format dans TinyMCE

View File

@ -118,8 +118,7 @@ class template {
copy ('core/vendor/zwiico/png/'.$letters[$secondNumber] . '.png', 'site/tmp/' . $secondLetter . '.png');
// Début du wrapper
$html = '<div class="captcha" id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="captcha inputWrapper ' . $attributes['classWrapper'] . '">';
// Label
$html .= self::label($attributes['id'],
'<img src="' . helper::baseUrl(false) . 'site/tmp/' . $firstLetter . '.png" />&nbsp;<strong>' . $operator . '</strong>&nbsp;<img class="captchaNumber" src="' . helper::baseUrl(false) . 'site/tmp/' . $secondLetter . '.png" /> en chiffres ?', [

View File

@ -221,14 +221,18 @@ core.start = function() {
/**
* Message sur l'utilisation des cookies
*/
var analytics = "";
if (<?php echo json_encode($this->getData(['config', 'analyticsId'])); ?>) {
analytics = ' grâce au cookie Google Analytics'
}
if(<?php echo json_encode($this->getData(['config', 'cookieConsent'])); ?>) {
if(document.cookie.indexOf("ZWII_COOKIE_CONSENT") === -1) {
$("body").append(
$("<div>").attr("id", "cookieConsent").append(
$("<span>").text("En poursuivant votre navigation sur ce site, vous acceptez l'utilisation de cookies et de vos données de visite."),
$("<span>").html("<p>Ce site utilise des cookies pour assurer l'authentification, améliorer l'expérience utilisateur"+analytics+". <br/>En cliquant sur ”Jaccepte”, vous acceptez lutilisation de ces cookies.</p>"),
$("<span>")
.attr("id", "cookieConsentConfirm")
.text("OK")
.text("Accepter")
.on("click", function() {
// Créé le cookie d'acceptation
var expires = new Date();
@ -237,7 +241,19 @@ core.start = function() {
document.cookie = "ZWII_COOKIE_CONSENT=true;" + expires;
// Ferme le message
$(this).parents("#cookieConsent").fadeOut();
})
}),
$("<span>")
.attr("id", "cookieConsentRefuse")
.text("Refuser")
.on("click", function() {
// Créé le cookie d'acceptation
var expires = new Date();
expires.setFullYear(expires.getFullYear() + 1);
expires = "expires=" + expires.toUTCString();
document.cookie = "ZWII_COOKIE_CONSENT=false;" + expires;
// Ferme le message
$(this).parents("#cookieConsent").fadeOut();
}),
)
);
}

View File

@ -45,7 +45,7 @@ class common {
const ACCESS_TIMER = 1800;
// Numéro de version
const ZWII_VERSION = '10.4.00';
const ZWII_VERSION = '10.4.00.010';
const ZWII_UPDATE_CHANNEL = "v10";
public static $actions = [];
@ -146,14 +146,28 @@ class common {
self::GROUP_MODERATOR => 'Modérateur',
self::GROUP_ADMIN => 'Administrateur'
];
// Langues proposées
public static $i18nList = [
'fr' => 'Français (fr)',
'de' => 'Allemand (de)',
'en' => 'Anglais (en)',
'es' => 'Espagnol (es)',
'it' => 'Italien (it)',
'nl' => 'Néerlandais (nl)',
'pt' => 'Portugais (pt)',
];
// Langue courante
public static $i18nCurrent = 'fr';
public static $timezone;
private $url = '';
// Données de site
private $user = [];
private $core = [];
private $config = [];
// Dossier localisé
private $page = [];
private $module = [];
private $locale = [];
// Descripteur de données Entrées / Sorties
// Liste ici tous les fichiers de données
@ -167,7 +181,7 @@ class common {
'theme' => '',
'admin' => '',
'blacklist' => '',
'translate' => ''
'locale' => ''
];
/**
@ -182,13 +196,18 @@ class common {
$this->input['_COOKIE'] = $_COOKIE;
}
// Déterminer le dossier de langues
if (isset($_POST['ZWII_USER_I18N'])) {
self::$i18nCurrent = $_POST['ZWII_USER_I18N'];
}
// Instanciation de la classe des entrées / sorties
// Récupére les descripteurs
foreach ($this->dataFiles as $keys => $value) {
// Constructeur JsonDB
$this->dataFiles[$keys] = new \Prowebcraft\JsonDb([
'name' => $keys . '.json',
'dir' => $this->dirData ($keys,'fr')
'dir' => $this->dataPath ($keys,self::$i18nCurrent)
]);;
}
@ -208,9 +227,9 @@ class common {
// Installation fraîche, initialisation des modules manquants
// La langue d'installation par défaut est fr
foreach ($this->dataFiles as $stageId => $item) {
$folder = $this->dirData ($stageId, 'fr');
$folder = $this->dataPath ($stageId, self::$i18nCurrent);
if (file_exists($folder . $stageId .'.json') === false) {
$this->initData($stageId,'fr');
$this->initData($stageId,self::$i18nCurrent);
common::$coreNotices [] = $stageId ;
}
}
@ -220,10 +239,19 @@ class common {
$this->user = $this->getData(['user', $this->getInput('ZWII_USER_ID')]);
}
// Auto traduction
if ( $this->getData(['translate','active'])) {
// Traduction du site avec le script Google
if ( $this->getData(['config','translate','scriptGoogle'])) {
// Lire la langue stockée dans le cookie (choix manuel)
if ( isset($_COOKIE['ZWII_USER_I18N']) ) {
$lan_cookie = $_COOKIE['ZWII_USER_I18N'];
}
// Lire la langue du navigateur
$lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
if ( $this->getData(['config','translate','autoDetect'])) {
$lan_browser = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
}
// Priorité : choix manuel - navigateur - fr
$lan = isset($lan_cookie) ? $lan_cookie : (isset($lan_browser) ? $lan_browser : 'fr');
// Changer la locale
if ( $lan !== 'fr') {
@ -295,7 +323,7 @@ class common {
$this->url = $url;
}
else {
$this->url = $this->getData(['config', 'homePageId']);
$this->url = $this->getData(['locale', 'homePageId']);
}
}
@ -691,10 +719,11 @@ class common {
* @param $lang langue des pages
* @return string du dossier à créer
*/
public function dirData($id, $lang) {
public function dataPath($id, $lang) {
// Sauf pour les pages et les modules
if ($id === 'page' ||
$id === 'module') {
$id === 'module' ||
$id === 'locale' ) {
$folder = self::DATA_DIR . $lang . '/' ;
} else {
$folder = self::DATA_DIR;
@ -908,9 +937,9 @@ class common {
// Fin SMTP
} else {
$host = str_replace('www.', '', $_SERVER['HTTP_HOST']);
$mail->setFrom('no-reply@' . $host, $this->getData(['config', 'title']));
$mail->setFrom('no-reply@' . $host, $this->getData(['locale', 'title']));
if (is_null($replyTo)) {
$mail->addReplyTo('no-reply@' . $host, $this->getData(['config', 'title']));
$mail->addReplyTo('no-reply@' . $host, $this->getData(['locale', 'title']));
} else {
$mail->addReplyTo($replyTo);
}
@ -945,11 +974,15 @@ class common {
* @param array $keys Clé(s) des données
*/
public function setData($keys = []) {
// Pas d'enregistrement lorsqu'une notice est présente ou tableau transmis vide
if (!empty(self::$inputNotices)
OR empty($keys)
OR in_array(NULL, $keys) ) {
OR empty($keys)) {
return false;
}
// Empêcher la sauvegarde d'une donnée nulle.
if (gettype($keys[count($keys) -1]) === NULL) {
var_dump($keys);
return false;
}
@ -1453,27 +1486,41 @@ class common {
}
// Mettre à jour les données des blogs les articles sont dans posts
foreach ($pageList as $parentKey => $parent) {
//La page a une galerie
//La page a un blog
if ($this->getData(['page',$parent,'moduleId']) === 'blog' ) {
foreach ( $this->getData(['module', $parent]) as $blogKey => $blogItem) {
$data = $this->getdata(['module',$parent,$blogKey]);
$this->deleteData(['module',$parent, $blogKey]);
$this->setData([ 'module', $parent, 'posts', $blogKey, $data ]);
if (is_array($this->getData(['module', $parent]))) {
foreach ( $this->getData(['module', $parent]) as $blogKey => $blogItem) {
if ($blogKey === 'posts' OR $blogKey === 'config') {continue;}
$data = $this->getdata(['module',$parent,$blogKey]);
$this->deleteData(['module',$parent, $blogKey]);
$this->setData([ 'module', $parent, 'posts', $blogKey, $data ]);
}
}
}
}
foreach ($pageList as $parentKey => $parent) {
//La page a une galerie
//La page a une news
if ($this->getData(['page',$parent,'moduleId']) === 'news' ) {
foreach ( $this->getData(['module', $parent]) as $newsKey => $newsItem) {
$data = $this->getdata(['module',$parent,$newsKey]);
$this->deleteData(['module',$parent, $newsKey]);
$this->setData([ 'module', $parent, 'posts', $newsKey, $data ]);
if (is_array($this->getData(['module', $parent]))) {
foreach ( $this->getData(['module', $parent]) as $newsKey => $newsItem) {
if ($blogKey === 'posts' OR $blogKey === 'config') {continue;}
$data = $this->getdata(['module',$parent,$newsKey]);
$this->deleteData(['module',$parent, $newsKey]);
$this->setData([ 'module', $parent, 'posts', $newsKey, $data ]);
}
}
}
}
$this->setData(['core', 'dataVersion', 10306]);
}
// Version 10.3.08
if ($this->getData(['core', 'dataVersion']) < 10308) {
// RAZ la mise à jour auto bug 10.3.07
$this->setData(['core','updateAvailable', false]);
$this->setData(['core', 'dataVersion', 10308]);
}
// Version 10.4.00
if ($this->getData(['core', 'dataVersion']) < 10400) {
// Ajouter le prénom comme pseudo et le pseudo comme signature
@ -1492,7 +1539,7 @@ class common {
}
}
// Parcourir pageList et rechercher les modules de blog
foreach ($pageList as $parentKey => $parent) {
//La page est un blog
if ($this->getData(['page',$parent,'moduleId']) === 'blog' ) {
@ -1531,8 +1578,22 @@ class common {
$this->setData(['user',$key,'group', $this->getData(['user',$key,'group']) + 1 ]);
}
}
// Création du fichier locale.json
$this->setData(['locale','homePageId',$this->getData(['config','homePageId'])]);
$this->setData(['locale','page404',$this->getData(['config','page404'])]);
$this->setData(['locale','page403',$this->getData(['config','page403'])]);
$this->setData(['locale','page302',$this->getData(['config','page302'])]);
$this->setData(['locale','legalPageId',$this->getData(['config','legalPageId'])]);
$this->setData(['locale','searchPageId',$this->getData(['config','searchPageId'])]);
$this->setData(['locale','metaDescription',$this->getData(['config','metaDescription'])]);
$this->setData(['locale','title',$this->getData(['config','title'])]);
$this->setData(['core', 'dataVersion', 10400]);
/**
* mettre à jour defaultdata
*/
}
}
}
@ -1869,13 +1930,24 @@ class core extends common {
$access = true;
}
else {
if($this->getUrl(0) === $this->getData(['config', 'homePageId'])) {
if($this->getUrl(0) === $this->getData(['locale', 'homePageId'])) {
$access = 'login';
}
else {
$access = false;
}
}
// Empêcher l'accès aux page désactivée par URL directe
if ( ( $this->getData(['page', $this->getUrl(0),'disable']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
) OR (
$this->getData(['page', $this->getUrl(0),'disable']) === true
AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND $this->getUser('group') < self::GROUP_MODERATOR
)
){
$access = false;
}
}
/**
* Contrôle si la page demandée est en édition ou accès à la gestion du site
@ -2116,13 +2188,20 @@ class core extends common {
}
}
// Librairie googtrans ajouté dynamiquement
if ( substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) !== 'fr'
AND $this->getData(['translate','active']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')) {
$this->addOutput([
'vendor' => array_merge($this->output['vendor'], ['i18n'])
]);
// Chargement de la librairie googtrans
// Le multi langue est actif
if ($this->getData(['config','translate','scriptGoogle']) === true ) {
// la traduction auto est active
if ( $this->getData(['config','translate','autoDetect']) === true
// Cas des pages d'administration
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
OR ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND $this->getData(['config','translate','admin']) === true )
) {
$this->addOutput([
'vendor' => array_merge($this->output['vendor'], ['i18n'])
]);
}
}
// Erreurs
if($access === 'login') {
@ -2138,10 +2217,10 @@ class core extends common {
'content' => template::speech('La page <strong>' . $accessInfo['pageId'] . '</strong> est ouverte par l\'utilisateur <strong>' . $accessInfo['userName'] . '</strong>')
]);
} else {
if ( $this->getData(['config','page403']) !== 'none'
AND $this->getData(['page',$this->getData(['config','page403'])]))
if ( $this->getData(['locale','page403']) !== 'none'
AND $this->getData(['page',$this->getData(['locale','page403'])]))
{
header('Location:' . helper::baseUrl() . $this->getData(['config','page403']));
header('Location:' . helper::baseUrl() . $this->getData(['locale','page403']));
} else {
$this->addOutput([
'title' => 'Erreur 403',
@ -2151,10 +2230,10 @@ class core extends common {
}
} elseif ($this->output['content'] === '') {
http_response_code(404);
if ( $this->getData(['config','page404']) !== 'none'
AND $this->getData(['page',$this->getData(['config','page404'])]))
if ( $this->getData(['locale','page404']) !== 'none'
AND $this->getData(['page',$this->getData(['locale','page404'])]))
{
header('Location:' . helper::baseUrl() . $this->getData(['config','page404']));
header('Location:' . helper::baseUrl() . $this->getData(['locale','page404']));
} else {
$this->addOutput([
'title' => 'Erreur 404',
@ -2166,18 +2245,18 @@ class core extends common {
if($this->output['metaTitle'] === '') {
if($this->output['title']) {
$this->addOutput([
'metaTitle' => strip_tags($this->output['title']) . ' - ' . $this->getData(['config', 'title'])
'metaTitle' => strip_tags($this->output['title']) . ' - ' . $this->getData(['locale', 'title'])
]);
}
else {
$this->addOutput([
'metaTitle' => $this->getData(['config', 'title'])
'metaTitle' => $this->getData(['locale', 'title'])
]);
}
}
if($this->output['metaDescription'] === '') {
$this->addOutput([
'metaDescription' => $this->getData(['config', 'metaDescription'])
'metaDescription' => $this->getData(['locale', 'metaDescription'])
]);
}
@ -2229,14 +2308,15 @@ class layout extends common {
* Affiche le script Google Analytics
*/
public function showAnalytics() {
if($code = $this->getData(['config', 'analyticsId'])) {
if($code = $this->getData(['config', 'analyticsId'])
AND $this->getInput('ZWII_COOKIE_CONSENT') === 'true') {
echo '<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id='. $code .'"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag("js", new Date());
gtag("config","'. $code .'");
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag("js", new Date());
gtag("config","'. $code .'");
</script>';
}
}
@ -2258,14 +2338,31 @@ class layout extends common {
}
echo $this->core->output['content'];
if ( substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) !== 'fr'
AND $this->getData(['translate','showCredits']) === true
AND $this->getData(['translate','active']) === true )
/**
* Affiche les crédits, conditions requis :
* La traduction est active et le site n'est pas en français.
* La fonction est activée.
*/
if ( (
( $this->getData(['config','translate','scriptGoogle']) === true
AND substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) !== 'fr'
)
OR ( isset($_COOKIES['ZWII_USER_I18N'])
AND array_key_exists($_COOKIES['ZWII_USER_I18N'],$this->i18nList
AND $_COOKIES['ZWII_USER_I18N'] !== 'fr' )
)
)
AND $this->getData(['config','translate','showCredits']) === true
)
{
echo '<div id="googTransLogo"><a href="//policies.google.com/terms#toc-content" data-lity><img src="core/module/translate/ressource/googtrans.png" /></a></div>';
}
}
/**
* Affiche le contenu de la barre gauche
*
@ -2346,15 +2443,15 @@ class layout extends common {
// Affichage du module de recherche
$items .= '<span id="footerDisplaySearch"';
$items .= $this->getData(['theme','footer','displaySearch']) === false ? ' class="displayNone" >' : '>';
if ($this->getData(['config','searchPageId']) !== 'none') {
$items .= '<wbr>&nbsp;|&nbsp;<a href="' . helper::baseUrl() . $this->getData(['config','searchPageId']) . '" data-tippy-content="Rechercher dans le site" >Recherche</a>';
if ($this->getData(['locale','searchPageId']) !== 'none') {
$items .= '<wbr>&nbsp;|&nbsp;<a href="' . helper::baseUrl() . $this->getData(['locale','searchPageId']) . '" data-tippy-content="Rechercher dans le site" >Recherche</a>';
}
$items .= '</span>';
// Affichage des mentions légales
$items .= '<span id="footerDisplayLegal"';
$items .= $this->getData(['theme','footer','displayLegal']) === false ? ' class="displayNone" >' : '>';
if ($this->getData(['config','legalPageId']) !== 'none') {
$items .= '<wbr>&nbsp;|&nbsp;<a href="' . helper::baseUrl() . $this->getData(['config','legalPageId']) . '" data-tippy-content="Mentions Légales">Mentions légales</a>';
if ($this->getData(['locale','legalPageId']) !== 'none') {
$items .= '<wbr>&nbsp;|&nbsp;<a href="' . helper::baseUrl() . $this->getData(['locale','legalPageId']) . '" data-tippy-content="Mentions Légales">Mentions légales</a>';
}
$items .= '</span>';
// Affichage du lien de connexion
@ -2480,12 +2577,17 @@ class layout extends common {
// Mise en page de l'item
$itemsLeft .= '<li>';
if ( $this->getData(['page',$parentPageId,'disable']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') )
{$itemsLeft .= '<a class="' . $parentPageId . '" href="'.$this->getUrl(1).'">';
if ( ( $this->getData(['page',$parentPageId,'disable']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
) OR (
$this->getData(['page',$parentPageId,'disable']) === true
AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND $this->getUser('group') < self::GROUP_MODERATOR
)
){
$itemsLeft .= '<a class="' . $parentPageId . '" href="'. helper::baseUrl() . $this->getUrl(0).'">';
} else {
$itemsLeft .= '<a class="' . $active . $parentPageId . '" href="' . helper::baseUrl() . $parentPageId . '"' . $targetBlank . '>';
$itemsLeft .= '<a class="' . $active . $parentPageId . '" href="' . helper::baseUrl() . $parentPageId . '"' . $targetBlank . '>';
}
switch ($this->getData(['page', $parentPageId, 'typeMenu'])) {
@ -2535,9 +2637,15 @@ class layout extends common {
$targetBlank = $this->getData(['page', $childKey, 'targetBlank']) ? ' target="_blank"' : '';
// Mise en page du sous-item
$itemsLeft .= '<li>';
if ( $this->getData(['page',$childKey,'disable']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) {
$itemsLeft .= '<a class="' . $parentPageId . '" href="'.$this->getUrl(1).'">';
if ( ( $this->getData(['page',$childKey,'disable']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
) OR (
$this->getData(['page',$childKey,'disable']) === true
AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND $this->getUser('group') < self::GROUP_MODERATOR
)
){
$itemsLeft .= '<a class="' . $parentPageId . '" href="'.helper::baseUrl() . $this->getUrl(0).'">';
} else {
$itemsLeft .= '<a class="' . $active . $parentPageId . '" href="' . helper::baseUrl() . $childKey . '"' . $targetBlank . '>';
}
@ -2856,7 +2964,7 @@ class layout extends common {
if($this->getUser('group') >= self::GROUP_ADMIN) {
$rightItems .= '<li><a href="' . helper::baseUrl() . 'user" data-tippy-content="Configurer les utilisateurs">' . template::ico('users') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'theme" data-tippy-content="Personnaliser les thèmes">' . template::ico('brush') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'translate" data-tippy-content="Gestion des langues">' . template::ico('flag') . '</a></li>';
//$rightItems .= '<li><a href="' . helper::baseUrl() . 'translate" data-tippy-content="Gestion des langues">' . template::ico('flag') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'config" data-tippy-content="Configurer le site">' . template::ico('cog-alt') . '</a></li>';
// Mise à jour automatique
$today = mktime(0, 0, 0);
@ -2952,4 +3060,20 @@ class layout extends common {
}
}
}
/**
* Affiche le cadre avec les drapeaux
*/
public function showi18n() {
if ( $this->getData(['config','translate','scriptGoogle']) === true ) {
echo '<div id="i18nContainer"><ul>';
foreach (self::$i18nList as $key => $value) {
if ($this->getData(['config','translate','script' . strtoupper($key)]) ) {
echo '<li>';
echo '<a href="' . helper::baseUrl() . 'translate/language/' . $key . '/' . $this->getUrl(0) . '"><img class= "flag" src="' . helper::baseUrl(false) . 'core/vendor/i18n/png/' . $key . '.png" /></a>';
echo '</li>';
}
}
echo '</ul></div>';
}
}
}

View File

@ -695,6 +695,7 @@ nav::before {
pointer-events: none;
}
/* Menu vertical */
.menuSide,
@ -709,6 +710,40 @@ li .menuSideChild {
padding-left: 10px;
}
/* Container des drapeaux */
#i18nContainer {
z-index: 100;
position: relative ;
float: right;
width: auto;
height: auto;
margin-top: -25px;
}
#i18nContainer ul {
list-style: none;
}
#i18nContainer li {
display: inline-block;
position: relative;
}
#i18nContainer img {
width: 80%;
}
#i18nContainer img {
margin: 2px;
}
/* Corps */
@media (min-width:768px) {
@ -949,20 +984,22 @@ footer #footerSocials .zwiico-github:hover {
/* Message sur les cookies */
#cookieConsent {
width: 80%;
margin: auto;
opacity: .9;
background: #212223;
position: fixed;
right: 0;
bottom: 0;
bottom: 5%;
left: 0;
color: #FFF;
padding: 10px;
z-index: 60;
text-align: center;
font-size: .9em;
font-size: 1em;
}
#cookieConsentConfirm {
#cookieConsentConfirm, #cookieConsentRefuse {
cursor: pointer;
margin-left: 10px;
background: #666;
@ -971,10 +1008,12 @@ footer #footerSocials .zwiico-github:hover {
transition: background .3s ease-out;
}
#cookieConsentConfirm:hover {
#cookieConsentConfirm:hover, #cookieConsentRefuse:hover {
background: #777;
}
/* Bloc */
.block {
/* border: 1px solid #D8DFE3;*/
@ -1665,7 +1704,7 @@ th.col12 {
}
.goog-text-highlight {
background-color: transparent !important;
border: none !important;
border: none !important;
box-shadow: none !important;
} */

View File

@ -83,7 +83,7 @@
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="border-bottom: 1px solid #EBEEF2; padding: 20px; font-family: 'Open Sans', sans-serif; font-size: 19px; line-height: 24px; text-align: center; color: #212223;">
<?php echo $this->getData(['config', 'title']); ?>
<?php echo $this->getData(['locale', 'title']); ?>
</td>
</tr>
</table>
@ -109,7 +109,7 @@
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="border-top: 1px solid #EBEEF2; padding: 20px; text-align: center; font-family: 'Open Sans', sans-serif; font-size: 12px; line-height: 17px; color: #212223;">
<a href="<?php echo helper::baseUrl(false); ?>" target="_blank"><?php echo $this->getData(['config', 'title']); ?></a>
<a href="<?php echo helper::baseUrl(false); ?>" target="_blank"><?php echo $this->getData(['locale', 'title']); ?></a>
</td>
</tr>
</table>

View File

@ -15,6 +15,12 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css?<?php echo md5_file(self::DATA_DIR.'theme.css'); ?>">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css?<?php echo md5_file(self::DATA_DIR.'custom.css'); ?>">
<!-- Détection RSS -->
<?php if ( ( $this->getData(['page', $this->getUrl(0), 'moduleId']) === 'blog'
OR $this->getData(['page', $this->getUrl(0), 'moduleId']) === 'news' )
AND $this->getData(['module', $this->getUrl(0), 'config', 'feeds']) === TRUE ): ?>
<link rel="alternate" type="application/rss+xml" href="'<?php echo helper::baseUrl(). $this->getUrl(0) . '/rss';?>" title="fLUX rss">
<?php endif; ?>
<?php $layout->showStyle(); ?>
<?php if (file_exists(self::DATA_DIR .'head.inc.html')) {
include(self::DATA_DIR .'head.inc.html');
@ -41,7 +47,7 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
<!-- Menu Burger -->
<div id="toggle">
<?php if ($this->getData(['theme','menu','burgerTitle']) === true ): ?>
<div id="burgerText"><?php echo $this->getData(['config','title']);?></div>
<div id="burgerText"><?php echo $this->getData(['locale','title']);?></div>
<?php endif; ?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class="
@ -54,6 +60,7 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
<?php if($this->getData(['theme', 'header', 'position']) === 'body'): ?>
<!-- Bannière dans le fond du site -->
<header>
<?php $layout->showi18n();?>
<?php
if ($this->getData(['theme','header','linkHomePage'])){
echo "<a href='" . helper::baseUrl(false) . "'>" ;} ?>
@ -63,7 +70,7 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
// Affiche toujours le titre de la bannière pour l'édition du thème
OR ($this->getUrl(0) === 'theme' AND $this->getUrl(1) === 'header')
): ?>
<span id="themeHeaderTitle"><?php echo $this->getData(['config', 'title']); ?></span>
<span id="themeHeaderTitle"><?php echo $this->getData(['locale', 'title']); ?></span>
<?php else: ?>
<span id="themeHeaderTitle">&nbsp;</span>
<?php endif; ?>
@ -79,7 +86,7 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
<nav>
<div id="toggle">
<?php if ($this->getData(['theme','menu','burgerTitle']) === true ): ?>
<div id="burgerText"><?php echo $this->getData(['config','title']);?></div>
<div id="burgerText"><?php echo $this->getData(['locale','title']);?></div>
<?php endif; ?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class="container"><?php $layout->showMenu(); ?></div>
@ -92,7 +99,7 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
<nav>
<div id="toggle">
<?php if ($this->getData(['theme','menu','burgerTitle']) === true ): ?>
<div id="burgerText"><?php echo $this->getData(['config','title']);?></div>
<div id="burgerText"><?php echo $this->getData(['locale','title']);?></div>
<?php endif; ?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class="container"><?php $layout->showMenu(); ?></div>
@ -117,7 +124,7 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
// Affiche toujours le titre de la bannière pour l'édition du thème
OR ($this->getUrl(0) === 'theme' AND $this->getUrl(1) === 'header')
): ?>
<span id="themeHeaderTitle"><?php echo $this->getData(['config', 'title']); ?></span>
<span id="themeHeaderTitle"><?php echo $this->getData(['locale', 'title']); ?></span>
<?php else: ?>
<span id="themeHeaderTitle">&nbsp;</span>
<?php endif; ?>
@ -139,7 +146,7 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
<nav <?php if($this->getData(['theme', 'menu', 'position']) === 'hide'): ?>class="displayNone"<?php endif; ?>>
<div id="toggle">
<?php if ($this->getData(['theme','menu','burgerTitle']) === true ): ?>
<div id="burgerText"><?php echo $this->getData(['config','title']);?></div>
<div id="burgerText"><?php echo $this->getData(['locale','title']);?></div>
<?php endif; ?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class="container"><?php $layout->showMenu(); ?></div>
@ -147,6 +154,7 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
<?php endif; ?>
<!-- Corps de page -->
<section>
<?php $layout->showi18n();?>
<?php
// Gabarit :
// Récupérer la config de la page courante
@ -187,7 +195,8 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
if ($blockleft !== "") :?>
<div class="<?php echo $blockleft; ?>" id="contentLeft"><aside><?php $layout->showBarContentLeft(); ?></aside></div>
<?php endif; ?>
<div class="<?php echo $content; ?>" id="contentSite"><?php $layout->showContent();
<div class="<?php echo $content; ?>" id="contentSite">
<?php $layout->showContent();
if (file_exists(self::DATA_DIR . 'body.inc.html')) {
include(self::DATA_DIR . 'body.inc.html');
}

View File

@ -22,6 +22,7 @@ class config extends common {
'generateFiles' => self::GROUP_ADMIN,
'updateRobots' => self::GROUP_ADMIN,
'index' => self::GROUP_ADMIN,
'advanced' => self::GROUP_ADMIN,
'manage' => self::GROUP_ADMIN,
'updateBaseUrl' => self::GROUP_ADMIN,
'script' => self::GROUP_ADMIN,
@ -203,7 +204,7 @@ class config extends common {
// Valeurs en sortie
$this->addOutput([
'notification' => ($successSitemap === true && $successRobots >= 100) ? 'Création réussie' : 'Echec d\'écriture',
'redirect' => helper::baseUrl() . 'config',
'redirect' => helper::baseUrl() . 'config/advanced',
'state' => ($successSitemap === true && $successRobots >=100) ? true : false
]);
}
@ -294,7 +295,7 @@ class config extends common {
// Valeurs en sortie
$this->addOutput([
'notification' => $success === false ? 'Service inaccessible ou erreur d\'écriture de l\'image' : 'Image générée avec succès',
'redirect' => helper::baseUrl() . 'config',
'redirect' => helper::baseUrl() . 'advanced',
'state' => $success === false ? false : true
]);
}
@ -409,17 +410,11 @@ class config extends common {
// Soumission du formulaire
if($this->isPost()) {
$success = true;
// Basculement en mise à jour auto
// Remise à 0 du compteur
if ($this->getData(['config','autoUpdate']) === false &&
$this->getInput('configAutoUpdate', helper::FILTER_BOOLEAN) === true) {
$this->setData(['core','lastAutoUpdate',0]);
}
// Empêcher la modification si défini dans footer
if ( $this->getData(['theme','footer','displaySearch']) === true
AND $this->getInput('configSearchPageId') === 'none'
){
$searchPageId = $this->getData(['config','searchPageId']);
$searchPageId = $this->getData(['locale','searchPageId']);
self::$inputNotices['configSearchPageId'] = 'Désactiver l\'option dans le pied de page';
$success = false;
} else {
@ -429,7 +424,7 @@ class config extends common {
if ( $this->getData(['theme','footer','displayLegal']) === true
AND $this->getInput('configLegalPageId') === 'none'
){
$legalPageId = $this->getData(['config','legalPageId']);
$legalPageId = $this->getData(['locale','legalPageId']);
self::$inputNotices['configLegalPageId'] = 'Désactiver l\'option dans le pied de page';
$success = false;
} else {
@ -437,55 +432,96 @@ class config extends common {
}
// Sauvegarder
$this->setData([
'config',
'locale',
[
'homePageId' => $this->getInput('configHomePageId', helper::FILTER_ID, true),
'page404' => $this->getInput('configPage404'),
'page403' => $this->getInput('configPage403'),
'page302' => $this->getInput('configPage302'),
'analyticsId' => $this->getInput('configAnalyticsId'),
'autoBackup' => $this->getInput('configAutoBackup', helper::FILTER_BOOLEAN),
'maintenance' => $this->getInput('configMaintenance', helper::FILTER_BOOLEAN),
'cookieConsent' => $this->getInput('configCookieConsent', helper::FILTER_BOOLEAN),
'favicon' => $this->getInput('configFavicon'),
'faviconDark' => $this->getInput('configFaviconDark'),
'social' => [
'facebookId' => $this->getInput('configSocialFacebookId'),
'linkedinId' => $this->getInput('configSocialLinkedinId'),
'instagramId' => $this->getInput('configSocialInstagramId'),
'pinterestId' => $this->getInput('configSocialPinterestId'),
'twitterId' => $this->getInput('configSocialTwitterId'),
'youtubeId' => $this->getInput('configSocialYoutubeId'),
'youtubeUserId' => $this->getInput('configSocialYoutubeUserId'),
'githubId' => $this->getInput('configSocialGithubId')
],
'timezone' => $this->getInput('configTimezone', helper::FILTER_STRING_SHORT, true),
'itemsperPage' => $this->getInput('configItemsperPage', helper::FILTER_INT,true),
'legalPageId' => $legalPageId,
'searchPageId' => $searchPageId,
'metaDescription' => $this->getInput('configMetaDescription', helper::FILTER_STRING_LONG, true),
'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true),
'autoUpdate' => $this->getInput('configAutoUpdate', helper::FILTER_BOOLEAN),
'autoUpdateHtaccess' => $this->getInput('configAutoUpdateHtaccess', helper::FILTER_BOOLEAN),
'proxyType' => $this->getInput('configProxyType'),
'proxyUrl' => $this->getInput('configProxyUrl'),
'proxyPort' => $this->getInput('configProxyPort',helper::FILTER_INT),
'captchaStrong' => $this->getInput('configCaptchaStrong',helper::FILTER_BOOLEAN),
'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true)
]
]);
// Générer robots.txt et sitemap
$this->generateFiles();
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
'notification' => 'Modifications enregistrées',
'state' => $success
]);
}
// Initialisation du screen - APPEL AUTO DESACTIVE POUR EVITER UN RALENTISSEMENT
/*
if (!file_exists(self::FILE_DIR.'source/screenshot.jpg')) {
$this->configMetaImage();
}
*/
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'view' => 'index'
]);
}
/**
* Configuration avancée
*/
public function advanced() {
// Soumission du formulaire
if($this->isPost()) {
$success = true;
// Basculement en mise à jour auto
// Remise à 0 du compteur
if ($this->getData(['config','autoUpdate']) === false &&
$this->getInput('configAdvancedAutoUpdate', helper::FILTER_BOOLEAN) === true) {
$this->setData(['core','lastAutoUpdate',0]);
}
// Sauvegarder
$this->setData([
'config',
[
'analyticsId' => $this->getInput('configAdvancedAnalyticsId'),
'autoBackup' => $this->getInput('configAdvancedAutoBackup', helper::FILTER_BOOLEAN),
'maintenance' => $this->getInput('configAdvancedMaintenance', helper::FILTER_BOOLEAN),
'cookieConsent' => $this->getInput('configAdvancedCookieConsent', helper::FILTER_BOOLEAN),
'favicon' => $this->getInput('configAdvancedFavicon'),
'faviconDark' => $this->getInput('configAdvancedFaviconDark'),
'social' => [
'facebookId' => $this->getInput('configAdvancedSocialFacebookId'),
'linkedinId' => $this->getInput('configAdvancedSocialLinkedinId'),
'instagramId' => $this->getInput('configAdvancedSocialInstagramId'),
'pinterestId' => $this->getInput('configAdvancedSocialPinterestId'),
'twitterId' => $this->getInput('configAdvancedSocialTwitterId'),
'youtubeId' => $this->getInput('configAdvancedSocialYoutubeId'),
'youtubeUserId' => $this->getInput('configAdvancedSocialYoutubeUserId'),
'githubId' => $this->getInput('configAdvancedSocialGithubId')
],
'timezone' => $this->getInput('configAdvancedTimezone', helper::FILTER_STRING_SHORT, true),
'itemsperPage' => $this->getInput('configAdvancedItemsperPage', helper::FILTER_INT,true),
'autoUpdate' => $this->getInput('configAdvancedAutoUpdate', helper::FILTER_BOOLEAN),
'autoUpdateHtaccess' => $this->getInput('configAdvancedAutoUpdateHtaccess', helper::FILTER_BOOLEAN),
'proxyType' => $this->getInput('configAdvancedProxyType'),
'proxyUrl' => $this->getInput('configAdvancedProxyUrl'),
'proxyPort' => $this->getInput('configAdvancedProxyPort',helper::FILTER_INT),
'captchaStrong' => $this->getInput('configAdvancedCaptchaStrong',helper::FILTER_BOOLEAN),
'smtp' => [
'enable' => $this->getInput('configSmtpEnable',helper::FILTER_BOOLEAN),
'host' => $this->getInput('configSmtpHost',helper::FILTER_STRING_SHORT),
'port' => $this->getInput('configSmtpPort',helper::FILTER_INT),
'auth' => $this->getInput('configSmtpAuth',helper::FILTER_BOOLEAN),
'secure' => $this->getInput('configSmtpSecure'),
'username' => $this->getInput('configSmtpUsername',helper::FILTER_STRING_SHORT),
'password' =>helper::encrypt($this->getData(['config','smtp','username']),$this->getInput('configSmtpPassword')),
'sender' => $this->getInput('configSmtpSender',helper::FILTER_MAIL)
'enable' => $this->getInput('configAdvancedSmtpEnable',helper::FILTER_BOOLEAN),
'host' => $this->getInput('configAdvancedSmtpHost',helper::FILTER_STRING_SHORT),
'port' => $this->getInput('configAdvancedSmtpPort',helper::FILTER_INT),
'auth' => $this->getInput('configAdvancedSmtpAuth',helper::FILTER_BOOLEAN),
'secure' => $this->getInput('configAdvancedSmtpSecure'),
'username' => $this->getInput('configAdvancedSmtpUsername',helper::FILTER_STRING_SHORT),
'password' =>helper::encrypt($this->getData(['config','smtp','username']),$this->getInput('configAdvancedSmtpPassword')),
'sender' => $this->getInput('configAdvancedSmtpSender',helper::FILTER_MAIL)
],
'connect' => [
'attempt' => $this->getInput('configConnectAttempt',helper::FILTER_INT),
'timeout' => $this->getInput('configConnectTimeout',helper::FILTER_INT),
'log' => $this->getInput('configConnectLog',helper::FILTER_BOOLEAN),
'captcha' => $this->getInput('configConnectCaptcha',helper::FILTER_BOOLEAN),
'attempt' => $this->getInput('configAdvancedConnectAttempt',helper::FILTER_INT),
'timeout' => $this->getInput('configAdvancedConnectTimeout',helper::FILTER_INT),
'log' => $this->getInput('configAdvancedConnectLog',helper::FILTER_BOOLEAN),
'captcha' => $this->getInput('configAdvancedConnectCaptcha',helper::FILTER_BOOLEAN),
]
]
]);
@ -544,8 +580,8 @@ class config extends common {
*/
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'view' => 'index'
'title' => 'Configuration avancée',
'view' => 'advanced'
]);
}
@ -638,14 +674,14 @@ class config extends common {
file_put_contents(self::DATA_DIR . 'journal.log',$d);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
'redirect' => helper::baseUrl() . 'config/advanced',
'notification' => 'Journal réinitialisé avec succès',
'state' => true
]);
} else {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
'redirect' => helper::baseUrl() . 'config/advanced',
'notification' => 'Aucun journal à effacer',
'state' => false
]);
@ -677,7 +713,7 @@ class config extends common {
} else {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
'redirect' => helper::baseUrl() . 'config/advanced',
'notification' => 'Aucun fichier journal à télécharger',
'state' => false
]);
@ -718,7 +754,7 @@ class config extends common {
} else {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
'redirect' => helper::baseUrl() . 'config/advanced',
'notification' => 'Aucune liste noire à télécharger',
'state' => false
]);
@ -731,17 +767,17 @@ class config extends common {
public function blacklistReset() {
if ( file_exists(self::DATA_DIR . 'blacklist.json') ) {
unlink(self::DATA_DIR . 'blacklist.json');
$this->setData(['blacklist',[]]);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
'redirect' => helper::baseUrl() . 'config/advanced',
'notification' => 'Liste noire réinitialisée avec succès',
'state' => true
]);
} else {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
'redirect' => helper::baseUrl() . 'config/advanced',
'notification' => 'Pas de liste à effacer',
'state' => false
]);

View File

@ -0,0 +1,37 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/** NE PAS EFFACER
* admin.css
*/
.blockContainer {
display : none;
}
#info .zwiico-plus-circled {
display: inline;
}
.zwiico-minus-circled,
#info .zwiico-minus-circled {
display: none;
}
.zwiico-minus-circled,
.zwiico-plus-circled {
cursor: pointer;
}

View File

@ -61,7 +61,7 @@ $( document).ready(function() {
* Sauvegarder la position des blocs
* true = bloc déplié
*/
document.cookie = $(this).attr('id') + "=" + $(this).find(".zwiico-minus").is(":visible") + ";expires=Fri, 31 Dec 9999 23:59:59 GMT;path=/;SameSite=Lax";
document.cookie = $(this).attr('id') + "=" + $(this).find(".zwiico-minus-circled").is(":visible") + ";expires=Fri, 31 Dec 9999 23:59:59 GMT;path=/;SameSite=Lax";
}).on("click", "span > input, input, textarea, label, option, button, a:not(.inputFile), .blockContainer", function(e) {
// Empêcher les déclenchements dans les blocs
e.stopPropagation();

View File

@ -0,0 +1,501 @@
<?php echo template::formOpen('configAdvancedForm'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('configAdvancedBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'config',
'ico' => 'left',
'value' => 'Retour'
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('configAdvancedSubmit'); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Maintenance</h4>
<div class="col3">
<?php echo template::checkbox('configAdvancedMaintenance', true, 'Site en maintenance', [
'checked' => $this->getData(['config', 'maintenance'])
]); ?>
</div>
<div class="col3 offset1">
<?php echo template::button('configManageButton', [
'href' => helper::baseUrl() . 'config/backup',
'value' => 'Sauvegarder',
'ico' => 'download'
]); ?>
</div>
<div class="col3 offset1">
<?php echo template::button('configManageButton', [
'href' => helper::baseUrl() . 'config/manage',
'value' => 'Restaurer',
'ico' => 'upload'
]); ?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Réglages</h4>
<?php $error = helper::urlGetContents('http://zwiicms.fr/update/' . common::ZWII_UPDATE_CHANNEL . '/version');?>
<div class="row">
<div class="col4">
<?php echo template::file('configAdvancedFavicon', [
'type' => 1,
'help' => 'Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.',
'label' => 'Favicon',
'value' => $this->getData(['config', 'favicon'])
]); ?>
</div>
<div class="col4">
<?php echo template::file('configAdvancedFaviconDark', [
'type' => 1,
'help' => 'Sélectionnez une icône adaptée à un thème sombre.<br>Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.',
'label' => 'Favicon thème sombre',
'value' => $this->getData(['config', 'faviconDark'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('configAdvancedItemsperPage', $module::$ItemsList, [
'label' => 'Articles par page',
'selected' => $this->getData(['config', 'itemsperPage']),
'help' => 'Modules Blog et News'
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('configAdvancedTimezone', $module::$timezones, [
'label' => 'Fuseau horaire',
'selected' => $this->getData(['config', 'timezone']),
'help' => 'Le fuseau horaire est utile au bon référencement'
]); ?>
</div>
<div class="col4 verticalAlignBottom">
<?php echo template::checkbox('configAdvancedCookieConsent', true, 'Consentement aux cookies', [
'checked' => $this->getData(['config', 'cookieConsent'])
]); ?>
</div>
<div class="col4 verticalAlignBottom">
<?php echo template::checkbox('configAdvancedCaptchaStrong', true, 'Captcha renforcé', [
'checked' => $this->getData(['config','captchaStrong']),
'help' => 'Option recommandée pour sécuriser la connexion. S\'applique à tous les captchas du site. Le captcha simple se limite à une addition de nombres de 0 à 10. Le captcha renforcé utilise quatre opérations de nombres de 0 à 20.'
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::checkbox('rewrite', true, 'Réécriture d\'URL', [
'checked' => helper::checkRewrite(),
'help' => 'Vérifiez d\'abord que votre serveur l\'autorise : ce n\'est pas le cas chez Free.'
]); ?>
</div>
<div class="col4">
<?php echo template::checkbox('configAdvancedAutoBackup', true, 'Sauvegarde quotidienne', [
'checked' => $this->getData(['config', 'autoBackup']),
'help' => '<p>Une archive contenant le dossier /site/data est copiée dans le dossier \'site/backup\'. La sauvegarde est conservée pendant 30 jours.</p><p>Les fichiers du site ne sont pas sauvegardés automatiquement.</p>'
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::checkbox('configAdvancedAutoUpdate', true, 'Mise à jour en ligne', [
'checked' => $this->getData(['config', 'autoUpdate']),
'help' => 'Vérifie une fois par jour l\'existence d\'une mise à jour.',
'disabled' => !$error
]); ?>
</div>
<div class="col4 ">
<?php echo template::checkbox('configAdvancedAutoUpdateHtaccess', true, 'Préserver htaccess', [
'checked' => $this->getData(['config', 'autoUpdateHtaccess']),
'help' => 'Lors d\'une mise à jour automatique, conserve le fichier htaccess de la racine du site.',
'disabled' => !$error
]); ?>
</div>
<div class="col4 ">
<?php echo template::button('configAdvancedUpdateForced', [
'ico' => 'download-cloud',
'href' => helper::baseUrl() . 'install/update',
'value' => 'Mise à jour manuelle',
'class' => 'buttonRed',
'disabled' => !$error
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="social">
<h4>Réseaux sociaux
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col3">
<?php echo template::text('configAdvancedSocialFacebookId', [
'help' => 'Saisissez votre ID : https://www.facebook.com/[ID].',
'label' => 'Facebook',
'value' => $this->getData(['config', 'social', 'facebookId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('configAdvancedSocialInstagramId', [
'help' => 'Saisissez votre ID : https://www.instagram.com/[ID].',
'label' => 'Instagram',
'value' => $this->getData(['config', 'social', 'instagramId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('configAdvancedSocialYoutubeId', [
'help' => 'ID de la chaîne : https://www.youtube.com/channel/[ID].',
'label' => 'Chaîne Youtube',
'value' => $this->getData(['config', 'social', 'youtubeId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('configAdvancedSocialYoutubeUserId', [
'help' => 'Saisissez votre ID Utilisateur : https://www.youtube.com/user/[ID].',
'label' => 'Youtube',
'value' => $this->getData(['config', 'social', 'youtubeUserId'])
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::text('configAdvancedSocialTwitterId', [
'help' => 'Saisissez votre ID : https://twitter.com/[ID].',
'label' => 'Twitter',
'value' => $this->getData(['config', 'social', 'twitterId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('configAdvancedSocialPinterestId', [
'help' => 'Saisissez votre ID : https://pinterest.com/[ID].',
'label' => 'Pinterest',
'value' => $this->getData(['config', 'social', 'pinterestId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('configAdvancedSocialLinkedinId', [
'help' => 'Saisissez votre ID Linkedin : https://fr.linkedin.com/in/[ID].',
'label' => 'Linkedin',
'value' => $this->getData(['config', 'social', 'linkedinId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('configAdvancedSocialGithubId', [
'help' => 'Saisissez votre ID Github : https://github.com/[ID].',
'label' => 'Github',
'value' => $this->getData(['config', 'social', 'githubId'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="ceo">
<h4>Référencement
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col4 offset1">
<div class="row">
<div class="col12">
<?php echo template::button('configAdvancedMetaImage', [
'href' => helper::baseUrl() . 'config/configMetaImage',
'value' => 'Capture Open Graph',
'ico' => 'pencil'
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::button('configAdvancedSiteMap', [
'href' => helper::baseUrl() . 'config/generateFiles',
'value' => 'Sitemap.xml / Robots.txt',
'ico' => 'pencil'
]); ?>
</div>
</div>
</div>
<div class="col6 offset1">
<?php if (file_exists(self::FILE_DIR.'source/screenshot.jpg')): ?>
<div class="row">
<div class="col8 offset2 textAlignCenter">
<img src="<?php echo helper::baseUrl(false) . self::FILE_DIR.'source/screenshot.jpg';?>" data-tippy-content="Cette capture d'écran est nécessaire aux partages sur les réseaux sociaux. Elle est régénérée lorsque le fichier 'screenshot.jpg' est effacé du gestionnaire de fichiers." />
</div>
</div>
<?php endif;?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="login">
<h4>Sécurité de la connexion
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col3">
<?php echo template::select('configAdvancedConnectAttempt', $module::$connectAttempt , [
'label' => 'Connexions successives',
'selected' => $this->getData(['config', 'connect', 'attempt'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('configAdvancedConnectTimeout', $module::$connectTimeout , [
'label' => 'Blocage après échecs',
'selected' => $this->getData(['config', 'connect', 'timeout'])
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<label id="helpBlacklist">Comptes inexistants
<?php echo template::help(
'La liste noire énumère les tentatives de connexion à partir de comptes inexistants. Sont stockés : la date, l\'heure, le nom du compte et l\'IP.
Après le nombre de tentatives autorisées, l\'IP et le compte sont bloqués.');
?>
</label>
<?php echo template::button('configAdvancedConnectblacListDownload', [
'href' => helper::baseUrl() . 'config/blacklistDownload',
'value' => 'Télécharger liste noire',
'ico' => 'download'
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<?php echo template::button('configAdvancedConnectReset', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'config/blacklistReset',
'value' => 'Réinitialiser liste',
'ico' => 'cancel'
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::checkbox('configAdvancedConnectCaptcha', true, 'Captcha à la connexion', [
'checked' => $this->getData(['config', 'connect','captcha'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="logs">
<h4>Journalisation
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col4 verticalAlignBottom">
<?php echo template::checkbox('configAdvancedConnectLog', true, 'Activer la journalisation', [
'checked' => $this->getData(['config', 'connect', 'log'])
]); ?>
</div>
<div class="col3 offset2">
<?php echo template::button('configAdvancedLogDownload', [
'href' => helper::baseUrl() . 'config/logDownload',
'value' => 'Télécharger journal',
'ico' => 'download'
]); ?>
</div>
<div class="col3">
<?php echo template::button('configAdvancedLogReset', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'config/logReset',
'value' => 'Réinitialiser journal',
'ico' => 'cancel'
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="network">
<h4>Réseau
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col2">
<?php echo template::select('configAdvancedProxyType', $module::$proxyType, [
'label' => 'Type de proxy',
'selected' => $this->getData(['config', 'proxyType'])
]); ?>
</div>
<div class="col8">
<?php echo template::text('configAdvancedProxyUrl', [
'label' => 'Adresse du proxy',
'placeholder' => 'cache.proxy.fr',
'value' => $this->getData(['config', 'proxyUrl'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('configAdvancedProxyPort', [
'label' => 'Port du proxy',
'placeholder' => '6060',
'value' => $this->getData(['config', 'proxyPort'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="smtp">
<h4>Messagerie SMTP
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col12">
<?php echo template::checkbox('configAdvancedSmtpEnable', true, 'Activer SMTP', [
'checked' => $this->getData(['config', 'smtp','enable']),
'help' => 'Paramètres à utiliser lorsque votre hébergeur ne propose pas la fonctionnalité d\'envoi de mail.'
]); ?>
</div>
</div>
<div id="configSmtpParam">
<div class="row">
<div class="col8">
<?php echo template::text('configAdvancedSmtpHost', [
'label' => 'Adresse SMTP',
'placeholder' => 'smtp.fr',
'value' => $this->getData(['config', 'smtp','host'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('configAdvancedSmtpPort', [
'label' => 'Port SMTP',
'placeholder' => '589',
'value' => $this->getData(['config', 'smtp','port'])
]); ?>
</div>
<div class="col2">
<?php echo template::select('configAdvancedSmtpAuth', $module::$SMTPauth, [
'label' => 'Authentification',
'selected' => $this->getData(['config', 'smtp','auth'])
]); ?>
</div>
</div>
<div id="configSmtpAuthParam">
<div class="row">
<div class="col5">
<?php echo template::text('configAdvancedSmtpUsername', [
'label' => 'Nom utilisateur',
'value' => $this->getData(['config', 'smtp','username' ])
]); ?>
</div>
<div class="col5">
<?php echo template::password('configAdvancedSmtpPassword', [
'label' => 'Mot de passe',
'autocomplete' => 'off',
'value' => $this->getData(['config', 'smtp','username' ]) ? helper::decrypt ($this->getData(['config', 'smtp','username' ]),$this->getData(['config','smtp','password'])) : ''
]); ?>
</div>
<div class="col2">
<?php echo template::select('configAdvancedSmtpSecure', $module::$SMTPEnc , [
'label' => 'Sécurité',
'selected' => $this->getData(['config', 'smtp','secure'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="script">
<h4>Scripts
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col3">
<?php echo template::text('configAdvancedAnalyticsId', [
'help' => 'Saisissez l\'ID de suivi.',
'label' => 'Google Analytics',
'placeholder' => 'UA-XXXXXXXX-X',
'value' => $this->getData(['config', 'analyticsId'])
]); ?>
</div>
<div class="col3 offset3 verticalAlignBottom">
<?php echo template::button('configAdvancedScriptHead', [
'href' => helper::baseUrl() . 'config/script/head',
'value' => 'Script dans head',
'ico' => 'pencil'
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<?php echo template::button('configAdvancedScriptBody', [
'href' => helper::baseUrl() . 'config/script/body',
'value' => 'Script dans body',
'ico' => 'pencil'
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>

View File

@ -12,16 +12,11 @@
* @link http://zwiicms.fr/
*/
/** /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/ */
/** NE PAS EFFACER
* admin.css
*/
/**
* Effet d'animation
*/
@ -62,4 +57,4 @@
modal element will be visible */
body.loading .modal .alertMessage {
display: block;
}
}

View File

@ -3,7 +3,7 @@
<div class="col2">
<?php echo template::button('configBackupBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'config',
'href' => helper::baseUrl() . 'config/advanced',
'ico' => 'left',
'value' => 'Retour'
]); ?>

View File

@ -12,27 +12,7 @@
* @link http://zwiicms.fr/
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/
.blockContainer {
display : none;
}
#info .zwiico-plus-circled {
display: inline;
}
.zwiico-minus-circled,
#info .zwiico-minus-circled {
display: none;
}
.zwiico-minus-circled,
.zwiico-plus-circled {
cursor: pointer;
}
*/

View File

@ -8,16 +8,11 @@
'value' => 'Accueil'
]); ?>
</div>
<div class="col2 offset4">
<?php echo template::button('configManageButton', [
'href' => helper::baseUrl() . 'config/backup',
'value' => 'Sauvegarder'
]); ?>
</div>
<div class="col2">
<?php echo template::button('configManageButton', [
'href' => helper::baseUrl() . 'config/manage',
'value' => 'Restaurer'
<div class="col2 offset6">
<?php echo template::button('configAdvancedButton', [
'href' => helper::baseUrl() . 'config/advanced',
'value' => 'Avancée',
'ico' => 'cog-alt',
]); ?>
</div>
<div class="col2">
@ -27,12 +22,12 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Informations générales</h4>
<h4>Identité</h4>
<div class="row">
<div class="col9">
<?php echo template::text('configTitle', [
'label' => 'Titre du site',
'value' => $this->getData(['config', 'title']),
'value' => $this->getData(['locale', 'title']),
'help' => 'Il apparaît dans la barre de titre et les partages sur les réseaux sociaux.'
]); ?>
</div>
@ -48,7 +43,7 @@
<div class="col12">
<?php echo template::textarea('configMetaDescription', [
'label' => 'Description du site',
'value' => $this->getData(['config', 'metaDescription']),
'value' => $this->getData(['locale', 'metaDescription']),
'help' => 'La description d\'une page participe à son référencement, chaque page doit disposer d\'une description différente.'
]); ?>
</div>
@ -56,103 +51,6 @@
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres généraux</h4>
<?php $error = helper::urlGetContents('http://zwiicms.fr/update/' . common::ZWII_UPDATE_CHANNEL . '/version');?>
<div class="row">
<div class="col4">
<?php echo template::file('configFavicon', [
'type' => 1,
'help' => 'Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.',
'label' => 'Favicon',
'value' => $this->getData(['config', 'favicon'])
]); ?>
</div>
<div class="col4">
<?php echo template::file('configFaviconDark', [
'type' => 1,
'help' => 'Sélectionnez une icône adaptée à un thème sombre.<br>Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.',
'label' => 'Favicon thème sombre',
'value' => $this->getData(['config', 'faviconDark'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('configItemsperPage', $module::$ItemsList, [
'label' => 'Articles par page',
'selected' => $this->getData(['config', 'itemsperPage']),
'help' => 'Modules Blog et News'
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('configTimezone', $module::$timezones, [
'label' => 'Fuseau horaire',
'selected' => $this->getData(['config', 'timezone']),
'help' => 'Le fuseau horaire est utile au bon référencement'
]); ?>
</div>
<div class="col4 verticalAlignBottom">
<?php echo template::checkbox('configCookieConsent', true, 'Consentement aux cookies', [
'checked' => $this->getData(['config', 'cookieConsent'])
]); ?>
</div>
<div class="col4 verticalAlignBottom">
<?php echo template::checkbox('configCaptchaStrong', true, 'Captcha renforcé', [
'checked' => $this->getData(['config','captchaStrong']),
'help' => 'Option recommandée pour sécuriser la connexion. S\'applique à tous les captchas du site. Le captcha simple se limite à une addition de nombres de 0 à 10. Le captcha renforcé utilise quatre opérations de nombres de 0 à 20.'
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::checkbox('rewrite', true, 'Réécriture d\'URL', [
'checked' => helper::checkRewrite(),
'help' => 'Vérifiez d\'abord que votre serveur l\'autorise : ce n\'est pas le cas chez Free.'
]); ?>
</div>
<div class="col4">
<?php echo template::checkbox('configMaintenance', true, 'Site en maintenance', [
'checked' => $this->getData(['config', 'maintenance'])
]); ?>
</div>
<div class="col4">
<?php echo template::checkbox('configAutoBackup', true, 'Sauvegarde quotidienne', [
'checked' => $this->getData(['config', 'autoBackup']),
'help' => '<p>Une archive contenant le dossier /site/data est copiée dans le dossier \'site/backup\'. La sauvegarde est conservée pendant 30 jours.</p><p>Les fichiers du site ne sont pas sauvegardés automatiquement.</p>'
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::checkbox('configAutoUpdate', true, 'Mise à jour en ligne', [
'checked' => $this->getData(['config', 'autoUpdate']),
'help' => 'Vérifie une fois par jour l\'existence d\'une mise à jour.',
'disabled' => !$error
]); ?>
</div>
<div class="col4 ">
<?php echo template::checkbox('configAutoUpdateHtaccess', true, 'Préserver htaccess', [
'checked' => $this->getData(['config', 'autoUpdateHtaccess']),
'help' => 'Lors d\'une mise à jour automatique, conserve le fichier htaccess de la racine du site.',
'disabled' => !$error
]); ?>
</div>
<div class="col4 ">
<?php echo template::button('configUpdateForced', [
'ico' => 'download-cloud',
'href' => helper::baseUrl() . 'install/update',
'value' => 'Mise à jour manuelle',
'class' => 'buttonRed',
'disabled' => !$error
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
@ -177,21 +75,21 @@
}
echo template::select('configHomePageId', helper::arrayCollumn($pages, 'title', 'SORT_ASC'), [
'label' => 'Accueil du site',
'selected' =>$this->getData(['config', 'homePageId']),
'selected' =>$this->getData(['locale', 'homePageId']),
'help' => 'La première page que vos visiteurs verront.'
]); ?>
</div>
<div class="col4">
<?php echo template::select('configLegalPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($pages, 'title', 'SORT_ASC') ) , [
'label' => 'Mentions légales',
'selected' => $this->getData(['config', 'legalPageId']),
'selected' => $this->getData(['locale', 'legalPageId']),
'help' => 'Les mentions légales sont obligatoires en France. Une option du pied de page ajoute un lien discret vers cette page.'
]); ?>
</div>
<div class="col4">
<?php echo template::select('configSearchPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($pages, 'title', 'SORT_ASC') ) , [
'label' => 'Recherche dans le site',
'selected' => $this->getData(['config', 'searchPageId']),
'selected' => $this->getData(['locale', 'searchPageId']),
'help' => 'Sélectionner la page "Recherche" ou une page contenant le module "Recherche" permet d\'activer un lien dans le pied de page. '
]); ?>
</div>
@ -201,7 +99,7 @@
<?php
echo template::select('configPage403', array_merge(['none' => 'Page par défaut'],helper::arrayCollumn($orphans, 'title', 'SORT_ASC')), [
'label' => 'Accès interdit, erreur 403',
'selected' =>$this->getData(['config', 'page403']),
'selected' =>$this->getData(['locale', 'page403']),
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
]); ?>
</div>
@ -209,7 +107,7 @@
<?php
echo template::select('configPage404', array_merge(['none' => 'Page par défaut'],helper::arrayCollumn($orphans, 'title', 'SORT_ASC')), [
'label' => 'Page inexistante, erreur 404',
'selected' =>$this->getData(['config', 'page404']),
'selected' =>$this->getData(['locale', 'page404']),
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
]); ?>
</div>
@ -217,7 +115,7 @@
<?php
echo template::select('configPage302', array_merge(['none' => 'Page par défaut'],helper::arrayCollumn($orphans, 'title', 'SORT_ASC')), [
'label' => 'Site en maintenance',
'selected' =>$this->getData(['config', 'page302']),
'selected' =>$this->getData(['locale', 'page302']),
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
]); ?>
</div>
@ -225,373 +123,4 @@
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="social">
<h4>Réseaux sociaux
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col3">
<?php echo template::text('configSocialFacebookId', [
'help' => 'Saisissez votre ID : https://www.facebook.com/[ID].',
'label' => 'Facebook',
'value' => $this->getData(['config', 'social', 'facebookId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('configSocialInstagramId', [
'help' => 'Saisissez votre ID : https://www.instagram.com/[ID].',
'label' => 'Instagram',
'value' => $this->getData(['config', 'social', 'instagramId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('configSocialYoutubeId', [
'help' => 'ID de la chaîne : https://www.youtube.com/channel/[ID].',
'label' => 'Chaîne Youtube',
'value' => $this->getData(['config', 'social', 'youtubeId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('configSocialYoutubeUserId', [
'help' => 'Saisissez votre ID Utilisateur : https://www.youtube.com/user/[ID].',
'label' => 'Youtube',
'value' => $this->getData(['config', 'social', 'youtubeUserId'])
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::text('configSocialTwitterId', [
'help' => 'Saisissez votre ID : https://twitter.com/[ID].',
'label' => 'Twitter',
'value' => $this->getData(['config', 'social', 'twitterId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('configSocialPinterestId', [
'help' => 'Saisissez votre ID : https://pinterest.com/[ID].',
'label' => 'Pinterest',
'value' => $this->getData(['config', 'social', 'pinterestId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('configSocialLinkedinId', [
'help' => 'Saisissez votre ID Linkedin : https://fr.linkedin.com/in/[ID].',
'label' => 'Linkedin',
'value' => $this->getData(['config', 'social', 'linkedinId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('configSocialGithubId', [
'help' => 'Saisissez votre ID Github : https://github.com/[ID].',
'label' => 'Github',
'value' => $this->getData(['config', 'social', 'githubId'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="ceo">
<h4>Référencement
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col4 offset1">
<div class="row">
<div class="col12">
<?php echo template::button('configMetaImage', [
'href' => helper::baseUrl() . 'config/configMetaImage',
'value' => 'Capture Open Graph',
'ico' => 'pencil'
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::button('configSiteMap', [
'href' => helper::baseUrl() . 'config/generateFiles',
'value' => 'Sitemap.xml / Robots.txt',
'ico' => 'pencil'
]); ?>
</div>
</div>
</div>
<div class="col6 offset1">
<?php if (file_exists(self::FILE_DIR.'source/screenshot.jpg')): ?>
<div class="row">
<div class="col8 offset2 textAlignCenter">
<img src="<?php echo helper::baseUrl(false) . self::FILE_DIR.'source/screenshot.jpg';?>" data-tippy-content="Cette capture d'écran est nécessaire aux partages sur les réseaux sociaux. Elle est régénérée lorsque le fichier 'screenshot.jpg' est effacé du gestionnaire de fichiers." />
</div>
</div>
<?php endif;?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="login">
<h4>Sécurité de la connexion
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col3">
<?php echo template::select('configConnectAttempt', $module::$connectAttempt , [
'label' => 'Connexions successives',
'selected' => $this->getData(['config', 'connect', 'attempt'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('configConnectTimeout', $module::$connectTimeout , [
'label' => 'Blocage après échecs',
'selected' => $this->getData(['config', 'connect', 'timeout'])
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<label id="helpBlacklist">Comptes inexistants
<?php echo template::help(
'La liste noire énumère les tentatives de connexion à partir de comptes inexistants. Sont stockés : la date, l\'heure, le nom du compte et l\'IP.
Après le nombre de tentatives autorisées, l\'IP et le compte sont bloqués.');
?>
</label>
<?php echo template::button('configConnectblacListDownload', [
'href' => helper::baseUrl() . 'config/blacklistDownload',
'value' => 'Télécharger liste noire',
'ico' => 'download'
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<?php echo template::button('ConfigConnectReset', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'config/blacklistReset',
'value' => 'Réinitialiser liste',
'ico' => 'cancel'
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::checkbox('configConnectCaptcha', true, 'Captcha à la connexion', [
'checked' => $this->getData(['config', 'connect','captcha'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="logs">
<h4>Journalisation
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col4 verticalAlignBottom">
<?php echo template::checkbox('configConnectLog', true, 'Activer la journalisation', [
'checked' => $this->getData(['config', 'connect', 'log'])
]); ?>
</div>
<div class="col3 offset2">
<?php echo template::button('ConfigLogDownload', [
'href' => helper::baseUrl() . 'config/logDownload',
'value' => 'Télécharger journal',
'ico' => 'download'
]); ?>
</div>
<div class="col3">
<?php echo template::button('ConfigLogReset', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'config/logReset',
'value' => 'Réinitialiser journal',
'ico' => 'cancel'
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="network">
<h4>Réseau
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col2">
<?php echo template::select('configProxyType', $module::$proxyType, [
'label' => 'Type de proxy',
'selected' => $this->getData(['config', 'proxyType'])
]); ?>
</div>
<div class="col8">
<?php echo template::text('configProxyUrl', [
'label' => 'Adresse du proxy',
'placeholder' => 'cache.proxy.fr',
'value' => $this->getData(['config', 'proxyUrl'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('configProxyPort', [
'label' => 'Port du proxy',
'placeholder' => '6060',
'value' => $this->getData(['config', 'proxyPort'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="smtp">
<h4>Messagerie SMTP
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col12">
<?php echo template::checkbox('configSmtpEnable', true, 'Activer SMTP', [
'checked' => $this->getData(['config', 'smtp','enable']),
'help' => 'Paramètres à utiliser lorsque votre hébergeur ne propose pas la fonctionnalité d\'envoi de mail.'
]); ?>
</div>
</div>
<div id="configSmtpParam">
<div class="row">
<div class="col8">
<?php echo template::text('configSmtpHost', [
'label' => 'Adresse SMTP',
'placeholder' => 'smtp.fr',
'value' => $this->getData(['config', 'smtp','host'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('configSmtpPort', [
'label' => 'Port SMTP',
'placeholder' => '589',
'value' => $this->getData(['config', 'smtp','port'])
]); ?>
</div>
<div class="col2">
<?php echo template::select('configSmtpAuth', $module::$SMTPauth, [
'label' => 'Authentification',
'selected' => $this->getData(['config', 'smtp','auth'])
]); ?>
</div>
</div>
<div id="configSmtpAuthParam">
<div class="row">
<div class="col5">
<?php echo template::text('configSmtpUsername', [
'label' => 'Nom utilisateur',
'value' => $this->getData(['config', 'smtp','username' ])
]); ?>
</div>
<div class="col5">
<?php echo template::password('configSmtpPassword', [
'label' => 'Mot de passe',
'autocomplete' => 'off',
'value' => $this->getData(['config', 'smtp','username' ]) ? helper::decrypt ($this->getData(['config', 'smtp','username' ]),$this->getData(['config','smtp','password'])) : ''
]); ?>
</div>
<div class="col2">
<?php echo template::select('configSmtpSecure', $module::$SMTPEnc , [
'label' => 'Sécurité',
'selected' => $this->getData(['config', 'smtp','secure'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="script">
<h4>Scripts
<div class="openClose">
<?php
echo template::ico('plus-circled','right');
echo template::ico('minus-circled','right');
?>
</div>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col3">
<?php echo template::text('configAnalyticsId', [
'help' => 'Saisissez l\'ID de suivi.',
'label' => 'Google Analytics',
'placeholder' => 'UA-XXXXXXXX-X',
'value' => $this->getData(['config', 'analyticsId'])
]); ?>
</div>
<div class="col3 offset3 verticalAlignBottom">
<?php echo template::button('configScriptHead', [
'href' => helper::baseUrl() . 'config/script/head',
'value' => 'Script dans head',
'ico' => 'pencil'
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<?php echo template::button('ConfigScriptBody', [
'href' => helper::baseUrl() . 'config/script/body',
'value' => 'Script dans body',
'ico' => 'pencil'
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>

View File

@ -12,7 +12,6 @@
* @link http://zwiicms.fr/
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css

View File

@ -3,7 +3,7 @@
<div class="col2">
<?php echo template::button('configManageBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'config',
'href' => helper::baseUrl() . 'config/advanced',
'ico' => 'left',
'value' => 'Retour'
]); ?>

View File

@ -12,7 +12,6 @@
* @link http://zwiicms.fr/
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css

View File

@ -3,7 +3,7 @@
<div class="col2">
<?php echo template::button('configManageBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'config',
'href' => helper::baseUrl() . 'config/advanced',
'ico' => 'left',
'value' => 'Retour'
]); ?>

View File

@ -9,12 +9,6 @@ class init extends common {
'cookieConsent' => true,
'favicon' => 'favicon.ico',
'faviconDark' => 'faviconDark.ico',
'homePageId' => 'accueil',
'page302' => 'erreur302',
'page403' => 'erreur403',
'page404' => 'erreur404',
'legalPageId' => 'mentions-legales',
'searchPageId' => 'recherche',
'maintenance' => false,
'captchaStrong' => false,
'social' => [
@ -28,8 +22,6 @@ class init extends common {
],
'timezone' => 'Europe/Paris',
'itemsperPage' => 10,
'metaDescription' => 'Zwii est un CMS sans base de données qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.',
'title' => 'Votre site en quelques clics !',
'proxyUrl' => '',
'proxyPort' => '',
'proxyType' => 'tcp://',
@ -39,17 +31,28 @@ class init extends common {
'connect' => [
'timeout' => 600,
'attempt' => 3,
'log' => false
]
'log' => false,
'captcha' => true
],
],
'core' => [
'dataVersion' => 10300,
'dataVersion' => 10400,
'lastBackup' => 0,
'lastClearTmp' => 0,
'lastAutoUpdate' => 0,
'updateAvailable' => false,
'baseUrl' => ''
],
'locale' => [
'homePageId' => 'accueil',
'page302' => 'none',
'page403' => 'none',
'page404' => 'none',
'legalPageId' => 'none',
'searchPageId' => 'none',
'metaDescription' => 'Zwii est un CMS sans base de données qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.',
'title' => 'Votre site en quelques clics !'
],
'page' => [
'accueil' => [
'typeMenu' => 'text',
@ -79,10 +82,6 @@ class init extends common {
'hideMenuChildren' =>false
]
],
'translate' => [
'active' => false,
'showCredits' => false
],
'module' => [],
'user' => [],
'theme' => [
@ -202,6 +201,7 @@ class init extends common {
'backgroundBlockColor' => 'rgba(236, 239, 241, 1)',
'borderBlockColor' => 'rgba(190, 202, 209, 1)'
],
'blacklist' => []
];
@ -650,7 +650,13 @@ class init extends common {
'blog' => [
'config' => [
'feeds' => true,
'feedsLabel' => "Syndication RSS"
'feedsLabel' => "Syndication RSS",
"editConsent" => "all",
"commentMaxlength" => "500",
"commentApproved" => false,
"commentClose" => false,
"commentNotification" => false,
"commentGroupNotification" => 1
],
'posts' => [
'mon-premier-article' => [
@ -660,7 +666,8 @@ class init extends common {
'author' => 'Rémi',
'content' => 'Article bien rédigé et très pertinent, bravo !',
'createdOn' => 1421748000,
'userId' => ''
'userId' => '',
'approval' => true
]
],
'content' => '<p>Et eodem impetu Domitianum praecipitem per scalas itidem funibus constrinxerunt, eosque coniunctos per ampla spatia civitatis acri raptavere discursu. iamque artuum et membrorum divulsa conpage superscandentes corpora mortuorum ad ultimam truncata deformitatem velut exsaturati mox abiecerunt in flumen.</p><p>Ex his quidam aeternitati se commendari posse per statuas aestimantes eas ardenter adfectant quasi plus praemii de figmentis aereis sensu carentibus adepturi, quam ex conscientia honeste recteque factorum, easque auro curant inbracteari, quod Acilio Glabrioni delatum est primo, cum consiliis armisque regem superasset Antiochum. quam autem sit pulchrum exigua haec spernentem et minima ad ascensus verae gloriae tendere longos et arduos, ut memorat vates Ascraeus, Censorius Cato monstravit. qui interrogatus quam ob rem inter multos... statuam non haberet malo inquit ambigere bonos quam ob rem id non meruerim, quam quod est gravius cur inpetraverim mussitare.</p><p>Latius iam disseminata licentia onerosus bonis omnibus Caesar nullum post haec adhibens modum orientis latera cuncta vexabat nec honoratis parcens nec urbium primatibus nec plebeiis.</p>',
@ -774,7 +781,17 @@ class init extends common {
'values' => ''
]
]
]
],
'locale' => [
'homePageId' => 'accueil',
'page302' => 'erreur302',
'page403' => 'erreur403',
'page404' => 'erreur404',
'legalPageId' => 'mentions-legales',
'searchPageId' => 'recherche',
'metaDescription' => 'Zwii est un CMS sans base de données qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.',
'title' => 'Votre site en quelques clics !'
],
]
];
}

View File

@ -13,9 +13,6 @@
*/
/*
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -28,12 +28,12 @@ class maintenance extends common {
exit();
}
// Page perso définie et existante
if ($this->getData(['config','page302']) !== 'none'
AND $this->getData(['page',$this->getData(['config','page302'])]) ) {
if ($this->getData(['locale','page302']) !== 'none'
AND $this->getData(['page',$this->getData(['locale','page302'])]) ) {
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,
'title' => $this->getData(['page',$this->getData(['config','page302']),'title']),
'content' => $this->getdata(['page',$this->getData(['config','page302']),'content']),
'title' => $this->getData(['page',$this->getData(['locale','page302']),'title']),
'content' => $this->getdata(['page',$this->getData(['locale','page302']),'content']),
'view' => 'index'
]);
} else {

View File

@ -37,8 +37,7 @@ class page extends common {
'form' => 'Formulaire',
'gallery' => 'Galerie',
'redirection' => 'Redirection',
'search' => 'Recherche',
'translate' => 'Traduction'
'search' => 'Recherche'
];
public static $typeMenu = [
'text' => 'Texte',
@ -220,7 +219,7 @@ class page extends common {
]);
}
// Impossible de supprimer la page d'accueil
elseif($url[0] === $this->getData(['config', 'homePageId'])) {
elseif($url[0] === $this->getData(['locale', 'homePageId'])) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
@ -228,7 +227,7 @@ class page extends common {
]);
}
// Impossible de supprimer la page de recherche affectée
elseif($url[0] === $this->getData(['config', 'searchPageId'])) {
elseif($url[0] === $this->getData(['locale', 'searchPageId'])) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
@ -236,7 +235,7 @@ class page extends common {
]);
}
// Impossible de supprimer la page des mentions légales affectée
elseif($url[0] === $this->getData(['config', 'legalPageId'])) {
elseif($url[0] === $this->getData(['locale', 'legalPageId'])) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
@ -244,7 +243,7 @@ class page extends common {
]);
}
// Impossible de supprimer la page des mentions légales affectée
elseif($url[0] === $this->getData(['config', 'page404'])) {
elseif($url[0] === $this->getData(['locale', 'page404'])) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
@ -252,7 +251,7 @@ class page extends common {
]);
}
// Impossible de supprimer la page des mentions légales affectée
elseif($url[0] === $this->getData(['config', 'page403'])) {
elseif($url[0] === $this->getData(['locale', 'page403'])) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
@ -260,7 +259,7 @@ class page extends common {
]);
}
// Impossible de supprimer la page des mentions légales affectée
elseif($url[0] === $this->getData(['config', 'page302'])) {
elseif($url[0] === $this->getData(['locale', 'page302'])) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
@ -321,70 +320,60 @@ class page extends common {
return;
}
// La page existe
// Soumission du formulaire
if($this->isPost()
) {
// Génére l'ID si le titre de la page a changé
if ( $this->getInput('pageEditTitle') !== $this->getData(['page',$this->getUrl(2),'title']) ) {
$pageId = $this->getInput('pageEditTitle', helper::FILTER_ID, true);
} else {
$pageId = $this->getUrl(2);
}
// un dossier existe du même nom (erreur en cas de redirection)
if (file_exists($pageId)) {
$pageId = uniqid($pageId);
}
// Si l'id a changée
if ($pageId !== $this->getUrl(2)) {
// Incrémente le nouvel id de la page
$pageId = helper::increment($pageId, $this->getData(['page']));
$pageId = helper::increment($pageId, self::$coreModuleIds);
$pageId = helper::increment($pageId, self::$moduleIds);
// Met à jour les enfants
foreach($this->getHierarchy($this->getUrl(2)) as $childrenPageId) {
$this->setData(['page', $childrenPageId, 'parentPageId', $pageId]);
else {
// Soumission du formulaire
if($this->isPost()) {
// Génére l'ID si le titre de la page a changé
if ( $this->getInput('pageEditTitle') !== $this->getData(['page',$this->getUrl(2),'title']) ) {
$pageId = $this->getInput('pageEditTitle', helper::FILTER_ID, true);
} else {
$pageId = $this->getUrl(2);
}
// Change l'id de page dans les données des modules
$this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])]);
$this->deleteData(['module', $this->getUrl(2)]);
// Si la page correspond à la page d'accueil, change l'id dans la configuration du site
if($this->getData(['config', 'homePageId']) === $this->getUrl(2)) {
$this->setData(['config', 'homePageId', $pageId]);
// un dossier existe du même nom (erreur en cas de redirection)
if (file_exists($pageId)) {
$pageId = uniqid($pageId);
}
}
// Supprime les données du module en cas de changement de module
if( !empty($this->getInput('pageEditModuleId') )
AND $this->getInput('pageEditModuleId') !== $this->getData(['page', $this->getUrl(2), 'moduleId'])) {
$this->deleteData(['module', $pageId]);
}
// Supprime l'ancienne page si l'id a changée
if($pageId !== $this->getUrl(2)) {
$this->deleteData(['page', $this->getUrl(2)]);
}
// Traitement des pages spéciales affectées dans la config :
if ($this->getUrl(2) === $this->getData(['config', 'legalPageId']) ) {
$this->setData(['config','legalPageId', $pageId]);
}
if ($this->getUrl(2) === $this->getData(['config', 'searchPageId']) ) {
$this->setData(['config','searchPageId', $pageId]);
}
if ($this->getUrl(2) === $this->getData(['config', 'page404']) ) {
$this->setData(['config','page404', $pageId]);
}
if ($this->getUrl(2) === $this->getData(['config', 'page403']) ) {
$this->setData(['config','page403', $pageId]);
}
if ($this->getUrl(2) === $this->getData(['config', 'page302']) ) {
$this->setData(['config','page302', $pageId]);
}
// Si la page est une page enfant, actualise les positions des autres enfants du parent, sinon actualise les pages sans parents
$lastPosition = 1;
$hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy());
$position = $this->getInput('pageEditPosition', helper::FILTER_INT);
foreach($hierarchy as $hierarchyPageId) {
// Ignore la page en cours de modification
if($hierarchyPageId === $this->getUrl(2)) {
continue;
// Si l'id a changée
if ($pageId !== $this->getUrl(2)) {
// Incrémente le nouvel id de la page
$pageId = helper::increment($pageId, $this->getData(['page']));
$pageId = helper::increment($pageId, self::$coreModuleIds);
$pageId = helper::increment($pageId, self::$moduleIds);
// Met à jour les enfants
foreach($this->getHierarchy($this->getUrl(2)) as $childrenPageId) {
$this->setData(['page', $childrenPageId, 'parentPageId', $pageId]);
}
// Change l'id de page dans les données des modules
$this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])]);
$this->deleteData(['module', $this->getUrl(2)]);
// Si la page correspond à la page d'accueil, change l'id dans la configuration du site
if($this->getData(['locale', 'homePageId']) === $this->getUrl(2)) {
$this->setData(['locale', 'homePageId', $pageId]);
}
}
// Supprime les données du module en cas de changement de module
if($this->getInput('pageEditModuleId') !== $this->getData(['page', $this->getUrl(2), 'moduleId'])) {
$this->deleteData(['module', $pageId]);
}
// Supprime l'ancienne page si l'id a changée
if($pageId !== $this->getUrl(2)) {
$this->deleteData(['page', $this->getUrl(2)]);
}
// Traitement des pages spéciales affectées dans la config :
if ($this->getUrl(2) === $this->getData(['locale', 'legalPageId']) ) {
$this->setData(['locale','legalPageId', $pageId]);
}
if ($this->getUrl(2) === $this->getData(['locale', 'searchPageId']) ) {
$this->setData(['locale','searchPageId', $pageId]);
}
if ($this->getUrl(2) === $this->getData(['locale', 'page404']) ) {
$this->setData(['locale','page404', $pageId]);
}
if ($this->getUrl(2) === $this->getData(['locale', 'page403']) ) {
$this->setData(['locale','page403', $pageId]);
}
if ($this->getUrl(2) === $this->getData(['locale', 'page302']) ) {
$this->setData(['locale','page302', $pageId]);
}
// Incrémente de +1 pour laisser la place à la position de la page en cours de modification
if($lastPosition === $position) {

View File

@ -12,9 +12,6 @@
* @link http://zwiicms.fr/
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -12,9 +12,6 @@
* @link http://zwiicms.fr/
*/
/* Thème administration */
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -12,8 +12,6 @@
* @link http://zwiicms.fr/
*/
/* Thème administration */
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css

View File

@ -11,7 +11,6 @@
* @link http://zwiicms.fr/
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css

View File

@ -12,8 +12,6 @@
* @link http://zwiicms.fr/
*/
/* Thème administration */
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css

View File

@ -79,16 +79,16 @@
<div class="row">
<div class="col6">
<?php echo template::checkbox('themeFooterDisplayLegal', true, 'Mentions légales', [
'checked' => $this->getData(['config', 'legalPageId']) === 'none' ? false : $this->getData(['theme', 'footer', 'displayLegal']),
'disabled' => $this->getData(['config', 'legalPageId']) === 'none' ? true : false,
'help' => $this->getData(['config', 'legalPageId']) === 'none' ? 'Pour activer cette option, sélectionnez la page contenant les mentions légales dans la configuration du site' : ''
'checked' => $this->getData(['locale', 'legalPageId']) === 'none' ? false : $this->getData(['theme', 'footer', 'displayLegal']),
'disabled' => $this->getData(['locale', 'legalPageId']) === 'none' ? true : false,
'help' => $this->getData(['locale', 'legalPageId']) === 'none' ? 'Pour activer cette option, sélectionnez la page contenant les mentions légales dans la configuration du site' : ''
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('themeFooterDisplaySearch', true, 'Rechercher dans le site', [
'checked' => $this->getData(['config', 'searchPageId']) === 'none' ? false : $this->getData(['theme', 'footer', 'displaySearch']),
'disabled' => $this->getData(['config', 'searchPageId']) === 'none' ? true : false,
'help' => $this->getData(['config', 'searchPageId']) === 'none' ? 'Pour activer cette option, sélectionnez la page contenant un module de recherche dans la configuration du site' : ''
'checked' => $this->getData(['locale', 'searchPageId']) === 'none' ? false : $this->getData(['theme', 'footer', 'displaySearch']),
'disabled' => $this->getData(['locale', 'searchPageId']) === 'none' ? true : false,
'help' => $this->getData(['locale', 'searchPageId']) === 'none' ? 'Pour activer cette option, sélectionnez la page contenant un module de recherche dans la configuration du site' : ''
]); ?>
</div>
</div>

View File

@ -12,8 +12,6 @@
* @link http://zwiicms.fr/
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -11,9 +11,6 @@
*/
/* Thème administration */
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -12,8 +12,6 @@
* @link http://zwiicms.fr/
*/
/* Thème administration */
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css

View File

@ -12,7 +12,6 @@
* @link http://zwiicms.fr/
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -16,18 +16,70 @@ class translate extends common {
public static $actions = [
/*'config' => self::GROUP_MODERATOR,*/
'index' => self::GROUP_MODERATOR
'index' => self::GROUP_MODERATOR,
'language' => self::GROUP_VISITOR
];
/**
* Configuration
*/
public function index() {
// Soumission du formulaire
if($this->isPost()) {
$this->setData(['translate', [
'active' => $this->getInput('translateActive', helper::FILTER_BOOLEAN),
'showCredits' => $this->getInput('translateActive', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false,
// Edtion des langues
foreach (self::$i18nList as $keyi18n => $value) {
if ($keyi18n === 'fr') {continue;}
// Effacement d'une langue installée (dossier plus option désactivée précédemment)
if ( is_dir( self::DATA_DIR . $keyi18n ) === true
AND $this->getInput('translateSiteFlag' . strtoupper($keyi18n) , helper::FILTER_BOOLEAN) === false )
{
$this->removeDir( self::DATA_DIR . $keyi18n);
}
// Installation d'une langue
if ( $this->getInput('translateSiteFlag' . strtoupper($keyi18n) , helper::FILTER_BOOLEAN) === true )
{
// Créer le dossier
if (is_dir( self::DATA_DIR . $keyi18n ) === false ) {
mkdir( self::DATA_DIR . $keyi18n);
}
// Charger les modèles
require_once('core/module/install/ressource/defaultdata.php');
// Nouvelle instance des pages, module, locale
$files = ['page','module','locale'];
foreach ($files as $keyFile) {
echo $keyFile;
$e = new \Prowebcraft\JsonDb([
'name' => $keyFile . '.json',
'dir' => $this->dataPath ($keyFile,$keyi18n)
]);;
$e->set($keyFile, init::$defaultData[$keyFile]);
$e->save();
}
}
}
// Enregistrement des données
$this->setData(['config','translate', [
'scriptGoogle' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN),
'showCredits' => $this->getInput('translateCredits', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false,
'autoDetect' => $this->getInput('translateAutoDetect', helper::FILTER_BOOLEAN),
'admin' => $this->getInput('translateAdmin', helper::FILTER_BOOLEAN),
'scriptFR' => $this->getInput('translateScriptFlagFR', helper::FILTER_BOOLEAN),
'scriptDE' => $this->getInput('translateScriptFlagDE', helper::FILTER_BOOLEAN),
'scriptEN' => $this->getInput('translateScriptFlagEN', helper::FILTER_BOOLEAN),
'scriptES' => $this->getInput('translateScriptFlagES', helper::FILTER_BOOLEAN),
'scriptIT' => $this->getInput('translateScriptFlagIT', helper::FILTER_BOOLEAN),
'scriptNL' => $this->getInput('translateScriptFlagNL', helper::FILTER_BOOLEAN),
'scriptPT' => $this->getInput('translateScriptFlagPT', helper::FILTER_BOOLEAN),
'site' => $this->getInput('translateSite', helper::FILTER_BOOLEAN),
'siteFR' => $this->getInput('translateSiteFlagFR', helper::FILTER_BOOLEAN),
'siteDE' => $this->getInput('translateSiteFlagDE', helper::FILTER_BOOLEAN),
'siteEN' => $this->getInput('translateSiteFlagEN', helper::FILTER_BOOLEAN),
'siteES' => $this->getInput('translateSiteFlagES', helper::FILTER_BOOLEAN),
'siteIT' => $this->getInput('translateSiteFlagIT', helper::FILTER_BOOLEAN),
'siteNL' => $this->getInput('translateSiteFlagNL', helper::FILTER_BOOLEAN),
'sitePT' => $this->getInput('translateSiteFlagPT', helper::FILTER_BOOLEAN)
]]);
// Valeurs en sortie
$this->addOutput([
@ -41,7 +93,17 @@ class translate extends common {
'title' => 'Paramètres',
'view' => 'index'
]);
}
}
/*
* Traitement du changement de langues
*/
public function language() {
// Transmettre le choix au noyau
setcookie('ZWII_USER_I18N', $this->getUrl(2), time() + 3600, helper::baseUrl(false, false) , '', helper::isHttps(), true);
// Valeurs en sortie sans post
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(3)
]);
}
}

View File

@ -15,19 +15,107 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Configuration</h4>
<h4>Langues supportées</h4>
<div class="row">
<div class="col6">
<?php echo template::checkbox('translateActive', true, 'Traduction automatique', [
'checked' => $this->getData(['translate', 'active']),
'help' => 'Traduction automatique du site hors connexion par le script Google Translate selon la langue du navigateur du visiteur.'
<b>Traduction automatique :</b>
<div class="col12">
<?php echo template::checkbox('translateScriptFlagDE', true, 'Allemand', [
'checked' => $this->getData(['config','translate', 'scriptDE'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateScriptFlagEN', true, 'Anglais', [
'checked' => $this->getData(['config','translate', 'scriptEN'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateScriptFlagES', true, 'Espagnol', [
'checked' => $this->getData(['config','translate', 'scriptES'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateScriptFlagIT', true, 'Italien', [
'checked' => $this->getData(['config','translate', 'scriptIT'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateScriptFlagNL', true, 'Néerlandais', [
'checked' => $this->getData(['config','translate', 'scriptNL'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateScriptFlagPT', true, 'Portugais', [
'checked' => $this->getData(['config','translate', 'scriptPT'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateAutoDetect', true, 'Détection automatique', [
'checked' => $this->getData(['config','translate', 'autoDetect']),
'help' => 'Détecte la langue du navigateur.'
]); ?>
</div>
</div>
<div class="col6">
<?php echo template::checkbox('translateCredits', true, 'Afficher les crédits', [
'checked' => $this->getData(['translate', 'showCredits']),
<b>Traduction rédigée :</b>
<div class="col12">
<?php echo template::checkbox('translateSiteFlagEN', true, 'Anglais', [
'checked' => $this->getData(['config', 'translate', 'siteEN'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateSiteFlagDE', true, 'Allemand', [
'checked' => $this->getData(['config', 'translate', 'siteDE'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateSiteFlagES', true, 'Espagnol', [
'checked' => $this->getData(['config', 'translate', 'siteES'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateSiteFlagIT', true, 'Italien', [
'checked' => $this->getData(['config', 'translate', 'siteIT'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateSiteFlagNL', true, 'Néerlandais', [
'checked' => $this->getData(['config', 'translate', 'siteNL'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateSiteFlagPT', true, 'Portugais', [
'checked' => $this->getData(['config', 'translate', 'sitePT'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres de traduction automatique</h4>
<div class="row">
<div class="col4">
<?php echo template::checkbox('translateScriptGoogle', true, 'Active le script de traduction automatique', [
'checked' => $this->getData(['config','translate', 'scriptGoogle'])
]); ?>
</div>
<div class="col4">
<?php echo template::checkbox('translateAdmin', true, 'Mode connexion', [
'checked' => $this->getData(['config','translate', 'admin']),
'help' => 'Traduction automatique du site et de l\'interface du CMS'
]); ?>
</div>
<div class="col4">
<?php echo template::checkbox('translateCredits', true, 'Afficher les crédits du script Google', [
'checked' => $this->getData(['config','translate', 'showCredits']),
'help' => 'Option vivement recommandée pour le respect du droit d\'auteur'
]); ?>
</div>
</div>
</div>
</div>

View File

@ -95,9 +95,9 @@ class user extends common {
if($this->getInput('userAddSendMail', helper::FILTER_BOOLEAN) && $check === true) {
$sent = $this->sendMail(
$userMail,
'Compte créé sur ' . $this->getData(['config', 'title']),
'Compte créé sur ' . $this->getData(['locale', 'title']),
'Bonjour <strong>' . $userFirstname . ' ' . $userLastname . '</strong>,<br><br>' .
'Un administrateur vous a créé un compte sur le site ' . $this->getData(['config', 'title']) . '. Vous trouverez ci-dessous les détails de votre compte.<br><br>' .
'Un administrateur vous a créé un compte sur le site ' . $this->getData(['locale', 'title']) . '. Vous trouverez ci-dessous les détails de votre compte.<br><br>' .
'<strong>Identifiant du compte :</strong> ' . $this->getInput('userAddId') . '<br>' .
'<small>Nous ne conservons pas les mots de passe, en conséquence nous vous conseillons de conserver ce message tant que vous ne vous êtes pas connecté. Vous pourrez modifier votre mot de passe après votre première connexion.</small>',
null
@ -263,12 +263,12 @@ class user extends common {
$redirect = helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl());
}
// Redirection si retour en arrière possible
elseif($this->getUrl(3)) {
elseif($this->getUser('group') === 3) {
$redirect = helper::baseUrl() . 'user';
}
// Redirection normale
else {
$redirect = helper::baseUrl() . $this->getUrl();
$redirect = helper::baseUrl();
}
// Valeurs en sortie
$this->addOutput([
@ -555,10 +555,14 @@ class user extends common {
$this->setData(['user', $this->getUrl(2), 'password', $newPassword]);
// Réinitialise la date de la demande
$this->setData(['user', $this->getUrl(2), 'forgot', 0]);
// Réinitialise le blocage
$this->setData(['user', $this->getUrl(2),'connectFail',0 ]);
$this->setData(['user', $this->getUrl(2),'connectTimeout',0 ]);
// Valeurs en sortie
$this->addOutput([
'notification' => 'Nouveau mot de passe enregistré',
'redirect' => helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()),
//'redirect' => helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()),
'redirect' => helper::baseUrl(),
'state' => true
]);
}
@ -566,7 +570,7 @@ class user extends common {
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,
'title' => 'Réinitialisation de votre mot de passe',
'title' => 'Réinitialisation du mot de passe',
'view' => 'reset'
]);
}
@ -621,7 +625,7 @@ class user extends common {
$item['prenom'],
self::$groups[$item['groupe']],
$item['prenom'],
$item['email'],
helper::filter($item['email'] , helper::FILTER_MAIL),
$item['notification']
];
// L'utilisateur n'existe pas
@ -653,9 +657,9 @@ class user extends common {
AND $this->getInput('userImportNotification',helper::FILTER_BOOLEAN) === true) {
$sent = $this->sendMail(
$item['email'],
'Compte créé sur ' . $this->getData(['config', 'title']),
'Compte créé sur ' . $this->getData(['locale', 'title']),
'Bonjour <strong>' . $item['prenom'] . ' ' . $item['nom'] . '</strong>,<br><br>' .
'Un administrateur vous a créé un compte sur le site ' . $this->getData(['config', 'title']) . '. Vous trouverez ci-dessous les détails de votre compte.<br><br>' .
'Un administrateur vous a créé un compte sur le site ' . $this->getData(['locale', 'title']) . '. Vous trouverez ci-dessous les détails de votre compte.<br><br>' .
'<strong>Identifiant du compte :</strong> ' . $userId . '<br>' .
'<small>Un mot de passe provisoire vous été attribué, à la première connexion cliquez sur Mot de passe Oublié.</small>'
);

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -53,10 +53,10 @@
</div>
<?php echo template::formClose(); ?>
<?php if ($module::$users): ?>
<?php echo template::table([1, 3, 3, 1, 1, 2, 1, 1 ], $module::$users, ['Identifiant', 'Nom', 'Prénom','Groupe', 'Pseudo', 'eMail', 'Succès']); ?>
<div class="row">
<div class="col12 textAlignCenter">
<?php echo template::ico('check');?> Compte créé | <?php echo template::ico('comment');?> Compte créé et notifié | <?php echo template::ico('cancel');?> ou manquant : erreur, compte non importé
<?php echo template::table([1, 3, 3, 1, 1, 2, 1], $module::$users, ['Id', 'Nom', 'Prénom','Groupe', 'Pseudo', 'eMail', '']); ?>
<?php echo template::ico('check');?> Compte créé | <?php echo template::ico('mail');?> Compte créé et notifié | <?php echo template::ico('cancel');?> Erreur dans le fichier, compte non créé.
</div>
</div>
<?php endif;?>

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -11,9 +11,3 @@
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

BIN
core/vendor/i18n/png/de.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

BIN
core/vendor/i18n/png/en.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
core/vendor/i18n/png/es.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

BIN
core/vendor/i18n/png/fr.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

BIN
core/vendor/i18n/png/it.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

BIN
core/vendor/i18n/png/nl.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
core/vendor/i18n/png/pt.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

View File

@ -46,7 +46,7 @@
c._cest = gtConstEvalStartTime;
gtConstEvalStartTime = undefined;
c._cl = 'fr';
c._cuc = 'googleTranslateElementInit';
c._cuc = 'scriptGoogleElementInit';
c._cac = '';
c._cam = '';
c._ctkk = '433074.3898829376';

View File

@ -1,4 +1,4 @@
function googleTranslateElementInit() {
function scriptGoogleElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'fr'
}, 'google_translate_element');

View File

@ -2,7 +2,5 @@
"tinymce.min.js",
"jquery.tinymce.min.js",
"init.js",
"init.css",
"plugins/codesample/js/prism.fr",
"plugins/codesample/css/prism.css"
"init.css"
]

View File

@ -104,9 +104,6 @@ tinymce.init({
images_dataimg_filter: function(img) {
return img.hasAttribute('internal-blob');
},*/
// Autorise tous les éléments
valid_elements :"*[*]",
valid_children : "*[*]",
// Autorise l'ajout de script
// extended_valid_elements: "script[language|type|src]",
// Bloque le dimensionnement des médias (car automatiquement en fullsize avec fitvids pour le responsive)

View File

@ -1,138 +0,0 @@
/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

View File

@ -87,7 +87,7 @@ class blog extends common {
public static $users = [];
const BLOG_VERSION = '3.2';
const BLOG_VERSION = '4.0';
/**
* Flux RSS
@ -103,11 +103,11 @@ class blog extends common {
$feeds = new \FeedWriter\RSS2();
// En-tête
$feeds->setTitle($this->getData (['page', $this->getUrl(0), 'posts','title']));
$feeds->setTitle($this->getData (['page', $this->getUrl(0), 'title']));
$feeds->setLink(helper::baseUrl() . $this->getUrl(0));
$feeds->setDescription(html_entity_decode(strip_tags($this->getData (['page', $this->getUrl(0), 'metaDescription']))));
$feeds->setDescription($this->getData (['page', $this->getUrl(0), 'metaDescription']));
$feeds->setChannelElement('language', 'fr-FR');
$feeds->setDate(time());
$feeds->setDate(date('r',time()));
$feeds->addGenerator();
// Corps des articles
$articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
@ -119,12 +119,25 @@ class blog extends common {
$thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']));
// Créer les articles du flux
$newsArticle = $feeds->createNewItem();
// Signature de l'article
$author = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId']));
$newsArticle->addElementArray([
'title' => strip_tags($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'title']) ),
'link' => helper::baseUrl() .$this->getUrl(0) . '/' . $articleId,
'description' => html_entity_decode(strip_tags($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'content']))),
'addEnclosure' => helper::baseUrl() . self::FILE_DIR . $thumb
'title' => $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'title']),
'link' => helper::baseUrl() .$this->getUrl(0) . '/' . $articleId,
'description' => '<img src="' . helper::baseUrl() . self::FILE_DIR . $thumb
. '" alt="' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'title'])
. '" title="' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'title'])
. '" />' .
$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'content']),
]);
$newsArticle->setAuthor($author,'no@mail.com');
$newsArticle->setId(helper::baseUrl() .$this->getUrl(0) . '/' . $articleId);
$newsArticle->setDate(date('r', $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])));
$imageData = getimagesize(helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb);
$newsArticle->addEnclosure( helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb,
$imageData[0] * $imageData[1],
$imageData['mime']
);
$feeds->addItem($newsArticle);
}
}
@ -667,62 +680,17 @@ class blog extends common {
// Liste des pages
self::$pages = $pagination['pages'];
// Signature de l'article
$userIdArticle = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']);
switch ($this->getData(['user', $userIdArticle, 'signature'])){
case 1:
self::$articleSignature = $userIdArticle;
break;
case 2:
self::$articleSignature = $this->getData(['user', $userIdArticle, 'pseudo']);
break;
case 3:
self::$articleSignature = $this->getData(['user', $userIdArticle, 'firstname']) . ' ' . $this->getData(['user', $userIdArticle, 'lastname']);
break;
case 4:
self::$articleSignature = $this->getData(['user', $userIdArticle, 'lastname']) . ' ' . $this->getData(['user', $userIdArticle, 'firstname']);
break;
default:
self::$articleSignature = $this->getData(['user', $userIdArticle, 'firstname']);
}
self::$articleSignature = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']));
// Signature du commentaire édité
if($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')) {
$useridcomment = $this->getUser('id');
switch ($this->getData(['user', $useridcomment, 'signature'])){
case 1:
self::$editCommentSignature = $useridcomment;
break;
case 2:
self::$editCommentSignature = $this->getData(['user', $useridcomment, 'pseudo']);
break;
case 3:
self::$editCommentSignature = $this->getData(['user', $useridcomment, 'firstname']) . ' ' . $this->getData(['user', $useridcomment, 'lastname']);
break;
case 4:
self::$editCommentSignature = $this->getData(['user', $useridcomment, 'lastname']) . ' ' . $this->getData(['user', $useridcomment, 'firstname']);
break;
default:
self::$editCommentSignature = $this->getData(['user', $useridcomment, 'firstname']);
}
self::$editCommentSignature = $this->signature($this->getUser('id'));
}
// Commentaires en fonction de la pagination
for($i = $pagination['first']; $i < $pagination['last']; $i++) {
// Signatures des commentaires
$e = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i],'userId']);
if ($e) {
switch ($this->getData(['user', $e, 'signature'])){
case 1:
self::$commentsSignature[$commentIds[$i]] = $e;
break;
case 2:
self::$commentsSignature[$commentIds[$i]] = $this->getData(['user', $e, 'pseudo']);
break;
case 3:
self::$commentsSignature[$commentIds[$i]] = $this->getData(['user', $e, 'firstname']) . ' ' . $this->getData(['user', $e, 'lastname']);
break;
case 4:
self::$commentsSignature[$commentIds[$i]] = $this->getData(['user', $e, 'lastname']) . ' ' . $this->getData(['user', $e, 'firstname']);
break;
}
self::$commentsSignature[$commentIds[$i]] = $this->signature($e);
} else {
self::$commentsSignature[$commentIds[$i]] = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i],'author']);
}
@ -770,5 +738,27 @@ class blog extends common {
]);
}
}
/**
* Retourne la signature d'un utilisateur
*/
private function signature($userId) {
switch ($this->getData(['user', $userId, 'signature'])){
case 1:
return $userId;
break;
case 2:
return $this->getData(['user', $userId, 'pseudo']);
break;
case 3:
return $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']);
break;
case 4:
return $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']);
break;
default:
return $this->getData(['user', $userId, 'firstname']);
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 B

After

Width:  |  Height:  |  Size: 652 B

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -46,6 +46,13 @@
.blogContent {
display: none;
}
.blogPicture img {
width: 50% ;
display: block;
margin-left: auto;
margin-right: auto;
}
}
/*

View File

@ -32,7 +32,7 @@ class form extends common {
public static $pagination;
const FORM_VERSION = '2.4';
const FORM_VERSION = '2.5';
// Objets
const TYPE_MAIL = 'mail';
@ -87,7 +87,9 @@ class form extends common {
]
]);
// Génération des données vides
$this->setData(['module', $this->getUrl(0), 'data', []]);
if ($this->getData(['module', $this->getUrl(0), 'data']) === null) {
$this->setData(['module', $this->getUrl(0), 'data', []]);
}
// Génération des champs
$inputs = [];
foreach($this->getInput('formConfigPosition', null) as $index => $position) {

View File

@ -1,11 +1,19 @@
/** @import url("site/data/admin.css"); */
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/** NE PAS EFFACER
* admin.css
*/
/*
.formConfigInput {
background: #FFF;
}
*/

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,7 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -33,7 +33,7 @@ class news extends common {
false => 'Brouillon',
true => 'Publié'
];
const NEWS_VERSION = '1.3';
const NEWS_VERSION = '2.0';
public static $users = [];
@ -53,11 +53,11 @@ class news extends common {
$feeds = new \FeedWriter\RSS2();
// En-tête
$feeds->setTitle($this->getData (['page', $this->getUrl(0),'posts','title']));
$feeds->setTitle($this->getData (['page', $this->getUrl(0),'title']));
$feeds->setLink(helper::baseUrl() . $this->getUrl(0));
$feeds->setDescription(html_entity_decode(strip_tags($this->getData (['page', $this->getUrl(0), 'metaDescription']))));
$feeds->setDescription($this->getData (['page', $this->getUrl(0), 'metaDescription']));
$feeds->setChannelElement('language', 'fr-FR');
$feeds->setDate(time());
$feeds->setDate(date('r',time()));
$feeds->addGenerator();
// Corps des articles
$newsIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
@ -67,11 +67,15 @@ class news extends common {
foreach($newsIdsPublishedOns as $newsId => $newsPublishedOn) {
if($newsPublishedOn <= time() AND $newsIdsStates[$newsId]) {
$newsArticle = $feeds->createNewItem();
$author = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'userId']));
$newsArticle->addElementArray([
'title' => strip_tags($this->getData(['module', $this->getUrl(0),'posts', $newsId, 'title']) ),
'link' => helper::baseUrl() . $this->getUrl(0),
'description' => html_entity_decode(strip_tags($this->getData(['module', $this->getUrl(0),'posts', $newsId, 'content'])))
'title' => $this->getData(['module', $this->getUrl(0),'posts', $newsId, 'title']),
'link' => helper::baseUrl() . $this->getUrl(0) . '/' . $newsId . '#' . $newsId,
'description' => $this->getData(['module', $this->getUrl(0),'posts', $newsId, 'content'])
]);
$newsArticle->setAuthor($author,'no@mail.com');
$newsArticle->setId(helper::baseUrl() .$this->getUrl(0) . '/' . $newsId . '#' . $newsId);
$newsArticle->setDate(date('r', $this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'publishedOn'])));
$feeds->addItem($newsArticle);
}
}
@ -310,4 +314,26 @@ class news extends common {
'view' => 'index'
]);
}
/**
* Retourne la signature d'un utilisateur
*/
private function signature($userId) {
switch ($this->getData(['user', $userId, 'signature'])){
case 1:
return $userId;
break;
case 2:
return $this->getData(['user', $userId, 'pseudo']);
break;
case 3:
return $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']);
break;
case 4:
return $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']);
break;
default:
return $this->getData(['user', $userId, 'firstname']);
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 B

After

Width:  |  Height:  |  Size: 652 B

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -2,7 +2,7 @@
<div class="row">
<div class="col12">
<?php foreach($module::$news as $newsId => $news): ?>
<h1 class="newsTitle">
<h1 class="newsTitle" id="<?php echo $newsId;?>">
<?php echo $news['title']; ?>
</h1>
<div class="newsContent">

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,8 +13,6 @@
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -12,9 +12,6 @@
* @link http://zwiicms.fr/
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/