Déplacer dans locale identité et choix des pages

This commit is contained in:
Fred Tempez 2020-11-21 15:09:10 +01:00
parent 6f9f447763
commit 8a7503a7c1
13 changed files with 705 additions and 610 deletions

View File

@ -147,8 +147,10 @@ class common {
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
@ -162,7 +164,8 @@ class common {
'theme' => '',
'admin' => '',
'blacklist' => '',
'translate' => ''
'translate' => '',
'locale' => ''
];
/**
@ -290,7 +293,7 @@ class common {
$this->url = $url;
}
else {
$this->url = $this->getData(['config', 'homePageId']);
$this->url = $this->getData(['locale', 'homePageId']);
}
}
@ -689,7 +692,8 @@ class common {
public function dirData($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;
@ -903,9 +907,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);
}
@ -1538,6 +1542,20 @@ class common {
}
$this->setData(['core', 'dataVersion', 10400]);
}
// Version 10.4.99
if ($this->getData(['core', 'dataVersion']) < 10499) {
$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(['locale','title'])]);
$this->setData(['core', 'dataVersion', 10499]);
}
}
}
@ -1875,7 +1893,7 @@ 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 {
@ -2143,10 +2161,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',
@ -2156,10 +2174,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',
@ -2171,18 +2189,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'])
]);
}
@ -2351,15 +2369,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

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

@ -47,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="
@ -69,7 +69,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; ?>
@ -85,7 +85,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>
@ -98,7 +98,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>
@ -123,7 +123,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; ?>
@ -145,7 +145,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>

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,
@ -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'
]);
}

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,480 @@
<?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>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('configAdvancedMaintenance', true, 'Site en maintenance', [
'checked' => $this->getData(['config', 'maintenance'])
]); ?>
</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() . 'configAdvanced/configMetaImage',
'value' => 'Capture Open Graph',
'ico' => 'pencil'
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::button('configAdvancedSiteMap', [
'href' => helper::baseUrl() . 'configAdvanced/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() . 'configAdvanced/blacklistDownload',
'value' => 'Télécharger liste noire',
'ico' => 'download'
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<?php echo template::button('configAdvancedConnectReset', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'configAdvanced/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() . 'configAdvanced/logDownload',
'value' => 'Télécharger journal',
'ico' => 'download'
]); ?>
</div>
<div class="col3">
<?php echo template::button('configAdvancedLogReset', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'configAdvanced/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() . 'configAdvanced/script/head',
'value' => 'Script dans head',
'ico' => 'pencil'
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<?php echo template::button('configAdvancedScriptBody', [
'href' => helper::baseUrl() . 'configAdvanced/script/body',
'value' => 'Script dans body',
'ico' => 'pencil'
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>

View File

@ -15,23 +15,4 @@
/** 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,25 @@
'value' => 'Accueil'
]); ?>
</div>
<div class="col2 offset4">
<?php echo template::button('configManageButton', [
'href' => helper::baseUrl() . 'config/backup',
'value' => 'Sauvegarder'
]); ?>
</div>
<div class="col2 offset2">
<?php echo template::button('configManageButton', [
'href' => helper::baseUrl() . 'config/backup',
'value' => 'Sauvegarder',
'ico' => 'download'
]); ?>
</div>
<div class="col2">
<?php echo template::button('configManageButton', [
'href' => helper::baseUrl() . 'config/manage',
'value' => 'Restaurer'
'value' => 'Restaurer',
'ico' => 'upload'
]); ?>
</div>
<div class="col2">
<?php echo template::button('configAdvancedButton', [
'href' => helper::baseUrl() . 'config/advanced',
'value' => 'Avancée',
'ico' => 'cog-alt',
]); ?>
</div>
<div class="col2">
@ -27,12 +36,12 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Informations générales</h4>
<h4>Identité du site</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 +57,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 +65,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 +89,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 +113,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 +121,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 +129,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 +137,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

@ -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

@ -194,7 +194,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',
@ -202,7 +202,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',
@ -210,7 +210,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',
@ -218,7 +218,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',
@ -226,7 +226,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',
@ -234,7 +234,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',
@ -320,8 +320,8 @@ class page extends common {
$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]);
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
@ -333,20 +333,20 @@ class page extends common {
$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(['locale', 'legalPageId']) ) {
$this->setData(['locale','legalPageId', $pageId]);
}
if ($this->getUrl(2) === $this->getData(['config', 'searchPageId']) ) {
$this->setData(['config','searchPageId', $pageId]);
if ($this->getUrl(2) === $this->getData(['locale', 'searchPageId']) ) {
$this->setData(['locale','searchPageId', $pageId]);
}
if ($this->getUrl(2) === $this->getData(['config', 'page404']) ) {
$this->setData(['config','page404', $pageId]);
if ($this->getUrl(2) === $this->getData(['locale', 'page404']) ) {
$this->setData(['locale','page404', $pageId]);
}
if ($this->getUrl(2) === $this->getData(['config', 'page403']) ) {
$this->setData(['config','page403', $pageId]);
if ($this->getUrl(2) === $this->getData(['locale', 'page403']) ) {
$this->setData(['locale','page403', $pageId]);
}
if ($this->getUrl(2) === $this->getData(['config', 'page302']) ) {
$this->setData(['config','page302', $pageId]);
if ($this->getUrl(2) === $this->getData(['locale', 'page302']) ) {
$this->setData(['locale','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;

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

@ -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
@ -653,9 +653,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>'
);