Modifications version 4.0.01

This commit is contained in:
Deltacms 2022-03-06 13:35:21 +01:00
parent 7003844b2b
commit 85dd92dd42
92 changed files with 5693 additions and 1278 deletions

View File

@ -1,5 +1,18 @@
# Changelog
## Version 4.0.01 de Deltacms
- Modifications :
- Langues : choix de langue d'origine, ce n'est plus automatiquement le français,
- Langues : choix de la langue, français ou anglais pour les pages d'administration,
- Langues : traduction automatique du site de la langue d'origine vers une langue européenne (script Google),
- Langues : traduction rédigée du site avec copie des données d'une langue vers une autre, pour préparer le travail de traduction,
- Installation : modification de la page d'installation, bilingue français anglais,
- Site exemple : modification de la page d'accueil du site après installation, bilingue.
## Version 3.2.06 de Deltacms
- Modifications :
- Traduction automatique du site pour les membres connectés.
## Version 3.2.05 de Deltacms
- Correction :
- polices : noms à la place des clefs dans les différents thèmes livrés
@ -19,7 +32,6 @@
## Version 3.1.01 de Deltacms
- Modifications :
- modification de la capture Open Graph, screenshot.jpg est maintenant générée en local sans recours à Google
- modification des polices proposées, choix de polices 'web safe', suppression des téléchargements de polices via Google
## Version 3.0.04 de Deltacms
- Modifications :

View File

@ -1,5 +1,5 @@
# DeltaCMS 3.2.05
# DeltaCMS 4.0.01
DeltaCMS est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.
@ -24,7 +24,6 @@ Pour télécharger la dernière version publiée, il faut vous rendre sur la pag
Décompressez l'archive de DeltaCMS et téléversez son contenu à la racine de votre serveur ou dans un sous-répertoire. C'est tout !
## Procédures de mise à jour
### Automatique
@ -41,10 +40,6 @@ Décompressez l'archive de DeltaCMS et téléversez son contenu à la racine de
En cas de difficulté avec la nouvelle version, il suffira de téléverser la sauvegarde pour remettre votre site dans son état initial.
**Remarques :**
* La mise à jour manuelle désactive la réécriture d'URL. À vous de la réactiver depuis la page de configuration du site.
## Arborescence générale

View File

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

View File

@ -65,6 +65,14 @@ core.colorVariants = function(rgba) {
* Crée un message de confirmation
*/
core.confirm = function(text, yesCallback, noCallback) {
var textnon = "";
var textoui = "";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'textnon = "Non"; textoui = "Oui";' ;
}
else{
echo 'textnon = "No"; textoui = "Yes";' ;
} ?>
var lightbox = lity(function($) {
return $("<div>")
.addClass("lightbox")
@ -75,7 +83,7 @@ core.confirm = function(text, yesCallback, noCallback) {
.append(
$("<a>")
.addClass("button grey")
.text("Non")
.text(textnon)
.on("click", function() {
lightbox.options('button', true);
lightbox.close();
@ -85,7 +93,7 @@ core.confirm = function(text, yesCallback, noCallback) {
}),
$("<a>")
.addClass("button")
.text("Oui")
.text(textoui)
.on("click", function() {
lightbox.options('button', true);
lightbox.close();
@ -287,9 +295,16 @@ core.start = function() {
// Mise à jour de l'affichage des champs d'upload
$(".inputFileHidden").on("change", function() {
var inputFileHiddenDOM = $(this);
var text = "";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Choisissez un fichier";' ;
}
else{
echo 'text = "Select a file";' ;
} ?>
var fileName = inputFileHiddenDOM.val();
if(fileName === "") {
fileName = "Choisissez un fichier";
fileName = text;
$(inputFileHiddenDOM).addClass("disabled");
}
else {
@ -312,8 +327,15 @@ core.start = function() {
});
});
// Confirmation de déconnexion
var text = "";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Se déconnecter ?";' ;
}
else{
echo 'text = "Logout ?";' ;
} ?>
$("#barLogout").on("click", function() {
return core.confirm("Se déconnecter ?", function() {
return core.confirm( text, function() {
$(location).attr("href", $("#barLogout").attr("href"));
});
});
@ -397,7 +419,14 @@ core.start();
*/
$("#pageDelete").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer cette page ?", function() {
var text = "";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Êtes-vous sûr de vouloir supprimer cette page ?";' ;
}
else{
echo 'text = "Are you sure you want to delete this page ?";' ;
} ?>
return core.confirm( text, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -48,8 +48,8 @@ class common {
// Numéro de version
const DELTA_UPDATE_URL = 'https://update.deltacms.fr/master/';
const DELTA_VERSION = '3.2.05';
const DELTA_UPDATE_CHANNEL = "v3";
const DELTA_VERSION = '4.0.01';
const DELTA_UPDATE_CHANNEL = "v4";
public static $actions = [];
public static $coreModuleIds = [
@ -136,17 +136,34 @@ class common {
self::GROUP_MODERATOR => 'Éditeur',
self::GROUP_ADMIN => 'Administrateur'
];
public static $groupEdits_en = [
self::GROUP_BANNED => 'Banned',
self::GROUP_MEMBER => 'Member',
self::GROUP_MODERATOR => 'Editor',
self::GROUP_ADMIN => 'Administrator'
];
public static $groupNews = [
self::GROUP_MEMBER => 'Membre',
self::GROUP_MODERATOR => 'Éditeur',
self::GROUP_ADMIN => 'Administrateur'
];
public static $groupNews_en = [
self::GROUP_MEMBER => 'Member',
self::GROUP_MODERATOR => 'Editor',
self::GROUP_ADMIN => 'Administrator'
];
public static $groupPublics = [
self::GROUP_VISITOR => 'Visiteur',
self::GROUP_MEMBER => 'Membre',
self::GROUP_MODERATOR => 'Éditeur',
self::GROUP_ADMIN => 'Administrateur'
];
public static $groupPublics_en = [
self::GROUP_VISITOR => 'Visitor',
self::GROUP_MEMBER => 'Member',
self::GROUP_MODERATOR => 'Editor',
self::GROUP_ADMIN => 'Administrator'
];
// Langues proposées
public static $i18nList = [
'fr' => 'Français (fr)',
@ -155,7 +172,16 @@ class common {
'es' => 'Espagnol (es)',
'it' => 'Italien (it)',
'nl' => 'Néerlandais (nl)',
'pt' => 'Portugais (pt)',
'pt' => 'Portugais (pt)'
];
public static $i18nList_en = [
'fr' => 'French (fr)',
'de' => 'German (de)',
'en' => 'English (en)',
'es' => 'Spanish (es)',
'it' => 'Italian (it)',
'nl' => 'Dutch (nl)',
'pt' => 'Portuguese (pt)'
];
// Langue courante
public static $i18n;
@ -178,7 +204,6 @@ class common {
'page' => '',
'module' => '',
'core' => '',
'page' => '',
'user' => '',
'theme' => '',
'admin' => '',
@ -207,7 +232,7 @@ class common {
setlocale (LC_TIME, self::$i18n . '_' . strtoupper (self::$i18n) );
} else {
self::$i18n = 'fr';
self::$i18n = 'base';
}
// Instanciation de la classe des entrées / sorties
@ -223,7 +248,7 @@ class common {
// Installation fraîche, initialisation des modules manquants
// La langue d'installation par défaut est fr
// La langue d'installation par défaut est base
foreach ($this->dataFiles as $stageId => $item) {
$folder = $this->dataPath ($stageId, self::$i18n);
if (file_exists($folder . $stageId .'.json') === false) {
@ -257,12 +282,12 @@ class common {
* la traduction est celle de la langue du drapeau
* */
if ( $this->getInput('DELTA_I18N_SCRIPT') !== substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2 ) ) {
setrawcookie('googtrans', '/fr/'.substr( $_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2 ), time() + 3600, helper::baseUrl(false, false));
setrawcookie('googtrans', '/base/'.substr( $_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2 ), time() + 3600, helper::baseUrl(false, false));
} else {
// Langue du drapeau si elle est définie
if ( $this->getInput('DELTA_I18N_SCRIPT') !== '' ) {
// Paramètre du script
setrawcookie("googtrans", '/fr/'. $this->getInput('DELTA_I18N_SCRIPT') , time() + 3600, helper::baseUrl(false,false));
setrawcookie("googtrans", '/base/'. $this->getInput('DELTA_I18N_SCRIPT') , time() + 3600, helper::baseUrl(false,false));
}
}
}
@ -559,7 +584,7 @@ class common {
* @param array $module : nom du module à générer
* choix valides : core config user theme page module
*/
public function initData($module, $lang = 'fr', $sampleSite = false) {
public function initData($module, $lang = 'base', $sampleSite = false) {
// Tableau avec les données vierges
require_once('core/module/install/ressource/defaultdata.php');
@ -734,56 +759,6 @@ class common {
return ($this->checkCSRF() AND $this->input['_POST'] !== []);
}
/**
* Import des données de la version 9
* Convertit un fichier de données data.json puis le renomme
*/
public function importData($keepUsers = false) {
// Trois tentatives de lecture
for($i = 0; $i < 3; $i++) {
$tempData=json_decode(file_get_contents(self::DATA_DIR.'core.json'), true);
$tempTheme=json_decode(file_get_contents(self::DATA_DIR.'theme.json'), true);
if($tempData && $tempTheme) {
// Backup
rename (self::DATA_DIR.'core.json',self::DATA_DIR.'imported_core.json');
rename (self::DATA_DIR.'theme.json',self::DATA_DIR.'imported_theme.json');
break;
}
elseif($i === 2) {
throw new \ErrorException('Import des données impossible.');
}
// Pause de 10 millisecondes
usleep(10000);
}
// Dossier de langues
if (!file_exists(self::DATA_DIR . '/fr')) {
mkdir (self::DATA_DIR . '/fr', 0755);
}
// Un seul fichier pour éviter les erreurs de sauvegarde des v9
$tempData = array_merge($tempData,$tempTheme);
// Ecriture des données
$this->setData(['config',$tempData['config']]);
$this->setData(['core',$tempData['core']]);
$this->setData(['page',$tempData['page']]);
$this->setData(['module',$tempData['module']]);
$this->setData(['theme',$tempData['theme']]);
$this->setData(['fonts',$tempData['fonts']]);
// Import des users sauvegardés si option active
if ($keepUsers === false
AND $tempData['user'] !== NULL) {
$this->setData(['user',$tempData['user']]);
}
// Nettoyage du fichier de thème pour forcer une régénération
if (file_exists(self::DATA_DIR . '/theme.css')) { // On ne sait jamais
unlink (self::DATA_DIR . '/theme.css');
}
}
/**
* Génère un fichier json avec la liste des pages
@ -1906,16 +1881,29 @@ class common {
* Affiche la notification
*/
public function showNotification() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Impossible de soumettre le formulaire, car il contient des erreurs';
$text[1] = 'Données absentes, restauration de ';
break;
case 'en' :
$text[0] = 'Unable to submit the form as it contains errors';
$text[1] = 'Missing data, restoration of ';
break;
}
if (common::$importNotices) {
$notification = common::$importNotices [0];
$notificationClass = 'notificationSuccess';
}
if(common::$inputNotices) {
$notification = 'Impossible de soumettre le formulaire, car il contient des erreurs';
$notification = $text[0];
$notificationClass = 'notificationError';
}
if (common::$coreNotices) {
$notification = 'Données absentes, restauration de <p> | ';
$notification = $text[1].'<p> | ';
foreach (common::$coreNotices as $item) $notification .= $item . ' | ';
$notificationClass = 'notificationError';
}
@ -1943,20 +1931,65 @@ class common {
* Affiche la barre de membre
*/
public function showBar() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Choisissez une page';
$text[1] = 'Pages orphelines';
$text[2] = 'Pages du menu';
$text[3] = 'Barres latérales';
$text[4] = 'Créer une page ou<br>une barre latérale';
$text[5] = 'Modifier la page';
$text[6] = 'Configurer le module';
$text[7] = 'Dupliquer la page';
$text[8] = 'Effacer la page';
$text[9] = 'Gérer les fichiers';
$text[10] = 'Personnaliser les thèmes';
$text[11] = 'Gérer les modules';
$text[12] = 'Gestion des langues';
$text[13] = 'Configurer le site';
$text[14] = 'Configurer les utilisateurs';
$text[15] = 'Mettre à jour DeltaCMS ';
$text[16] = 'Configurer mon compte';
$text[17] = 'Me déconnecter';
break;
case 'en' :
$text[0] = 'Choose a page';
$text[1] = 'Orphan pages';
$text[2] = 'Menu pages';
$text[3] = 'Side bars';
$text[4] = 'Creating a page<br>or a sidebar';
$text[5] = 'Modify the page';
$text[6] = 'Configuring the module';
$text[7] = 'Duplicate the page';
$text[8] = 'Erase the page';
$text[9] = 'Managing files';
$text[10] = 'Customise themes';
$text[11] = 'Manage modules';
$text[12] = 'Language management';
$text[13] = 'Configuring the site';
$text[14] = 'Setting up users';
$text[15] = 'Updating DeltaCMS ';
$text[16] = 'Set up my account';
$text[17] = 'Logout';
break;
}
if($this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD')) {
// Items de gauche
$leftItems = '';
if($this->getUser('group') >= self::GROUP_MODERATOR) {
$leftItems .= '<li><select id="barSelectPage">';
$leftItems .= '<option value="">Choisissez une page</option>';
$leftItems .= '<optgroup label="Pages orphelines">';
$leftItems .= '<option value="">'.$text[0].'</option>';
$leftItems .= '<optgroup label="'.$text[1].'">';
$orpheline = true ;
$currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2);
foreach($this->getHierarchy(null,false) as $parentPageId => $childrenPageIds) {
if ($this->getData(['page', $parentPageId, 'position']) !== 0 &&
$orpheline ) {
$orpheline = false;
$leftItems .= '<optgroup label="Pages du menu">';
$leftItems .= '<optgroup label="'.$text[2].'">';
}
// Exclure les barres
if ($this->getData(['page', $parentPageId, 'block']) !== 'bar') {
@ -1986,7 +2019,7 @@ class common {
}
$leftItems .= '</optgroup'>
// Afficher les barres
$leftItems .= '<optgroup label="Barres latérales">';
$leftItems .= '<optgroup label="'.$text[3].'">';
foreach($this->getHierarchy(null, false,true) as $parentPageId => $childrenPageIds) {
$leftItems .= '<option value="' . helper::baseUrl() . $parentPageId . '"' . ($parentPageId === $currentPageId ? ' selected' : false) . '>' . $this->getData(['page', $parentPageId, 'shortTitle']) . '</option>';
foreach($childrenPageIds as $childKey) {
@ -1995,7 +2028,7 @@ class common {
}
$leftItems .= '</optgroup>';
$leftItems .= '</select></li>';
$leftItems .= '<li><a href="' . helper::baseUrl() . 'page/add" data-tippy-content="Créer une page ou<br>une barre latérale">' . template::ico('plus') . '</a></li>';
$leftItems .= '<li><a href="' . helper::baseUrl() . 'page/add" data-tippy-content="'.$text[4] .'"'. template::ico('plus') . '</a></li>';
if(
// Sur un module de page qui autorise le bouton de modification de la page
$this->output['showBarEditButton']
@ -2004,27 +2037,27 @@ class common {
// Sur une page d'accueil
OR $this->getUrl(0) === ''
) {
$leftItems .= '<li><a href="' . helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '" data-tippy-content="Modifier la page">' . template::ico('pencil') . '</a></li>';
$leftItems .= '<li><a href="' . helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '" data-tippy-content="'.$text[5].'">' . template::ico('pencil') . '</a></li>';
if ($this->getData(['page', $this->getUrl(0),'moduleId'])) {
$leftItems .= '<li><a href="' . helper::baseUrl() . $this->getUrl(0) . '/config' . '" data-tippy-content="Configurer le module">' . template::ico('gear') . '</a></li>';
$leftItems .= '<li><a href="' . helper::baseUrl() . $this->getUrl(0) . '/config' . '" data-tippy-content="'.$text[6].'">' . template::ico('gear') . '</a></li>';
}
$leftItems .= '<li><a id="pageDuplicate" href="' . helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'] . '" data-tippy-content="Dupliquer la page">' . template::ico('clone') . '</a></li>';
$leftItems .= '<li><a id="pageDelete" href="' . helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'] . '" data-tippy-content="Effacer la page">' . template::ico('trash') . '</a></li>';
$leftItems .= '<li><a id="pageDuplicate" href="' . helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'] . '" data-tippy-content="'.$text[7].'">' . template::ico('clone') . '</a></li>';
$leftItems .= '<li><a id="pageDelete" href="' . helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'] . '" data-tippy-content="'.$text[8].'">' . template::ico('trash') . '</a></li>';
}
}
// Items de droite
$rightItems = '';
if($this->getUser('group') >= self::GROUP_MODERATOR) {
$rightItems .= '<li><a href="' . helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR.'core.json') .'" data-tippy-content="Gérer les fichiers" data-lity>' . template::ico('folder') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR.'core.json') .'" data-tippy-content="'.$text[9] .'" data-lity>' . template::ico('folder') . '</a></li>';
}
if($this->getUser('group') >= self::GROUP_ADMIN) {
$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() . 'addon" data-tippy-content="Gérer les modules">' . template::ico('puzzle') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'theme" data-tippy-content="'.$text[10] .'">' . template::ico('brush') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'addon" data-tippy-content="'.$text[11].'">' . template::ico('puzzle') . '</a></li>';
if ($this->getData(['config', 'i18n', 'enable']) === true) {
$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="'.$text[12].'">' . template::ico('flag') . '</a></li>';
}
$rightItems .= '<li><a href="' . helper::baseUrl() . 'config" data-tippy-content="Configurer le site">' . template::ico('cog-alt') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'user" data-tippy-content="Configurer les utilisateurs">' . template::ico('users') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'config" data-tippy-content="'.$text[13].'">' . template::ico('cog-alt') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'user" data-tippy-content="'.$text[14].'">' . template::ico('users') . '</a></li>';
// Mise à jour automatique
$today = time();
// Une mise à jour est disponible + recherche auto activée + 1 jour de délai
@ -2038,13 +2071,13 @@ class common {
// Afficher le bouton : Mise à jour détectée + activée
if ( $this->getData(['core','updateAvailable']) === true &&
$this->getData(['config','autoUpdate']) === true ) {
$rightItems .= '<li><a id="barUpdate" href="' . helper::baseUrl() . 'install/update" data-tippy-content="Mettre à jour DeltaCMS '. common::DELTA_VERSION .' vers '. helper::getOnlineVersion(common::DELTA_UPDATE_CHANNEL) .'">' . template::ico('update colorRed') . '</a></li>';
$rightItems .= '<li><a id="barUpdate" href="' . helper::baseUrl() . 'install/update" data-tippy-content="'.$text[15]. common::DELTA_VERSION .' vers '. helper::getOnlineVersion(common::DELTA_UPDATE_CHANNEL) .'">' . template::ico('update colorRed') . '</a></li>';
}
}
if($this->getUser('group') >= self::GROUP_MODERATOR) {
$rightItems .= '<li><a href="' . helper::baseUrl() . 'user/edit/' . $this->getUser('id'). '/' . $_SESSION['csrf'] . '" data-tippy-content="Configurer mon compte">' . template::ico('user', 'right') . '<span id="displayUsername">' . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '</span></a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'user/edit/' . $this->getUser('id'). '/' . $_SESSION['csrf'] . '" data-tippy-content="'.$text[16].'">' . template::ico('user', 'right') . '<span id="displayUsername">' . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '</span></a></li>';
}
$rightItems .= '<li><a id="barLogout" href="' . helper::baseUrl() . 'user/logout" data-tippy-content="Me déconnecter">' . template::ico('logout') . '</a></li>';
$rightItems .= '<li><a id="barLogout" href="' . helper::baseUrl() . 'user/logout" data-tippy-content="'.$text[17].'">' . template::ico('logout') . '</a></li>';
// Barre de membre
echo '<div id="bar"><div class="container"><ul id="barLeft">' . $leftItems . '</ul><ul id="barRight">' . $rightItems . '</ul></div></div>';
}
@ -2138,7 +2171,8 @@ class common {
// Le drapeau n'est pas actif pour les non admin en mode connecté.
AND
( $this->getUser('password') !== $this->getInput('DELTA_USER_PASSWORD')
OR $this->getUser('group') === self::GROUP_ADMIN )
OR $this->getUser('group') === self::GROUP_ADMIN
OR $this->getUser('group') === self::GROUP_MEMBER)
)
) {
if (
@ -2916,7 +2950,8 @@ class core extends common {
AND $this->getUrl(1) !== 'login'
// Ou connecté avec option active
OR ($this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD')
AND $this->getData(['config', 'i18n','admin']) === true
//AND $this->getData(['config', 'i18n','admin']) === true
AND $this->getUser('group') === self::GROUP_MEMBER
)
) {

View File

@ -10,9 +10,19 @@ if ($this->getData(['core', 'dataVersion']) < 3202) {
if (file_exists(self::DATA_DIR . '/theme.css')) unlink (self::DATA_DIR . '/theme.css');
$this->setData(['core', 'dataVersion', 3202]);
}
if ($this->getData(['core', 'dataVersion']) < 3205) {
if ($this->getData(['core', 'dataVersion']) < 3206) {
// Mise à jour
$this->setData(['core', 'dataVersion', 3205]);
$this->setData(['core', 'dataVersion', 3206]);
}
if ($this->getData(['core', 'dataVersion']) < 4001) {
$this->setData(['config', 'i18n', 'langAdmin', 'fr']);
$this->setData(['config', 'i18n', 'langBase', 'fr']);
// Copie le contenu de site/data/fr vers site/data/base puis supprime site/data/fr
if( is_dir('./site/data/fr/') ){
$this->copyDir('./site/data/fr/', './site/data/base/');
$this->removeDir('./site/data/fr/');
}
// Mise à jour
$this->setData(['core', 'dataVersion', 4001]);
}
?>

View File

@ -48,6 +48,24 @@ class addon extends common {
* Effacement d'un module installé et non utilisé
*/
public function delete() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Action non autorisée';
$text[1] = ' désinstallé';
$text[2] = ' désinstallé, il reste des données dans ';
$text[3] = 'La suppression a échouée';
break;
case 'en' :
$text[0] = 'Unauthorised action';
$text[1] = ' uninstalled';
$text[2] = ' uninstalled, there is data left in ';
$text[3] = 'Deletion failed';
break;
}
// Jeton incorrect
if ($this->getUrl(3) !== $_SESSION['csrf']) {
@ -55,7 +73,7 @@ class addon extends common {
$this->addOutput([
'redirect' => helper::baseUrl() . 'addon',
'state' => false,
'notification' => 'Action non autorisée'
'notification' => $text[0]
]);
}
else{
@ -65,16 +83,16 @@ class addon extends common {
//Liste des dossiers associés au module non effacés
if( $this->removeDir('./module/'.$module ) === true ){
$success = true;
$notification = 'Module '. $module .' désinstallé';
$notification = 'Module '. $module .$text[1];
if( is_dir($infoModules[$this->getUrl(2)]['dataDirectory']) ) {
if (!$this->removeDir($infoModules[$this->getUrl(2)]['dataDirectory'])){
$notification = 'Module '.$module .' désinstallé, il reste des données dans ' . $infoModules[$this->getUrl(2)]['dataDirectory'];
$notification = 'Module '.$module .$text[2] . $infoModules[$this->getUrl(2)]['dataDirectory'];
}
}
}
else{
$success = false;
$notification = 'La suppression a échouée';
$notification = $text[3];
}
// Valeurs en sortie
$this->addOutput([
@ -90,6 +108,35 @@ class addon extends common {
* Fonction utilisée par upload et storeUpload
*/
private function install ($moduleName, $checkValid){
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Ce n\'est pas l\'archive d\'un module !';
$text[1] = ' installé';
$text[2] = ' mis à jour';
$text[3] = 'Module ';
$text[4] = ' Version détectée ';
$text[5] = ' = à celle installée ';
$text[6] = ' < à celle installée ';
$text[7] = ' Mise à jour par ce procédé interdite par le concepteur du module';
$text[8] = ' Mise à jour par ce procédé interdite, votre version est trop ancienne';
$text[9] = 'Impossible d\'ouvrir l\'archive';
break;
case 'en' :
$text[0] = 'This is not the archive of a module !';
$text[1] = ' installed';
$text[2] = ' updated';
$text[3] = 'Module ';
$text[4] = ' Detected version ';
$text[5] = ' = to that installed ';
$text[6] = ' < to that installed ';
$text[7] = ' Updating by this process prohibited by the module designer';
$text[8] = ' Updating by this process is not allowed, your version is too old';
$text[9] = 'Unable to open the archive';
break;
}
$tempFolder = 'datamodules';//uniqid();
$zip = new ZipArchive();
if ($zip->open($moduleName) === TRUE) {
@ -98,7 +145,7 @@ class addon extends common {
$zip->extractTo(self::TEMP_DIR . $tempFolder );
// Archive de module ?
$success = false;
$notification = 'Ce n\'est pas l\'archive d\'un module !';
$notification = $text[0];
$moduleDir = self::TEMP_DIR . $tempFolder . '/module';
$moduleName = '';
if ( is_dir( $moduleDir )) {
@ -160,26 +207,26 @@ class addon extends common {
$this->copyDir( self::TEMP_DIR . $tempFolder, './' );
$success = true;
if( ! $moduleInstal ){
$notification = 'Module '.$moduleName.' installé';
$notification = $text[3].$moduleName. $text[1];
}
else{
$notification = 'Module '.$moduleName.' mis à jour';
$notification = $text[3].$moduleName. $text[2];
}
}
else{
$success = false;
if( $valNewVersion == $valInstalVersion){
$notification = ' Version détectée '.$version.' = à celle installée '.$infoModules[$moduleName]['version'];
$notification = $text[4].$version.$text[5].$infoModules[$moduleName]['version'];
}
else{
$notification = ' Version détectée '.$version.' < à celle installée '.$infoModules[$moduleName]['version'];
$notification = $text[4].$version.$text[6].$infoModules[$moduleName]['version'];
}
if( $valUpdate === false){
if( $infoModules[$moduleName]['update'] === $update ){
$notification = ' Mise à jour par ce procédé interdite par le concepteur du module';
$notification = $text[7];
}
else{
$notification = ' Mise à jour par ce procédé interdite, votre version est trop ancienne';
$notification = $text[8];
}
}
}
@ -191,7 +238,7 @@ class addon extends common {
} else {
// erreur à l'ouverture
$success = false;
$notification = 'Impossible d\'ouvrir l\'archive';
$notification = $text[9];
}
return(['success' => $success,
'notification'=> $notification
@ -202,6 +249,18 @@ class addon extends common {
* Installation d'un module à partir du gestionnaire de fichier
*/
public function upload() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Installer un module';
break;
case 'en' :
$text[0] = 'Installing a module';
break;
}
// Soumission du formulaire
if($this->isPost()) {
// Installation d'un module
@ -222,7 +281,7 @@ class addon extends common {
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Installer un module',
'title' => $text[0],
'view' => 'upload'
]);
}
@ -353,6 +412,18 @@ class addon extends common {
* Gestion des modules
*/
public function index() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Gestion des modules';
break;
case 'en' :
$text[0] = 'Module management';
break;
}
// Lister les modules
// $infoModules[nom_module]['realName'], ['version'], ['update'], ['delete'], ['dataDirectory']
@ -397,7 +468,7 @@ class addon extends common {
// Valeurs en sortie
$this->addOutput([
'title' => 'Gestion des modules',
'title' => $text[0],
'view' => 'index'
]);
}
@ -406,13 +477,26 @@ class addon extends common {
* Export des données d'un module externes ou interne à module.json
*/
public function export(){
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Action non autorisée';
$text[1] = 'Quelque chose s\'est mal passé';
break;
case 'en' :
$text[0] = 'Unauthorised action';
$text[1] = 'Something went wrong';
break;
}
// Jeton incorrect
if ($this->getUrl(3) !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'addon',
'state' => false,
'notification' => 'Action non autorisée'
'notification' => $text[0]
]);
}
else {
@ -433,18 +517,18 @@ class addon extends common {
// Export du contenu de la page
//$pageContent[$pageId] = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $pageId, 'content']));
$pageContent[$pageId] = $this->getPage($pageId, self::$i18n);
// Export de fr/module.json
$moduleId = 'fr/module.json';
// Export de base/module.json
$moduleId = 'base/module.json';
$moduleDir = str_replace('site/data/','',$infoModules[$this->getUrl(2)]['dataDirectory']);
// Création de l'arborescence des langues
// Pas de nom dossier de langue - dossier par défaut
$t = explode ('/',$moduleId);
if ( is_array($t)) {
$lang = 'fr';
$lang = 'base';
} else {
$lang = $t[0];
}
// Créer le dossier temporaire si inexistant sinon le nettoie et le créer
// Créer le dossier temporaire si inexistant sinon le nettoyer et le créer
if (!is_dir($tmpFolder . '/' . $lang)) {
mkdir ($tmpFolder . '/' . $lang, 0755, true);
} else {
@ -492,7 +576,7 @@ class addon extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'addon',
'notification' => 'Quelque chose s\'est mal passé',
'notification' => $text[1],
'state' => false
]);
}
@ -503,13 +587,32 @@ class addon extends common {
* Importer des données d'un module externes ou interne à module.json
*/
public function import(){
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Action non autorisée';
$text[1] = 'Import impossible la page suivante doit être renommée :';
$text[2] = 'Import impossible les pages suivantes doivent être renommées :';
$text[3] = 'Import réussi';
$text[4] = 'Importer des données de module';
break;
case 'en' :
$text[0] = 'Unauthorised action';
$text[1] = 'Impossible import the following page should be renamed :';
$text[2] = 'Import impossible the following pages should be renamed:';
$text[3] = 'Successful import';
$text[4] = 'Importing module data';
break;
}
// Jeton incorrect
if ($this->getUrl(3) !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'addon',
'state' => false,
'notification' => 'Action non autorisée'
'notification' => $text[0]
]);
}
else {
@ -529,7 +632,10 @@ class addon extends common {
$dataSource = array();
// Liste des pages de même nom dans l'archive et le site
$list = '';
foreach (self::$i18nList as $key=>$value) {
// Tableau des langues avec langue originale
$origin = ['base'=>'Langue originale'];
$i18nListComplet = array_merge( self::$i18nList, $origin);
foreach ($i18nListComplet as $key=>$value) {
// Les Pages et les modules
foreach (['page','module'] as $fileTarget){
if (file_exists(self::TEMP_DIR . $tempFolder . '/' .$key . '/' . $fileTarget . '.json')) {
@ -567,11 +673,11 @@ class addon extends common {
$zip->close();
if( $list !== '' ){
$success = false;
strpos( $list, ',') === false ? $notification = 'Import impossible la page suivante doit être renommée :'.$list : $notification = 'Import impossible les pages suivantes doivent être renommées :'.$list;
strpos( $list, ',') === false ? $notification = $text[1].$list : $notification = $text[2].$list;
}
else{
$success = true;
$notification = 'Import réussi';
$notification = $text[3];
}
// Valeurs en sortie
$this->addOutput([
@ -582,7 +688,7 @@ class addon extends common {
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Importer des données de module',
'title' => $text[4],
'view' => 'import'
]);
}

View File

@ -1,3 +1,22 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Appliquer';
$text[2] = 'Archive ZIP :';
$text[3] = 'Installer des données de module';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Apply';
$text[2] = 'Archive ZIP :';
$text[3] = 'Installing module data';
break;
}
?>
<?php echo template::formOpen('addonImportForm'); ?>
<div class="row">
<div class="col2">
@ -5,23 +24,23 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'addon',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('addonImportSubmit', [
'value' => 'Appliquer'
'value' => $text[1]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Installer des données de module</h4>
<h4><?php echo $text[3]; ?></h4>
<div class="row">
<div class="col6 offset3">
<?php echo template::file('addonImportFile', [
'label' => 'Archive ZIP :',
'label' => $text[2],
'type' => 2
]); ?>
</div>

View File

@ -19,7 +19,14 @@
*/
$(".moduleDelete").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer ce module ?", function() {
var text = "";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Êtes-vous sûr de vouloir supprimer ce module ?";' ;
}
else{
echo 'text = "Are you sure you want to delete this module ?";' ;
} ?>
return core.confirm( text, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -1,10 +1,43 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Installer un module';
$text[3] = 'Module installé';
$text[4] = 'Alias';
$text[5] = 'Version';
$text[6] = 'Page(s)';
$text[7] = 'Supprimer';
$text[8] = 'Exporter';
$text[9] = 'Importer';
$text[10] = 'Aucun module installé.';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Installing a module';
$text[3] = 'Installed module';
$text[4] = 'Alias';
$text[5] = 'Version';
$text[6] = 'Page(s)';
$text[7] = 'Delete';
$text[8] = 'Export';
$text[9] = 'Import';
$text[10] = 'No module installed.';
break;
}
?>
<div class="row">
<div class="col2">
<?php echo template::button('configModulesBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl(),
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -12,20 +45,20 @@
'href' => 'https://doc.deltacms.fr/gestion-des-modules',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::button('configStoreUpload', [
'href' => helper::baseUrl() . 'addon/upload',
'value' => 'Installer un module'
'value' => $text[2]
]); ?>
</div>
</div>
<?php if($module::$modInstal): ?>
<?php echo template::table([2, 2, 2, 2, 1, 1, 1], $module::$modInstal, ['Module installé', 'Alias', 'Version', 'Page(s)', 'Supprimer', 'Exporter', 'Importer']); ?>
<?php echo template::table([2, 2, 2, 2, 1, 1, 1], $module::$modInstal, [$text[3], $text[4], $text[5], $text[6], $text[7], $text[8], $text[9]]); ?>
<?php else: ?>
<?php echo template::speech('Aucun module installé.'); ?>
<?php echo template::speech($text[10]); ?>
<?php endif; ?>

View File

@ -1,3 +1,28 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Valider';
$text[3] = 'Archive ZIP :';
$text[4] = 'Permet de forcer une mise à jour même si la version du module est inférieure ou égale à celle du module installé.';
$text[5] = 'Mise à jour forcée';
$text[6] = 'Installer ou mettre à jour un module téléchargé';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Validate';
$text[3] = 'Archive ZIP :';
$text[4] = 'Allows you to force an update even if the version of the module is less than or equal to that of the installed module.';
$text[5] = 'Forced update';
$text[6] = 'Install or update a downloaded module';
break;
}
?>
<?php echo template::formOpen('configModulesUpload'); ?>
<div class="row">
<div class="col2">
@ -5,7 +30,7 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'addon',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -14,7 +39,7 @@
'target' => '_blank',
'class' => 'buttonHelp',
'ico' => 'help',
'value' => 'Aide'
'value' => $text[1]
]); ?>
</div>
<!-- Catalogue en ligne hors service
@ -27,7 +52,7 @@
-->
<div class="col2 offset6">
<?php echo template::submit('configModulesSubmit',[
'value' => 'Valider',
'value' => $text[2],
'ico' => 'check'
]); ?>
</div>
@ -35,20 +60,20 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Installer ou mettre à jour un module téléchargé </h4>
<h4><?php echo $text[6]; ?> </h4>
<div class="row">
<div class="col6 offset3">
<?php echo template::file('configModulesInstallation', [
'label' => 'Archive ZIP :',
'label' => $text[3],
'type' => 2
]); ?>
</div>
</div>
<div class="row">
<div class="col4 offset3">
<?php echo template::checkbox('configModulesCheck', true, 'Mise à jour forcée', [
<?php echo template::checkbox('configModulesCheck', true, $text[5], [
'checked' => false,
'help' => 'Permet de forcer une mise à jour même si la version du module est inférieure ou égale à celle du module installé.',
'help' => $text[4],
]); ?>
</div>
</div>

View File

@ -159,12 +159,23 @@ class config extends common {
true => 'Oui',
false => 'Non'
];
// Authentification SMTP EN
public static $SMTPauth_en = [
true => 'Yes',
false => 'No'
];
// Encryptation SMTP
public static $SMTPEnc = [
'' => 'Aucune',
'tls' => 'START TLS',
'ssl' => 'SSL/TLS'
];
// Encryptation SMTP EN
public static $SMTPEnc_en = [
'' => 'None',
'tls' => 'START TLS',
'ssl' => 'SSL/TLS'
];
// Sécurité de la connexion - tentative max avant blocage
public static $connectAttempt = [
999 => 'Sécurité désactivée',
@ -172,6 +183,13 @@ class config extends common {
5 => '5 tentatives',
10 => '10 tentatives'
];
// Sécurité de la connexion - tentative max avant blocage EN
public static $connectAttempt_en = [
999 => 'Security disabled',
3 => '3 attempts',
5 => '5 attempts',
10 => '10 attempts'
];
// Sécurité de la connexion - durée du blocage
public static $connectTimeout = [
0 => 'Sécurité désactivée',
@ -179,18 +197,35 @@ class config extends common {
600 => '10 minutes',
900 => '15 minutes'
];
// Sécurité de la connexion - durée du blocage EN
public static $connectTimeout_en = [
0 => 'Safety off',
300 => '5 minutes',
600 => '10 minutes',
900 => '15 minutes'
];
// Anonymisation des IP du journal
public static $anonIP = [
4 => 'Non tronquées',
3 => 'Niveau 1 (192.168.12.x)',
2 => 'Niveau 2 (192.168.x.x)',
1 => 'Niveau 3 (192.x.x.x)',
1 => 'Niveau 3 (192.x.x.x)'
];
// Anonymisation des IP du journal EN
public static $anonIP_en = [
4 => 'Not truncated',
3 => 'Level 1 (192.168.12.x)',
2 => 'Level 2 (192.168.x.x)',
1 => 'Level 3 (192.x.x.x)'
];
public static $captchaTypes = [
'num' => 'Chiffres',
'alpha' => 'Lettres'
];
public static $captchaTypes_en = [
'num' => 'Numbers',
'alpha' => 'Letters'
];
// Langue traduite courante
public static $i18nSite = 'fr';
@ -204,7 +239,19 @@ class config extends common {
* Robots.txt
*/
public function generateFiles() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Mises à jour des fichiers sitemap et robots.txt';
$text[1] = 'Echec d\'écriture, le site map n\'a pas été mis à jour';
break;
case 'en' :
$text[0] = 'Updated sitemap and robots.txt files';
$text[1] = 'Writing failure, site map not updated';
break;
}
// Mettre à jour le site map
$successSitemap=$this->createSitemap();
@ -213,7 +260,7 @@ class config extends common {
/*'title' => 'Configuration',
'view' => 'index',*/
'redirect' => helper::baseUrl() . 'config',
'notification' => $successSitemap ? 'Mises à jour des fichiers sitemap et robots.txt' : 'Echec d\'écriture, le site map n\'a pas été mis à jour',
'notification' => $successSitemap ? $text[0] : $text[1],
'state' => $successSitemap
]);
}
@ -223,6 +270,17 @@ class config extends common {
* Sauvegarde des données
*/
public function backup() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Sauvegarder';
break;
case 'en' :
$text[0] = 'Save';
break;
}
// Soumission du formulaire
if($this->isPost()) {
// Creation du ZIP
@ -244,7 +302,7 @@ class config extends common {
} else {
// Valeurs en sortie
$this->addOutput([
'title' => 'Sauvegarder',
'title' => $text[0],
'view' => 'backup'
]);
}
@ -254,15 +312,28 @@ class config extends common {
* Active ou désactive le mode Open Graph
*/
public function configOpenGraph() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Mode de capture Opengraph désactivé';
$text[1] = 'Mode de capture Opengraph activé';
break;
case 'en' :
$text[0] = 'Opengraph capture mode disabled';
$text[1] = 'Opengraph capture mode enabled';
break;
}
$texte='';
if( $_SESSION['screenshot'] === 'on'){
$_SESSION['screenshot'] = 'off';
$texte = 'Mode de capture Opengraph désactivé';
$texte = $text[0];
if( file_exists('./screenshot.php')) unlink ('./screenshot.php');
}
else{
$_SESSION['screenshot'] = 'on';
$texte = 'Mode de capture Opengraph activé';
$texte = $text[1];
if( !file_exists('./screenshot.php')) copy('./core/vendor/screenshot/screenshot.php','./screenshot.php');
}
// Valeurs en sortie
@ -277,6 +348,27 @@ class config extends common {
* Procédure d'importation
*/
public function restore() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Restaurer';
$text[1] = 'Le fichier n\'est pas une archive valide';
$text[2] = 'Impossible de lire l\'archive';
$text[3] = 'Cette archive n\'est pas une sauvegarde valide';
$text[4] = 'Restauration effectuée avec succès';
$text[5] = 'Erreur inconnue';
break;
case 'en' :
$text[0] = 'Restore';
$text[1] = 'The file is not a valid archive';
$text[2] = 'Unable to read the archive';
$text[3] = 'This archive is not a valid backup';
$text[4] = 'Restoration completed successfully';
$text[5] = 'Unknown error';
break;
}
// Soumission du formulaire
if($this->isPost() ) {
@ -291,9 +383,9 @@ class config extends common {
if ($file_parts['extension'] !== 'zip') {
// Valeurs en sortie erreur
$this->addOutput([
'title' => 'Restaurer',
'title' => $text[0],
'view' => 'restore',
'notification' => 'Le fichier n\'est pas une archive valide',
'notification' => $text[1],
'state' => false
]);
}
@ -301,9 +393,9 @@ class config extends common {
if ($successOpen === FALSE) {
// Valeurs en sortie erreur
$this->addOutput([
'title' => 'Restaurer',
'title' => $text[0],
'view' => 'restore',
'notification' => 'Impossible de lire l\'archive',
'notification' => $text[2],
'state' => false
]);
}
@ -344,9 +436,9 @@ class config extends common {
} elseif ($version === 0) { // Version invalide
// Valeurs en sortie erreur
$this->addOutput([
'title' => 'Restaurer',
'title' => $text[0],
'view' => 'restore',
'notification' => 'Cette archive n\'est pas une sauvegarde valide',
'notification' => $text[3],
'state' => false
]);
}
@ -370,11 +462,11 @@ class config extends common {
}
}
// Message de notification
$notification = $success === true ? 'Restaurer effectuée avec succès' : 'Erreur inconnue';
$notification = $success === true ? $text[4] : $text[5] ;
$redirect = $this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN) === true ? helper::baseUrl() . 'config/restore' : helper::baseUrl() . 'user/login/';
// Valeurs en sortie erreur
$this->addOutput([
/*'title' => 'Restaurer',
/*'title' => $text[0],
'view' => 'restore',*/
'redirect' => $redirect,
'notification' => $notification,
@ -384,7 +476,7 @@ class config extends common {
// Valeurs en sortie
$this->addOutput([
'title' => 'Restaurer',
'title' => $text[0],
'view' => 'restore'
]);
}
@ -394,6 +486,19 @@ class config extends common {
* Configuration
*/
public function index() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Configuration';
$text[1] = 'Modifications enregistrées ';
break;
case 'en' :
$text[0] = 'Configuration';
$text[1] = 'Saved changes';
break;
}
// Soumission du formulaire
if($this->isPost()) {
@ -503,6 +608,8 @@ class config extends common {
'showCredits' => $this->getData(['config', 'i18n', 'showCredits']),
'autoDetect' => $this->getData(['config', 'i18n', 'autoDetect']),
//'admin' => $this->getData(['config', 'i18n', 'admin']),
'langAdmin' => $this->getData(['config', 'i18n', 'langAdmin']),
'langBase' => $this->getData(['config', 'i18n', 'langBase']),
'fr' => $this->getData(['config', 'i18n', 'fr']),
'de' => $this->getData(['config', 'i18n', 'de']),
'en' => $this->getData(['config', 'i18n', 'en']),
@ -569,9 +676,9 @@ class config extends common {
$this->generateFiles();
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'title' => $text[0],
'view' => 'index',
'notification' => 'Modifications enregistrées ' ,
'notification' => $text[1] ,
'state' => true
]);
}
@ -594,13 +701,24 @@ class config extends common {
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'title' => $text[0],
'view' => 'index'
]);
}
public function script() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Éditeur de script dans ';
break;
case 'en' :
$text[0] = 'Script editor in ';
break;
}
// Soumission du formulaire
if($this->isPost()) {
// Ecrire les fichiers de script
@ -612,7 +730,7 @@ class config extends common {
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Éditeur de script dans ' . ucfirst($this->geturl(2)) ,
'title' => $text[0] . ucfirst($this->geturl(2)) ,
'vendor' => [
'codemirror'
],
@ -622,7 +740,7 @@ class config extends common {
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Éditeur de script dans ' . ucfirst($this->geturl(2)) ,
'title' => $text[0] . ucfirst($this->geturl(2)) ,
'vendor' => [
'codemirror'
],
@ -634,6 +752,23 @@ class config extends common {
* Met à jour les données de site avec l'adresse transmise
*/
public function updateBaseUrl () {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Restaurer';
$text[1] = ' conversion';
$text[2] = ' effectuée';
$text[3] = 'Aucune conversion';
break;
case 'en' :
$text[0] = 'Restore';
$text[1] = ' conversion';
$text[2] = ' performed';
$text[3] = 'No conversion';
break;
}
// Supprimer l'information de redirection
$old = str_replace('?','',$this->getData(['core', 'baseUrl']));
$new = helper::baseUrl(false,false);
@ -676,9 +811,9 @@ class config extends common {
$this->setData(['core','baseUrl',helper::baseUrl(true,false)]);
// Valeurs en sortie
$this->addOutput([
'title' => 'Restaurer',
'title' => $text[0],
'view' => 'restore',
'notification' => $success ? $c3. ' conversion' . ($c3 > 1 ? 's' : '') . ' effectuée' . ($c3 > 1 ? 's' : '') : 'Aucune conversion',
'notification' => $success ? $c3. $text[1] . ($c3 > 1 ? 's' : '') . $text[2] . ($c3 > 1 ? 's' : '') : $text[3],
'state' => $success ? true : false
]);
}
@ -688,6 +823,21 @@ class config extends common {
*/
public function logReset() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Configuration';
$text[1] = 'Journal réinitialisé avec succès';
$text[2] = 'Aucun journal à effacer';
break;
case 'en' :
$text[0] = 'Configuration';
$text[1] = 'Log successfully reset';
$text[2] = 'No logs to clear';
break;
}
if ( file_exists(self::DATA_DIR . 'journal.log') ) {
unlink(self::DATA_DIR . 'journal.log');
// Créer les en-têtes des journaux
@ -695,17 +845,17 @@ class config extends common {
file_put_contents(self::DATA_DIR . 'journal.log',$d);
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'title' => $text[0],
'view' => 'index',
'notification' => 'Journal réinitialisé avec succès',
'notification' => $text[1],
'state' => true
]);
} else {
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'title' => $text[0],
'view' => 'index',
'notification' => 'Aucun journal à effacer',
'notification' => $text[2],
'state' => false
]);
}
@ -718,6 +868,19 @@ class config extends common {
* Télécharger le fichier de log
*/
public function logDownload() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Configuration';
$text[1] = 'Aucun fichier journal à télécharger';
break;
case 'en' :
$text[0] = 'Configuration';
$text[1] = 'No log files to upload';
break;
}
$fileName = self::DATA_DIR . 'journal.log';
if (file_exists($fileName)) {
ob_start();
@ -731,9 +894,9 @@ class config extends common {
} else {
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'title' => $text[0],
'view' => 'index',
'notification' => 'Aucun fichier journal à télécharger',
'notification' => $text[1],
'state' => false
]);
}
@ -743,9 +906,25 @@ class config extends common {
* Tableau des IP blacklistés
*/
public function blacklistDownload () {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Date dernière tentative;Heure dernière tentative;Id;Adresse IP;Nombre d\'échecs';
$text[1] = 'Configuration';
$text[2] = 'Aucune liste noire à télécharger';
break;
case 'en' :
$text[0] = 'Date last attempted;Time last attempted;Id;IP address;Number of failures';
$text[1] = 'Configuration';
$text[2] = 'No blacklist to download';
break;
}
ob_start();
$fileName = self::TEMP_DIR . 'blacklist.log';
$d = 'Date dernière tentative;Heure dernière tentative;Id;Adresse IP;Nombre d\'échecs' . PHP_EOL;
$d = $text[0]. PHP_EOL;
file_put_contents($fileName,$d);
if ( file_exists($fileName) ) {
$d = $this->getData(['blacklist']);
@ -768,9 +947,9 @@ class config extends common {
} else {
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'title' => $text[1],
'view' => 'index',
'notification' => 'Aucune liste noire à télécharger',
'notification' => $text[2],
'state' => false
]);
}
@ -781,21 +960,36 @@ class config extends common {
*/
public function blacklistReset() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Configuration';
$text[1] = 'Liste noire réinitialisée avec succès';
$text[2] = 'Pas de liste à effacer';
break;
case 'en' :
$text[0] = 'Configuration';
$text[1] = 'Blacklist successfully reset';
$text[2] = 'No list to clear';
break;
}
if ( file_exists(self::DATA_DIR . 'blacklist.json') ) {
$this->setData(['blacklist',[]]);
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'title' => $text[0],
'view' => 'index',
'notification' => 'Liste noire réinitialisée avec succès',
'notification' => $text[1],
'state' => true
]);
} else {
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'title' => $text[0],
'view' => 'index',
'notification' => 'Pas de liste à effacer',
'notification' => $text[2],
'state' => false
]);
}
@ -805,6 +999,19 @@ class config extends common {
* Récupération des backups auto dans le gestionnaire de fichiers
*/
public function copyBackups() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Configuration';
$text[1] = 'Copie terminée';
break;
case 'en' :
$text[0] = 'Configuration';
$text[1] = 'Copy completed';
break;
}
// Créer le répertoire manquant
if (!is_dir(self::FILE_DIR.'source/backup')) {
mkdir(self::FILE_DIR.'source/backup', 0755);
@ -812,9 +1019,9 @@ class config extends common {
$this->copyDir(self::BACKUP_DIR, self::FILE_DIR . 'source/backup' );
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'title' => $text[0],
'view' => 'index',
'notification' => 'Copie terminée',
'notification' => $text[1],
'state' => true
]);
}

View File

@ -15,6 +15,19 @@
*/
$( document).ready(function() {
var text1 = "";
var text2 = "";
var text3 = "";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text1 = "La sauvegarde a été générée avec succès.";' ;
echo 'text2 = "Une erreur s\'est produite, la sauvegarde n\'a pas été générée !";' ;
echo 'text3 = "Une sauvegarde avec le contenu du gestionnaire de fichier peut prendre du temps à générer. Confirmez-vous ?";' ;
}
else{
echo 'text1 = "The backup was successfully generated.";' ;
echo 'text2 = "An error occurred, the backup was not generated !";' ;
echo 'text3 = "A backup with the contents of the file manager may take some time to generate. Can you confirm?";' ;
} ?>
$("#configBackupForm").submit( function(e){
//$("#configBackupSubmit").addClass("disabled").prop("disabled", true);
e.preventDefault();
@ -25,11 +38,11 @@ $( document).ready(function() {
data: $("form").serialize(),
success: function(data){
$('body, .button').css('cursor', 'default');
core.alert("La sauvegarde a été générée avec succès.");
core.alert(text1);
},
error: function(data){
$('body, .button').css('cursor', 'default');
core.alert("Une erreur s'est produite, la sauvegarde n'a pas été générée !");
core.alert(text2);
},
complete: function(){
$("#configBackupSubmit").removeClass("disabled").prop("disabled", false);
@ -46,7 +59,7 @@ $( document).ready(function() {
*/
$("#configBackupSubmit").on("click", function() {
if ($("input[name=configBackupOption]").is(':checked')) {
return core.confirm("Une sauvegarde avec le contenu du gestionnaire de fichier peut prendre du temps à générer. Confirmez-vous ?", function() {
return core.confirm(text3, function() {
//$(location).attr("href", _this.attr("href"));
$('body, .button').css('cursor', 'wait');
$('form#configBackupForm').submit();

View File

@ -1,3 +1,30 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Sauvegarder';
$text[2] = 'Inclure le contenu du gestionnaire de fichiers';
$text[3] = 'Si le contenu du gestionnaire de fichiers est très volumineux, mieux vaut une copie par FTP.';
$text[4] = 'Paramètres de la sauvegarde';
$text[5] = 'L\'archive est générée dans ';
$text[6] = 'le dossier Backup';
$text[7] = ' du gestionnaire de fichiers.';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Save';
$text[2] = 'Include the contents of the file manager';
$text[3] = 'If the contents of the file manager are very large, it is better to copy them via FTP';
$text[4] = 'Backup settings';
$text[5] = 'The archive is generated in ';
$text[6] = 'the Backup folder';
$text[7] = ' of the file manager';
break;
}
?>
<?php echo template::formOpen('configBackupForm'); ?>
<div class="row">
<div class="col2">
@ -5,12 +32,12 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'config',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('configBackupSubmit',[
'value' => 'Sauvegarder',
'value' => $text[1],
'uniqueSubmission' => true
]); ?>
</div>
@ -18,16 +45,16 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres de la sauvegarde</h4>
<h4><?php echo $text[4]; ?></h4>
<div class="row">
<div class="col12">
<?php echo template::checkbox('configBackupOption', true, 'Inclure le contenu du gestionnaire de fichiers', [
<?php echo template::checkbox('configBackupOption', true, $text[2], [
'checked' => true,
'help' => 'Si le contenu du gestionnaire de fichiers est très volumineux, mieux vaut une copie par FTP.'
'help' => $text[3]
]); ?>
</div>
<div class="col12">
<em>L'archive est générée dans <a href="<?php echo helper::baseUrl(false); ?>core/vendor/filemanager/dialog.php?fldr=backup&type=0&akey=<?php echo md5_file(self::DATA_DIR.'core.json'); ?>" data-lity>le dossier Backup</a> du gestionnaire de fichiers.</em>
<em><?php echo $text[5]; ?><a href="<?php echo helper::baseUrl(false); ?>core/vendor/filemanager/dialog.php?fldr=backup&type=0&akey=<?php echo md5_file(self::DATA_DIR.'core.json'); ?>" data-lity><?php echo $text[6]; ?></a><?php echo $text[7]; ?></em>
</div>
</div>
</div>

View File

@ -1,8 +1,25 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Scripts externes';
$text[1] = 'Script dans head';
$text[2] = 'Script dans body';
break;
case 'en' :
$text[0] = 'External scripts';
$text[1] = 'Script in head';
$text[2] = 'Script in body';
break;
}
?>
<div id="scriptContainer">
<div class="row">
<div class="col12">
<div class="block">
<h4>Scripts externes
<h4><?php echo $text[0]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/scripts" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -13,14 +30,14 @@
<div class="col3 offset3 verticalAlignBottom">
<?php echo template::button('socialScriptHead', [
'href' => helper::baseUrl() . 'config/script/head',
'value' => 'Script dans head',
'value' => $text[1],
'ico' => 'pencil'
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<?php echo template::button('socialScriptBody', [
'href' => helper::baseUrl() . 'config/script/body',
'value' => 'Script dans body',
'value' => $text[2],
'ico' => 'pencil'
]); ?>
</div>

View File

@ -1,8 +1,67 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Sécurité de la connexion';
$text[1] = 'Captcha à la connexion';
$text[2] = 'Captcha complexe';
$text[3] = '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 complexe utilise quatre opérations de nombres de 0 à 20. Activation recommandée.';
$text[4] = 'Type de captcha';
$text[5] = 'Déconnexion automatique';
$text[6] = 'Déconnecte les sessions ouvertes précédemment sur d\'autres navigateurs ou terminaux. Activation recommandée.';
$text[7] = 'Connexions successives';
$text[8] = 'Blocage après échecs';
$text[9] = '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.';
$text[10] = 'Liste noire :';
$text[11] = 'Télécharger la liste';
$text[12] = 'Réinitialiser la liste';
$text[13] = 'Journalisation';
$text[14] = 'Activer la journalisation';
$text[15] = 'Anonymat des adresses IP';
$text[16] = 'La réglementation française impose un anonymat de niveau 2';
$text[17] = 'Télécharger le journal';
$text[18] = 'Réinitialiser le journal';
$text[19] ='Captcha complexe';
$captchaTypes = $module::$captchaTypes;
$connectAttempt = $module::$connectAttempt;
$connectTimeout = $module::$connectTimeout;
$anonIP = $module::$anonIP;
break;
case 'en' :
$text[0] = 'Login security';
$text[1] = 'Captcha at login';
$text[2] = 'Complex captcha';
$text[3] = 'Recommended option to secure the connection. Applies to all captchas on the site. The simple captcha is limited to adding numbers from 0 to 10. The complex captcha uses four number operations from 0 to 20. Activation recommended.';
$text[4] = 'Captcha type';
$text[5] = 'Automatic logout';
$text[6] = 'Disconnects previously opened sessions on other browsers or terminals. Activation recommended.';
$text[7] = 'Successive logins';
$text[8] = 'Block after failures';
$text[9] = 'The blacklist lists login attempts from non-existent accounts. The date, time, account name and IP are stored. After the allowed number of attempts, the IP and account are blocked';
$text[10] = 'Blacklist:';
$text[11] = 'Download list';
$text[12] = 'Reset list';
$text[13] = 'Logging';
$text[14] = 'Enable logging';
$text[15] = 'Anonymise IP addresses';
$text[16] = 'French regulations require level 2 anonymity';
$text[17] = 'Download log';
$text[18] = 'Reset log';
$text[19] ='Complex captcha';
$captchaTypes = $module::$captchaTypes_en;
$connectAttempt = $module::$connectAttempt_en;
$connectTimeout = $module::$connectTimeout_en;
$anonIP = $module::$anonIP_en;
break;
}
?>
<div id="connectContainer">
<div class="row">
<div class="col12">
<div class="block">
<h4>Sécurité de la connexion
<h4><?php echo $text[0]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/connexion" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -11,52 +70,50 @@
</h4>
<div class="row">
<div class="col3">
<?php echo template::checkbox('connectCaptcha', true, 'Captcha à la connexion', [
<?php echo template::checkbox('connectCaptcha', true, $text[1], [
'checked' => $this->getData(['config', 'connect','captcha'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('connectCaptchaStrong', true, 'Captcha complexe', [
<?php echo template::checkbox('connectCaptchaStrong', true, $text[19], [
'checked' => $this->getData(['config', 'connect', '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 complexe utilise quatre opérations de nombres de 0 à 20. Activation recommandée.'
'help' => $text[3]
]); ?>
</div>
<div class="col3">
<?php echo template::select('connectCaptchaType', $module::$captchaTypes , [
'label' => 'Type de captcha',
<?php echo template::select('connectCaptchaType', $captchaTypes , [
'label' => $text[4],
'selected' => $this->getData(['config', 'connect', 'captchaType'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('connectAutoDisconnect', true, 'Déconnexion automatique', [
<?php echo template::checkbox('connectAutoDisconnect', true, $text[5], [
'checked' => $this->getData(['config','connect', 'autoDisconnect']),
'help' => 'Déconnecte les sessions ouvertes précédemment sur d\'autres navigateurs ou terminaux. Activation recommandée.'
'help' => $text[6]
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::select('connectAttempt', $module::$connectAttempt , [
'label' => 'Connexions successives',
<?php echo template::select('connectAttempt', $connectAttempt , [
'label' => $text[7],
'selected' => $this->getData(['config', 'connect', 'attempt'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('connectTimeout', $module::$connectTimeout , [
'label' => 'Blocage après échecs',
<?php echo template::select('connectTimeout', $connectTimeout , [
'label' => $text[8],
'selected' => $this->getData(['config', 'connect', 'timeout'])
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<label id="helpBlacklist">Liste noire :
<?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 id="helpBlacklist"><?php echo $text[10]; ?>
<?php echo template::help($text[9]);
?>
</label>
<?php echo template::button('ConnectBlackListDownload', [
'href' => helper::baseUrl() . 'config/blacklistDownload',
'value' => 'Télécharger la liste',
'value' => $text[11],
'ico' => 'download'
]); ?>
</div>
@ -64,7 +121,7 @@
<?php echo template::button('CnnectBlackListReset', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'config/blacklistReset',
'value' => 'Réinitialiser la liste',
'value' => $text[12],
'ico' => 'cancel'
]); ?>
</div>
@ -75,7 +132,7 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Journalisation
<h4><?php echo $text[13];?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/connexion#journalisation" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -84,21 +141,21 @@
</h4>
<div class="row">
<div class="col3">
<?php echo template::checkbox('connectLog', true, 'Activer la journalisation', [
<?php echo template::checkbox('connectLog', true, $text[14], [
'checked' => $this->getData(['config', 'connect', 'log'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('connectAnonymousIp', $module::$anonIP, [
'label' => 'Anonymat des adresses IP',
<?php echo template::select('connectAnonymousIp', $anonIP, [
'label' => $text[15],
'selected' => $this->getData(['config', 'connect', 'anonymousIp']),
'help' => 'La réglementation française impose un anonymat de niveau 2'
'help' => $text[16]
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<?php echo template::button('ConfigLogDownload', [
'href' => helper::baseUrl() . 'config/logDownload',
'value' => 'Télécharger le journal',
'value' => $text[17],
'ico' => 'download'
]); ?>
</div>
@ -106,7 +163,7 @@
<?php echo template::button('ConnectLogReset', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'config/logReset',
'value' => 'Réinitialiser le journal',
'value' => $text[18],
'ico' => 'cancel'
]); ?>
</div>

View File

@ -1,3 +1,32 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Accueil';
$text[1] = 'Aide';
$text[2] = 'Configuration';
$text[3] = 'Enregistrer';
$text[4] = 'Localisation';
$text[5] = 'Référencement';
$text[6] = 'Connexion';
$text[7] = 'Réseau';
$text[8] = 'Scripts';
break;
case 'en' :
$text[0] = 'Home';
$text[1] = 'Help';
$text[2] = 'Configuration';
$text[3] = 'Register';
$text[4] = 'Location';
$text[5] = 'Referencing';
$text[6] = 'Connection';
$text[7] = 'Network';
$text[8] = 'Scripts';
break;
}
?>
<?php echo template::formOpen('configForm');?>
<div class="row">
<div class="col2">
@ -5,7 +34,7 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl(false),
'ico' => 'home',
'value' => 'Accueil'
'value' => $text[0]
]); ?>
</div>
<div class="col2 ">
@ -14,11 +43,13 @@
'href' => 'https://doc.deltacms.fr/configuration-du-site',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide'
'value' => $text[1]
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('Submit'); ?>
<?php echo template::submit('Submit', [
'value' => $text[3]
]); ?>
</div>
</div>
<div class="row">
@ -26,32 +57,32 @@
<div class="row textAlignCenter">
<div class="col2">
<?php echo template::button('configSetupButton', [
'value' => 'Configuration'
'value' => $text[2]
]); ?>
</div>
<div class="col2">
<?php echo template::button('configLocaleButton', [
'value' => 'Localisation'
'value' => $text[4]
]); ?>
</div>
<div class="col2">
<?php echo template::button('configSocialButton', [
'value' => 'Référencement'
'value' => $text[5]
]); ?>
</div>
<div class="col2">
<?php echo template::button('configConnectButton', [
'value' => 'Connexion'
'value' => $text[6]
]); ?>
</div>
<div class="col2">
<?php echo template::button('configNetworkButton', [
'value' => 'Réseau'
'value' => $text[7]
]); ?>
</div>
<div class="col2">
<?php echo template::button('configScriptButton', [
'value' => 'Scripts'
'value' => $text[8]
]); ?>
</div>
</div>

View File

@ -1,13 +1,111 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Langues étrangères';
$text[1] = 'Activer la gestion des langues étrangères';
$text[2] = 'Une nouvelle icône apparaîtra dans la barre d\'administration. Consultez l\'aide de la page concernée pour en apprendre plus.';
$text[3] = 'Identité du site ';
$text[4] = 'Titre du site';
$text[5] = 'Il apparaît dans la barre de titre et les partages sur les réseaux sociaux.';
$text[6] = 'DeltaCMS Version';
$text[7] = 'Description du site';
$text[8] = 'La description d\'une page participe à son référencement, chaque page doit disposer d\'une description différente.';
$text[9] = 'Assignation des pages spéciales ';
$text[10] = 'Accueil du site';
$text[11] = 'La première page que vos visiteurs verront.';
$text[12] = 'Accès interdit, erreur 403';
$text[13] = 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.';
$text[14] = 'Page inexistante, erreur 404';
$text[15] = 'Mentions légales';
$text[16] = 'Les mentions légales sont obligatoires en France. Une option du pied de page ajoute un lien discret vers cette page.';
$text[17] = 'Recherche dans le site';
$text[18] = 'Sélectionnez une page contenant le module \'Recherche\'. Une option du pied de page ajoute un lien discret vers cette page.';
$text[19] = 'Page par défaut';
$text[20] = 'Aucune';
$text[21] = 'Site en maintenance';
$text[22] = 'Etiquettes des pages spéciales ';
$text[23] = 'Rechercher';
$text[24] = 'Plan du site';
$text[25] = 'Cookies';
$text[26] = 'Message d\'acceptation des Cookies ';
$text[27] = 'Saisissez le titre de la fenêtre de gestion des cookies.';
$text[28] = 'Titre de la fenêtre';
$text[29] = 'Gérer les cookies';
$text[30] = 'Saisissez le message pour les cookies déposés par DeltaCMS, nécessaires au fonctionnement et qui ne nécessitent pas de consentement.';
$text[31] = 'Cookies Deltacms';
$text[32] = 'Ce site utilise des cookies nécessaires à son fonctionnement, ils permettent de fluidifier son fonctionnement par exemple en mémorisant les données de connexion, la langue que vous avez choisie ou la validation de ce message.';
$text[33] = 'Saisissez le texte du lien vers les mentions légales,la page doit être définie dans la configuration du site.';
$text[34] = 'Lien page des mentions légales.';
$text[35] = 'Consulter les mentions légales';
$text[36] = 'Saisissez le message pour les cookies déposés par d\'autres applications dont le consentement est requis sinon laissez vide.';
$text[37] = 'Cookies tiers';
$text[38] = 'Saisissez le texte de la case à cocher d\'acceptation des cookies tiers.';
$text[39] = 'Checkbox cookies tiers';
$text[40] = 'Bouton de validation';
$text[41] = 'J\'ai compris';
break;
case 'en' :
$text[0] = 'Foreign languages';
$text[1] = 'Enable foreign language support';
$text[2] = 'A new icon will appear in the admin bar. See the help for the relevant page to learn more.';
$text[3] = 'Site identity ';
$text[4] = 'Site title';
$text[5] = 'It appears in the title bar and shares on social networks';
$text[6] = 'DeltaCMS Version';
$text[7] = 'Site description';
$text[8] = 'The description of a page helps its referencing, each page must have a different description';
$text[9] = 'Assignment of special pages ';
$text[10] = 'Home page';
$text[11] = 'The first page your visitors will see';
$text[12] = 'Access denied, error 403';
$text[13] = 'This page should not appear in the menu tree. Create an orphan page.';
$text[14] = 'Page does not exist, error 404';
$text[15] = 'Legal notice';
$text[16] = 'Legal notices are mandatory in France. A footer option adds a discrete link to this page';
$text[17] = 'Search the site';
$text[18] = 'Select a page containing the module \'Search\'. A footer option adds a discrete link to this page';
$text[19] = 'Default page';
$text[20] = 'None';
$text[21] = 'Site under maintenance';
$text[22] = 'Special page labels ';
$text[23] = 'Search';
$text[24] = 'Site map';
$text[25] = 'Cookies';
$text[26] = 'Cookie acceptance message ';
$text[27] = 'Enter the title of the cookie management window';
$text[28] = 'Window title';
$text[29] = 'Manage cookies';
$text[30] = 'Enter the message for the cookies deposited by DeltaCMS, which are necessary for the operation and do not require consent';
$text[31] = 'DeltaCMS cookies';
$text[32] = 'This site uses cookies necessary for its operation, they allow to make its operation more fluid for example by memorizing the connection data, the language you have chosen or the validation of this message';
$text[33] = 'Enter the text of the link to the legal notices, the page must be defined in the site configuration';
$text[34] = 'Link to the legal notice page';
$text[35] = 'View legal information';
$text[36] = 'Enter message for cookies set by other applications that require consent, otherwise leave blank';
$text[37] = 'Third party cookies';
$text[38] = 'Enter the text of the checkbox for accepting third party cookies';
$text[39] = 'Checkbox third party cookies';
$text[40] = 'Validation button';
$text[41] = 'Got it';
break;
}
?>
<?php // drapeau pour la langue d'origine ou la langue en traduction rédigée
$flag = 'site';
if( $this->getInput('DELTA_I18N_SITE') === 'base') $flag = $this->getData(['config', 'i18n', 'langBase']); ?>
<div id="localeContainer">
<div class="row">
<div class="col12">
<div class="block">
<h4>Langues étrangères</h4>
<h4><?php echo $text[0]; ?></h4>
<div class="row">
<div class="col12">
<?php echo template::checkbox('localei18n', true, 'Activer la gestion des langues étrangères', [
<?php echo template::checkbox('localei18n', true, $text[1], [
'checked' => $this->getData(['config', 'i18n', 'enable']),
'help'=> 'Une nouvelle icône apparaîtra dans la barre d\'administration. Consultez l\'aide de la page concernée pour en apprendre plus.'
'help'=> $text[2]
]); ?>
</div>
</div>
@ -17,7 +115,7 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Identité du site <?php echo template::flag('site', '20px');?>
<h4><?php echo $text[3]; ?><?php echo template::flag($flag, '20px');?>
<span id="localeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/localisation" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -27,14 +125,14 @@
<div class="row">
<div class="col9">
<?php echo template::text('localeTitle', [
'label' => 'Titre du site' ,
'label' => $text[4],
'value' => $this->getData(['locale', 'title']),
'help' => 'Il apparaît dans la barre de titre et les partages sur les réseaux sociaux.'
'help' => $text[5]
]); ?>
</div>
<div class="col3">
<?php echo template::text('localeVersion', [
'label' => 'DeltaCMS Version',
'label' => $text[6],
'value' => common::DELTA_VERSION,
'readonly' => true
]); ?>
@ -43,9 +141,9 @@
<div class="row">
<div class="col12">
<?php echo template::textarea('localeMetaDescription', [
'label' => 'Description du site',
'label' => $text[7],
'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.'
'help' => $text[8]
]); ?>
</div>
</div>
@ -55,7 +153,7 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Assignation des pages spéciales <?php echo template::flag('site', '20px');?>
<h4><?php echo $text[9]; echo template::flag($flag, '20px');?>
<span id="localeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/localisation#pages-speciales" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -65,47 +163,47 @@
<div class="row">
<div class="col4">
<?php echo template::select('localeHomePageId', helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC'), [
'label' => 'Accueil du site',
'label' => $text[10],
'selected' =>$this->getData(['locale', 'homePageId']),
'help' => 'La première page que vos visiteurs verront.'
'help' => $text[11]
]); ?>
</div>
<div class="col4">
<?php echo template::select('localePage403', array_merge(['none' => 'Page par défaut'],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [
'label' => 'Accès interdit, erreur 403',
<?php echo template::select('localePage403', array_merge(['none' => $text[19]],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [
'label' => $text[12],
'selected' =>$this->getData(['locale', 'page403']),
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
'help' => $text[13]
]); ?>
</div>
<div class="col4">
<?php echo template::select('localePage404', array_merge(['none' => 'Page par défaut'],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [
'label' => 'Page inexistante, erreur 404',
<?php echo template::select('localePage404', array_merge(['none' => $text[19]],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [
'label' => $text[14],
'selected' =>$this->getData(['locale', 'page404']),
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
'help' => $text[13]
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('localeLegalPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
'label' => 'Mentions légales',
<?php echo template::select('localeLegalPageId', array_merge(['none' => $text[20]] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
'label' => $text[15],
'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.'
'help' => $text[16]
]); ?>
</div>
<div class="col4">
<?php echo template::select('localeSearchPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
'label' => 'Recherche dans le site',
<?php echo template::select('localeSearchPageId', array_merge(['none' => $text[20]] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
'label' => $text[17],
'selected' => $this->getData(['locale', 'searchPageId']),
'help' => 'Sélectionnez une page contenant le module \'Recherche\'. Une option du pied de page ajoute un lien discret vers cette page.'
'help' => $text[18]
]); ?>
</div>
<div class="col4">
<?php
echo template::select('localePage302', array_merge(['none' => 'Page par défaut'],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [
'label' => 'Site en maintenance',
echo template::select('localePage302', array_merge(['none' => $text[19]],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [
'label' => $text[21],
'selected' =>$this->getData(['locale', 'page302']),
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
'help' => $text[13]
]); ?>
</div>
</div>
@ -115,7 +213,7 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Etiquettes des pages spéciales <?php echo template::flag('site', '20px');?>
<h4><?php echo $text[22]; echo template::flag($flag, '20px');?>
<span id="labelHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/localisation#etiquettes" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -125,15 +223,15 @@
<div class="row">
<div class="col6">
<?php echo template::text('localeLegalPageLabel', [
'label' => 'Mentions légales',
'placeholder' => 'Mentions légales',
'label' => $text[15],
'placeholder' => $text[15],
'value' => $this->getData(['locale', 'legalPageLabel'])
]); ?>
</div>
<div class="col6">
<?php echo template::text('localeSearchPageLabel', [
'label' => 'Rechercher',
'placeholder' => 'Rechercher',
'label' => $text[23],
'placeholder' => $text[23],
'value' => $this->getData(['locale', 'searchPageLabel'])
]); ?>
</div>
@ -141,16 +239,16 @@
<div class="row">
<div class="col6">
<?php echo template::text('localeSitemapPageLabel', [
'label' => 'Plan du site',
'placeholder' => 'Plan du site',
'label' => $text[24],
'placeholder' => $text[24],
'value' => $this->getData(['locale', 'sitemapPageLabel']),
]); ?>
</div>
<div class="col6">
<?php echo template::text('localeCookiesFooterText', [
'label' => 'Cookies',
'label' => $text[25],
'value' => $this->getData(['locale', 'cookies', 'cookiesFooterText']),
'placeHolder' => 'Cookies'
'placeHolder' => $text[25]
]); ?>
</div>
</div>
@ -160,7 +258,7 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Message d'acceptation des Cookies <?php echo template::flag('site', '20px');?>
<h4><?php echo $text[26]; echo template::flag($flag, '20px');?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/localisation#cookies" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -170,45 +268,45 @@
<div class="row">
<div class="col12">
<?php echo template::text('localeCookiesTitleText', [
'help' => 'Saisissez le titre de la fenêtre de gestion des cookies.',
'label' => 'Titre de la fenêtre',
'help' => $text[27],
'label' => $text[28] ,
'value' => $this->getData(['locale', 'cookies', 'cookiesTitleText']),
'placeHolder' => 'Gérer les cookies'
'placeHolder' => $text[29]
]); ?>
</div>
</div>
<div class="row">
<div class="col8">
<?php echo template::textarea('localeCookiesDeltaText', [
'help' => 'Saisissez le message pour les cookies déposés par DeltaCMS, nécessaires au fonctionnement et qui ne nécessitent pas de consentement.',
'label' => 'Cookies Deltacms',
'help' => $text[30],
'label' => $text[31],
'value' => $this->getData(['locale', 'cookies', 'cookiesDeltaText']),
'placeHolder' => 'Ce site utilise des cookies nécessaires à son fonctionnement, ils permettent de fluidifier son fonctionnement par exemple en mémorisant les données de connexion, la langue que vous avez choisie ou la validation de ce message.'
'placeHolder' => $text[32]
]); ?>
</div>
<div class="col4">
<?php echo template::text('localeCookiesLinkMlText', [
'help' => 'Saisissez le texte du lien vers les mentions légales,la page doit être définie dans la configuration du site.',
'label' => 'Lien page des mentions légales.',
'help' => $text[33],
'label' => $text[34],
'value' => $this->getData(['locale', 'cookies', 'cookiesLinkMlText']),
'placeHolder' => 'Consulter les mentions légales'
'placeHolder' => $text[35]
]); ?>
</div>
</div>
<div class="row">
<div class="col8">
<?php echo template::textarea('localeCookiesExtText', [
'help' => 'Saisissez le message pour les cookies déposés par d\'autres applications dont le consentement est requis sinon laissez vide.',
'label' => 'Cookies tiers',
'help' => $text[36],
'label' => $text[37],
'value' => $this->getData(['locale', 'cookies', 'cookiesExtText'])
]); ?>
</div>
<div class="col4">
<?php echo template::text('localeCookiesCheckboxExtText', [
'help' => 'Saisissez le texte de la case à cocher d\'acceptation des cookies tiers.',
'label' => 'Checkbox cookies tiers',
'help' => $text[38],
'label' => $text[39],
'value' => $this->getData(['locale', 'cookies', 'cookiesCheckboxExtText'])
]); ?>
</div>
@ -216,9 +314,9 @@
<div class="row">
<div class="col4 offset4">
<?php echo template::text('localeCookiesButtonText', [
'label' => 'Bouton de validation',
'label' => $text[40],
'value' => $this->getData(['locale', 'cookies', 'cookiesButtonText']),
'placeHolder' => 'J\'ai compris'
'placeHolder' => $text[41]
]); ?>
</div>
</div>

View File

@ -1,8 +1,49 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Paramètres';
$text[1] = 'Type de proxy';
$text[2] = 'Adresse du proxy';
$text[3] = 'Port du proxy';
$text[4] = 'SMTP';
$text[5] = 'Activer SMTP';
$text[6] = 'Paramètres à utiliser lorsque votre hébergeur ne propose pas la fonctionnalité d\'envoi de mail.';
$text[7] = 'Adresse SMTP';
$text[8] = 'Port SMTP';
$text[9] = 'Authentification';
$text[10] = 'Nom utilisateur';
$text[11] = 'Mot de passe';
$text[12] = 'Sécurité';
$SMTPauth = $module::$SMTPauth;
$SMTPEnc = $module::$SMTPEnc;
break;
case 'en' :
$text[0] = 'Settings';
$text[1] = 'Proxy type';
$text[2] = 'Proxy address';
$text[3] = 'Proxy port';
$text[4] = 'SMTP';
$text[5] = 'Enable SMTP';
$text[6] = 'Settings to be used when your webhost does not offer mail sending functionality';
$text[7] = 'SMTP address';
$text[8] = 'SMTP port';
$text[9] = 'Authentication';
$text[10] = 'User name';
$text[11] = 'Password';
$text[12] = 'Security';
$SMTPauth = $module::$SMTPauth_en;
$SMTPEnc = $module::$SMTPEnc_en;
break;
}
?>
<div id="networkContainer">
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres
<h4><?php echo $text[0]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/reseau" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -12,20 +53,20 @@
<div class="row">
<div class="col2">
<?php echo template::select('configProxyType', $module::$proxyType, [
'label' => 'Type de proxy',
'label' => $text[1],
'selected' => $this->getData(['config', 'proxyType'])
]); ?>
</div>
<div class="col8">
<?php echo template::text('configProxyUrl', [
'label' => 'Adresse du proxy',
'label' => $text[2],
'placeholder' => 'cache.proxy.fr',
'value' => $this->getData(['config', 'proxyUrl'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('configProxyPort', [
'label' => 'Port du proxy',
'label' => $text[3],
'placeholder' => '6060',
'value' => $this->getData(['config', 'proxyPort'])
]); ?>
@ -37,7 +78,7 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>SMTP
<h4><?php echo $text[4]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/reseau#smtp" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -46,9 +87,9 @@
</h4>
<div class="row">
<div class="col12">
<?php echo template::checkbox('smtpEnable', true, 'Activer SMTP', [
<?php echo template::checkbox('smtpEnable', true, $text[5], [
'checked' => $this->getData(['config', 'smtp','enable']),
'help' => 'Paramètres à utiliser lorsque votre hébergeur ne propose pas la fonctionnalité d\'envoi de mail.'
'help' => $text[6]
]); ?>
</div>
</div>
@ -56,21 +97,21 @@
<div class="row">
<div class="col8">
<?php echo template::text('smtpHost', [
'label' => 'Adresse SMTP',
'label' => $text[7],
'placeholder' => 'smtp.fr',
'value' => $this->getData(['config', 'smtp','host'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('smtpPort', [
'label' => 'Port SMTP',
'label' => $text[8],
'placeholder' => '589',
'value' => $this->getData(['config', 'smtp','port'])
]); ?>
</div>
<div class="col2">
<?php echo template::select('smtpAuth', $module::$SMTPauth, [
'label' => 'Authentification',
<?php echo template::select('smtpAuth', $SMTPauth, [
'label' => $text[9],
'selected' => $this->getData(['config', 'smtp','auth'])
]); ?>
</div>
@ -79,20 +120,20 @@
<div class="row">
<div class="col5">
<?php echo template::text('smtpUsername', [
'label' => 'Nom utilisateur',
'label' => $text[10],
'value' => $this->getData(['config', 'smtp','username' ])
]); ?>
</div>
<div class="col5">
<?php echo template::password('smtpPassword', [
'label' => 'Mot de passe',
'label' => $text[11],
'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('smtpSecure', $module::$SMTPEnc , [
'label' => 'Sécurité',
<?php echo template::select('smtpSecure', $SMTPEnc , [
'label' => $text[12],
'selected' => $this->getData(['config', 'smtp','secure'])
]); ?>
</div>

View File

@ -1,3 +1,40 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Restaurer';
$text[2] = 'Archive à restaurer';
$text[3] = 'Sélectionnez une archive au format ZIP';
$text[4] = 'L\'archive a été déposée dans le gestionnaire de fichiers.';
$text[5] = 'Préserver les comptes des utilisateurs déjà installés';
$text[6] = 'Conversion après la restauration';
$text[7] = 'Conversion des URL des ressources multimédia entre deux sites aux arborescences différentes.';
$text[8] = 'Pas de donnée dans la sauvegarde';
$text[9] = 'Dossier de l\'archive';
$text[10] = 'Le dossier de base du site est stockée dans la sauvegarde.';
$text[11] = 'Dossier du site actuel';
$text[12] = 'Convertir';
break;
case 'en' :
$text[0] = 'Return';
$text[1] = 'Restore';
$text[2] = 'Archive to restore';
$text[3] = 'Select an archive in ZIP format';
$text[4] = 'The archive has been dropped into the file manager.';
$text[5] = 'Preserve user accounts already installed';
$text[6] = 'Convert after restore';
$text[7] = 'Conversion of media URLs between two sites with different trees';
$text[8] = 'No data in backup';
$text[9] = 'Archive folder';
$text[10] = 'The site\'s base folder is stored in the backup';
$text[11] = 'Current site folder';
$text[12] = 'Convert';
break;
}
?>
<?php echo template::formOpen('configRestoreForm'); ?>
<div class="row">
<div class="col2">
@ -5,12 +42,12 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'config',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('configRestoreSubmit',[
'value' => 'Restaurer',
'value' => $text[1],
'uniqueSubmission' => true,
]); ?>
</div>
@ -18,18 +55,18 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Archive à restaurer</h4>
<h4><?php echo $text[2]; ?></h4>
<div class="row">
<div class="col10 offset1">
<div class="row">
<?php echo template::file('configRestoreImportFile', [
'label' => 'Sélectionnez une archive au format ZIP',
'label' => $text[3],
'type' => 2,
'help' => 'L\'archive a été déposée dans le gestionnaire de fichiers. Les archives inférieures à la version 9 ne sont pas acceptées.'
'help' => $text[4]
]); ?>
</div>
<div class="row">
<?php echo template::checkbox('configRestoreImportUser', true, 'Préserver les comptes des utilisateurs déjà installés', [
<?php echo template::checkbox('configRestoreImportUser', true, $text[5], [
'checked' => true
]); ?>
</div>
@ -41,12 +78,12 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Conversion après la restauration<?php echo template::help('Conversion des URL des ressources multimédia entre deux sites aux arborescences différentes.');?></h4>
<h4><?php echo $text[6]; echo template::help($text[7]);?></h4>
<div class="row">
<div class="col4 offset1">
<?php
if (is_null($this->getData(['core', 'baseUrl'])) ) {
$baseUrlValue = 'Pas de donnée dans la sauvegarde';
$baseUrlValue = $text[8];
$buttonClass = 'disabled';
} elseif ($this->getData(['core', 'baseUrl']) === '') {
$baseUrlValue = '/';
@ -56,15 +93,15 @@
$buttonClass = helper::baseUrl(false,false) !== $baseUrlValue ? '' : 'disabled';
}
echo template::text('configRestoreBaseURLToConvert', [
'label' => 'Dossier de l\'archive' ,
'label' => $text[9] ,
'value' => $baseUrlValue,
'readonly' => true,
'help' => 'Le dossier de base du site est stockée dans la sauvegarde.'
'help' => $text[10]
]); ?>
</div>
<div class="col4">
<?php echo template::text('configRestoreCurrentURL', [
'label' => 'Dossier du site actuel',
'label' => $text[11],
'value' => helper::baseUrl(false,false),
'readonly' => true
]); ?>
@ -73,7 +110,7 @@
<?php echo template::button('configRestoreUpdateBaseURLButton', [
'href' => helper::baseUrl() . 'config/updateBaseUrl',
'class' => $buttonClass,
'value' => 'convertir'
'value' => $text[12]
]); ?>
</div>
</div>

View File

@ -1,3 +1,18 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Valider';
break;
case 'en' :
$text[0] = 'Return';
$text[1] = 'Validate';
break;
}
?>
<?php echo template::formOpen('configScript'); ?>
<div class="row">
<div class="col2">
@ -5,12 +20,12 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'config',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('configManageSubmit',[
'value' => 'Valider',
'value' => $text[1],
'ico' => 'check'
]); ?>
</div>

View File

@ -1,8 +1,67 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Paramètres';
$text[1] = 'Mise à jour automatisée';
$text[2] = 'Maintenance';
$text[3] = 'Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.';
$text[4] = 'Favicon';
$text[5] = '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.';
$text[6] = 'Favicon thème sombre';
$text[7] = 'Fuseau horaire';
$text[8] = 'Le fuseau horaire est utile au bon référencement';
$text[9] = 'Message de consentement aux cookies';
$text[10] = 'Activation obligatoire selon les lois françaises sauf si vous utilisez votre propre système de consentement.';
$text[11] = 'URL intelligentes';
$text[12] = 'Vérifiez d\'abord que votre serveur autorise l\'URL rewriting (ce qui n\'est pas le cas chez Free).';
$text[13] = 'Rechercher une mise à jour en ligne';
$text[14] = 'La vérification est quotidienne. Option désactivée si la configuration du serveur ne le permet pas.';
$text[15] = 'Préserver le fichier htaccess racine';
$text[16] = 'Lors d\'une mise à jour automatique, conserve le fichier htaccess de la racine du site.';
$text[17] = 'Réinstaller';
$text[18] = 'Sauvegarde automatique quotidienne du site';
$text[19] = '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. Activation recommandée.';
$text[20] = 'Site en maintenance';
$text[21] = 'Sauvegarder';
$text[22] = 'Restaurer';
$text[23] = 'Copie sauvegardes auto';
break;
case 'en' :
$text[0] = 'Parameters';
$text[1] = 'Automated update';
$text[2] = 'Maintenance';
$text[3] = 'Remember to clear your browser\'s cache if the favicon does not change';
$text[4] = 'Favicon';
$text[5] = 'Select a suitable icon for a dark theme.<br>Remember to clear your browser\'s cache if the favicon does not change.';
$text[6] = 'Favicon dark theme';
$text[7] = 'Time zone';
$text[8] = 'The time zone is useful for good referencing';
$text[9] = 'Cookie consent message';
$text[10] = 'Mandatory activation under French law unless you use your own consent system';
$text[11] = 'Smart URLs';
$text[12] = 'First check that your server allows URL rewriting (which is not the case with Free)';
$text[13] = 'Search for an online update';
$text[14] = 'The check is daily. Option disabled if server configuration does not allow it.';
$text[15] = 'Preserve the root htaccess file';
$text[16] = 'On auto-update, keep the root htaccess file';
$text[17] = 'Reinstall';
$text[18] = 'Automatic daily site backup';
$text[19] = 'An archive containing the folder /site/data is copied to the folder \'site/backup\'. The backup is kept for 30 days.</p><p>Site files are not backed up automatically. Activation recommended.';
$text[20] = 'Site under maintenance';
$text[21] = 'Save';
$text[22] = 'Restore';
$text[23] = 'Auto backup copy';
break;
}
?>
<div id="setupContainer">
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres
<h4><?php echo $text[0]; ?>
<span id="setupHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/configuration" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -13,38 +72,38 @@
<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',
'help' => $text[3],
'label' => $text[4],
'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',
'help' => $text[5],
'label' => $text[6],
'value' => $this->getData(['config', 'faviconDark'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('configTimezone', $module::$timezones, [
'label' => 'Fuseau horaire',
'label' => $text[7],
'selected' => $this->getData(['config', 'timezone']),
'help' => 'Le fuseau horaire est utile au bon référencement'
'help' => $text[8]
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('configCookieConsent', true, 'Message de consentement aux cookies', [
<?php echo template::checkbox('configCookieConsent', true, $text[9], [
'checked' => $this->getData(['config', 'cookieConsent']),
'help' => 'Activation obligatoire selon les lois françaises sauf si vous utilisez votre propre système de consentement.'
'help' => $text[10]
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('configRewrite', true, 'URL intelligentes', [
<?php echo template::checkbox('configRewrite', true, $text[11], [
'checked' => helper::checkRewrite(),
'help' => 'Vérifiez d\'abord que votre serveur autorise l\'URL rewriting (ce qui n\'est pas le cas chez Free).'
'help' => $text[12]
]); ?>
</div>
</div>
@ -54,7 +113,7 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Mise à jour automatisée
<h4><?php echo $text[1]; ?>
<span id="updateHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/configuration#mise-a-jour" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -64,16 +123,16 @@
<?php $updateError = helper::urlGetContents(common::DELTA_UPDATE_URL . common::DELTA_UPDATE_CHANNEL . '/version');?>
<div class="row">
<div class="col4">
<?php echo template::checkbox('configAutoUpdate', true, 'Rechercher une mise à jour en ligne', [
<?php echo template::checkbox('configAutoUpdate', true, $text[13], [
'checked' => $this->getData(['config', 'autoUpdate']),
'help' => 'La vérification est quotidienne. Option désactivée si la configuration du serveur ne le permet pas.',
'help' => $text[14],
'disabled' => !$updateError
]); ?>
</div>
<div class="col4">
<?php echo template::checkbox('configAutoUpdateHtaccess', true, 'Préserver le fichier htaccess racine', [
<?php echo template::checkbox('configAutoUpdateHtaccess', true, $text[15], [
'checked' => $this->getData(['config', 'autoUpdateHtaccess']),
'help' => 'Lors d\'une mise à jour automatique, conserve le fichier htaccess de la racine du site.',
'help' => $text[16],
'disabled' => !$updateError
]); ?>
</div>
@ -81,7 +140,7 @@
<?php echo template::button('configUpdateForced', [
'ico' => 'download-cloud',
'href' => helper::baseUrl() . 'install/update',
'value' => 'Réinstaller',
'value' => $text[17],
'class' => 'buttonRed',
'disabled' => !$updateError
]); ?>
@ -93,7 +152,7 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Maintenance
<h4><?php echo $text[2]; ?>
<span id="maintenanceHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/configuration#maintenance" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -102,13 +161,13 @@
</h4>
<div class="row">
<div class="col6">
<?php echo template::checkbox('configAutoBackup', true, 'Sauvegarde automatique quotidienne du site', [
<?php echo template::checkbox('configAutoBackup', true, $text[18], [
'checked' => $this->getData(['config', 'autoBackup']),
'help' => '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. Activation recommandée.'
'help' => $text[19]
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('configMaintenance', true, 'Site en maintenance', [
<?php echo template::checkbox('configMaintenance', true, $text[20], [
'checked' => $this->getData(['config', 'maintenance'])
]); ?>
</div>
@ -117,21 +176,21 @@
<div class="col3">
<?php echo template::button('configBackupButton', [
'href' => helper::baseUrl() . 'config/backup',
'value' => 'Sauvegarder',
'value' => $text[21],
'ico' => 'download-cloud'
]); ?>
</div>
<div class="col3">
<?php echo template::button('configRestoreButton', [
'href' => helper::baseUrl() . 'config/restore',
'value' => 'Restaurer',
'value' => $text[22],
'ico' => 'upload-cloud'
]); ?>
</div>
<div class="col3">
<?php echo template::button('configBackupCopyButton', [
'href' => helper::baseUrl() . 'config/copyBackups',
'value' => 'Copie sauvegardes auto',
'value' => $text[23],
'ico' => 'download-cloud'
]); ?>
</div>

View File

@ -1,8 +1,51 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Paramètres';
$text[1] = 'Désactiver le mode de capture Open Graph';
$text[2] = 'Activer le mode de capture Open Graph';
$text[3] = 'Générer sitemap.xml et robots.txt';
$text[4] = 'Autoriser les robots à référencer le site';
$text[5] = 'Cette capture d\'écran est nécessaire aux partages sur les réseaux sociaux. Pour la régénérer activer le mode de capture Open Graph et cliquer sur l\'appareil photo en bas à droite.';
$text[6] = '<h4>Image screenshot.jpg absente</h4><p>L\'activation du mode de capture Open Graph fait apparaître un appareil photo en bas de page. Un clic dessus génère une image screenshot.jpg à partir de la page active.</p>';
$text[7] = 'Réseaux sociaux';
$text[8] = 'Saisissez votre ID : https://www.facebook.com/[ID].';
$text[9] = 'Saisissez votre ID : https://www.instagram.com/[ID].';
$text[10] = 'ID de la chaîne : https://www.youtube.com/channel/[ID].';
$text[11] = 'Saisissez votre ID Utilisateur : https://www.youtube.com/user/[ID].';
$text[12] = 'Saisissez votre ID : https://twitter.com/[ID].';
$text[13] = 'Saisissez votre ID : https://pinterest.com/[ID].';
$text[14] = 'Saisissez votre ID Linkedin : https://fr.linkedin.com/in/[ID].';
$text[15] = 'Saisissez votre ID Github : https://github.com/[ID].';
break;
case 'en' :
$text[0] = 'Settings';
$text[1] = 'Disable Open Graph capture mode';
$text[2] = 'Enable Open Graph capture mode';
$text[3] = 'Generate sitemap.xml and robots.txt';
$text[4] = 'Allow robots to reference the site';
$text[5] = 'This screenshot is required for social media sharing. To regenerate it, activate the Open Graph capture mode and click on the camera at the bottom right';
$text[6] = '<h4>Image screenshot.jpg absent</h4><p>Enabling the Open Graph capture mode causes a camera to appear at the bottom of the page. Clicking it generates a screenshot.jpg image from the active page.</p>';
$text[7] = 'Social networks';
$text[8] = 'Enter your ID: https://www.facebook.com/[ID].';
$text[9] = 'Enter your ID: https://www.instagram.com/[ID].';
$text[10] = 'String ID: https://www.youtube.com/channel/[ID].';
$text[11] = 'Enter your User ID: https://www.youtube.com/user/[ID].';
$text[12] = 'Enter your ID: https://twitter.com/[ID].';
$text[13] = 'Enter your ID: https://pinterest.com/[ID].';
$text[14] = 'Enter your Linkedin ID: https://fr.linkedin.com/in/[ID].';
$text[15] = 'Enter your Github ID: https://github.com/[ID].';
break;
}
?>
<div id="socialContainer">
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres
<h4><?php echo $text[0]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/referencement" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -13,7 +56,7 @@
<div class="col4 offset1">
<div class="row">
<div class="col12" id="take_screenshoot">
<?php $texte = $_SESSION['screenshot'] === 'on' ? 'Désactiver le mode de capture Open Graph': 'Activer le mode de capture Open Graph';
<?php $texte = $_SESSION['screenshot'] === 'on' ? $text[1]: $text[2];
echo template::button('socialMetaImage', [
'href' => helper::baseUrl() . 'config/configOpenGraph',
'value' => $texte
@ -25,13 +68,13 @@
<div class="col12">
<?php echo template::button('socialSiteMap', [
'href' => helper::baseUrl() . 'config/generateFiles',
'value' => 'Générer sitemap.xml et robots.txt'
'value' => $text[3]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::checkbox('seoRobots', true, 'Autoriser les robots à référencer le site', [
<?php echo template::checkbox('seoRobots', true, $text[4], [
'checked' => $this->getData(['config', 'seo','robots'])
]); ?>
</div>
@ -41,13 +84,13 @@
<?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. Pour la régénérer activer le mode de capture Open Graph et cliquer sur l'appareil photo en bas à droite." />
<img src="<?php echo helper::baseUrl(false) . self::FILE_DIR.'source/screenshot.jpg';?>" data-tippy-content="<?php echo $text[5]; ?>" />
</div>
</div>
<?php } else{?>
<div class="row">
<div class="col8 offset2 textAlignCenter">
<h4>Image screenshot.jpg absente</h4><p>L'activation du mode de capture Open Graph fait apparaître un appareil photo en bas de page. Un clic dessus génère une image screenshot.jpg à partir de la page active.</p>
<?php echo $text[6]; ?>
</div>
</div>
<?php }?>
@ -59,7 +102,7 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Réseaux sociaux
<h4><?php echo $text[7]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/referencement#reseaux-sociaux" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -69,28 +112,28 @@
<div class="row">
<div class="col3">
<?php echo template::text('socialFacebookId', [
'help' => 'Saisissez votre ID : https://www.facebook.com/[ID].',
'help' => $text[8],
'label' => 'Facebook',
'value' => $this->getData(['config', 'social', 'facebookId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('socialInstagramId', [
'help' => 'Saisissez votre ID : https://www.instagram.com/[ID].',
'help' => $text[9],
'label' => 'Instagram',
'value' => $this->getData(['config', 'social', 'instagramId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('socialYoutubeId', [
'help' => 'ID de la chaîne : https://www.youtube.com/channel/[ID].',
'help' => $text[10],
'label' => 'Chaîne Youtube',
'value' => $this->getData(['config', 'social', 'youtubeId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('socialYoutubeUserId', [
'help' => 'Saisissez votre ID Utilisateur : https://www.youtube.com/user/[ID].',
'help' => $text[11],
'label' => 'Youtube',
'value' => $this->getData(['config', 'social', 'youtubeUserId'])
]); ?>
@ -99,28 +142,28 @@
<div class="row">
<div class="col3">
<?php echo template::text('socialTwitterId', [
'help' => 'Saisissez votre ID : https://twitter.com/[ID].',
'help' => $text[12],
'label' => 'Twitter',
'value' => $this->getData(['config', 'social', 'twitterId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('socialPinterestId', [
'help' => 'Saisissez votre ID : https://pinterest.com/[ID].',
'help' => $text[13],
'label' => 'Pinterest',
'value' => $this->getData(['config', 'social', 'pinterestId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('socialLinkedinId', [
'help' => 'Saisissez votre ID Linkedin : https://fr.linkedin.com/in/[ID].',
'help' => $text[14],
'label' => 'Linkedin',
'value' => $this->getData(['config', 'social', 'linkedinId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('socialGithubId', [
'help' => 'Saisissez votre ID Github : https://github.com/[ID].',
'help' => $text[15],
'label' => 'Github',
'value' => $this->getData(['config', 'social', 'githubId'])
]); ?>

View File

@ -57,7 +57,12 @@ class install extends common {
$userLastname = $this->getInput('installLastname', helper::FILTER_STRING_SHORT, true);
$userMail = $this->getInput('installMail', helper::FILTER_MAIL, true);
$userId = $this->getInput('installId', helper::FILTER_ID, true);
// Langues
$langAdmin = $this->getInput('installLangAdmin');
$langBase = $this->getInput('installLangBase');
$this->setData(['config', 'i18n', 'langAdmin', $langAdmin]);
$this->setData(['config', 'i18n', 'langBase', $langBase]);
// Création de l'utilisateur si les données sont complétées.
// success retour de l'enregistrement des données
@ -77,17 +82,38 @@ class install extends common {
]
]);
// Lexique
$text = [];
switch ($langAdmin) {
case 'fr' :
$text[0] = 'Installation de votre site';
$text[1] = 'Bonjour';
$text[2] = 'Voici les détails de votre installation';
$text[3] = 'URL du site';
$text[4] = 'Identifiant du compte';
$text[5] = 'Installation terminée';
break;
case 'en' :
$text[0] = 'Setting up your website';
$text[1] = 'Hello';
$text[2] = 'Here are the details of your installation';
$text[3] = 'Site URL';
$text[4] = 'Account ID';
$text[5] = 'Installation completed';
break;
}
// Compte créé, envoi du mail et création des données du site
if ($success) { // Formulaire complété envoi du mail
// Envoie le mail
// Sent contient true si réussite sinon code erreur d'envoi en clair
$sent = $this->sendMail(
$userMail,
'Installation de votre site',
'Bonjour' . ' <strong>' . $userFirstname . ' ' . $userLastname . '</strong>,<br><br>' .
'Voici les détails de votre installation.<br><br>' .
'<strong>URL du site :</strong> <a href="' . helper::baseUrl(false) . '" target="_blank">' . helper::baseUrl(false) . '</a><br>' .
'<strong>Identifiant du compte :</strong> ' . $this->getInput('installId') . '<br>',
$text[0],
$text[1] . ' <strong>' . $userFirstname . ' ' . $userLastname . '</strong>,<br><br>' .
$text[2].'<br><br>' .
'<strong>'.$text[3].' : </strong> <a href="' . helper::baseUrl(false) . '" target="_blank">' . helper::baseUrl(false) . '</a><br>' .
'<strong>'.$text[4].' : </strong> ' . $this->getInput('installId') . '<br>',
null
);
// Nettoyer les cookies de langue d'une précédente installation
@ -95,8 +121,8 @@ class install extends common {
helper::deleteCookie('DELTA_I18N_SCRIPT');
// Installation du site de test
if ($this->getInput('installDefaultData',helper::FILTER_BOOLEAN) === FALSE) {
$this->initData('page','fr',true);
$this->initData('module','fr',true);
$this->initData('page','base',true);
$this->initData('module','base',true);
}
// Images exemples livrées dans tous les cas
try {
@ -141,7 +167,7 @@ class install extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl(false),
'notification' => $sent === true ? 'Installation terminée' : $sent,
'notification' => $sent === true ? $text[5] : $sent,
'state' => ($sent === true && $success === true) ? true : null
]);
}
@ -194,10 +220,6 @@ class install extends common {
break;
// Téléchargement
case 2:
// Téléchargement depuis le serveur de Zwii
//$success = (file_put_contents(self::TEMP_DIR.'update.tar.gz', helper::urlGetContents('https://zwiicms.fr/update/' . common::DELTA_UPDATE_CHANNEL . '/update.tar.gz')) !== false);
// URL sur le git
//$newVersion = helper::urlGetContents('https://zwiicms.fr/update/' . common::DELTA_UPDATE_CHANNEL . '/version');
$success = (file_put_contents(self::TEMP_DIR.'update.tar.gz', helper::urlGetContents(common::DELTA_UPDATE_URL . common::DELTA_UPDATE_CHANNEL . '/update.tar.gz')) !== false);
// Valeurs en sortie
$this->addOutput([
@ -283,12 +305,23 @@ class install extends common {
* Mise à jour
*/
public function update() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ( $val ) {
case 'fr' :
$text[0] = 'Mise à jour';
break;
case 'en' :
$text[0] = 'Update';
break;
}
// Nouvelle version
self::$newVersion = helper::urlGetContents(common::DELTA_UPDATE_URL . common::DELTA_UPDATE_CHANNEL . '/version');
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,
'title' => 'Mise à jour',
'title' => $text[0],
'view' => 'update'
]);
}

View File

@ -45,6 +45,8 @@ class init extends common {
'showCredits'=> false,
'autoDetect'=> false,
'admin'=> false,
'langAdmin'=> 'fr',
'langBase'=> 'fr',
'fr'=> 'none',
'de'=> 'none',
'en'=> 'none',
@ -55,7 +57,7 @@ class init extends common {
]
],
'core' => [
'dataVersion' => 3205,
'dataVersion' => 3206,
'lastBackup' => 0,
'lastClearTmp' => 0,
'lastAutoUpdate' => 0,
@ -73,7 +75,7 @@ class init extends common {
'sitemapPageLabel' => 'Plan du site',
'legalPageLabel' => 'Mentions légales',
'metaDescription' => 'DeltaCMS 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' => 'Avec DeltaCMS installez votre site en quelques clics !',
'title' => 'DeltaCMS',
'cookies' => [
'cookiesDeltaText' => 'Ce site utilise des cookies nécessaires à son fonctionnement, ils permettent de fluidifier son fonctionnement par exemple en mémorisant les données de connexion, la langue que vous avez choisie ou la validation de ce message.',
'cookiesExtText' => '',
@ -90,7 +92,7 @@ class init extends common {
'iconUrl' => '',
'disable' => false,
'content' => 'accueil.html',
'hideTitle' => false,
'hideTitle' => true,
'homePageId' => true,
'breadCrumb' => false,
'metaDescription' => '',
@ -402,7 +404,7 @@ class init extends common {
'iconUrl' => '',
'disable' => false,
'content' => 'accueil.html',
'hideTitle' => false,
'hideTitle' => true,
'homePageId' => true,
'breadCrumb' => false,
'metaDescription' => '',
@ -943,9 +945,16 @@ class init extends common {
public static $siteContent = [
'accueil' => [
'content' => '<h2>Bienvenue sur votre nouveau site DeltaCMS !</h2>
<p><strong>Un email contenant le récapitulatif de votre installation vient de vous être envoyé.</strong></p>
<p>Connectez-vous dès maintenant à votre espace membre afin de créer un site à votre image ! Vous pourrez personnaliser le thème, créer des pages, ajouter des utilisateurs et bien plus encore !</p>'
'content' => '<p><a href="https://deltacms.fr" target="_blank" rel="noopener"><img src="site/file/source/icones/logo_menu_couleur_600_200.png" alt="Deltacms" title="Deltacms" style="display: block; margin-left: auto; margin-right: auto;" width="300" height="75" /></a></p>
<div class="row"><div class="col6"><div class="block">
<h2>Bienvenue sur votre nouveau site DeltaCMS !</h2>
<p><strong>Un email contenant le récapitulatif de votre installation vient de vous être envoyé.</strong></p><p>&nbsp;</p>
<p>Connectez-vous dès maintenant à votre espace membre afin de créer un site à votre image ! Vous pourrez personnaliser le thème, créer des pages, ajouter des utilisateurs et bien plus encore !</p>
</div></div><div class="col6"><div class="block">
<h2>Welcome to your new DeltaCMS website !</h2>
<strong>An email containing the summary of your installation has just been sent to you.</strong><br /><p>&nbsp;</p>
<p>Log in now to your member area to create a site that suits you ! <br/><br/>You will be able to customize the theme, create pages, add users and much more !</p>
</div></div></div>'
],
'enfant' => [
'content' => '<p>Vous pouvez assigner des parents à vos pages afin de mieux organiser votre menu !</p>

View File

@ -1,3 +1,4 @@
/**
* This file is part of DeltaCMS.
* For full copyright and license information, please see the LICENSE
@ -37,4 +38,25 @@ $("#installId").on("change keydown keyup", function(event) {
userId = userId.replace(/[^a-z0-9-]/ig, "");
$(this).val(userId);
}
});
});
/*
* Affichage des labels français ou anglais
*/
$("#installLang").change( function(e) {
if( $("#installLang").val() === 'en'){
// English
for (var i = 1; i < 11; i++) {
$("#m"+i+"f").hide();
$("#m"+i+"e").show();
}
}
else{
//Français
for (var i = 1; i < 11; i++) {
$("#m"+i+"e").hide();
$("#m"+i+"f").show();
}
}
}).trigger("change");

View File

@ -1,60 +1,100 @@
<p>Renseignez les champs ci-dessous pour finaliser l'installation.</p>
<div class="row">
<div class="col6">
<p><img src="./site/file/source/icones/logo_menu_couleur_600_200.png" width="200" height="auto"></p>
</div>
<div class="col4 offset2">
<?php echo template::select('installLang', ['en'=>'English','fr'=>'Français'], [
'label' => '',
'selected' => 'fr'
]); ?>
</div>
</div>
<?php echo template::formOpen('installForm'); ?>
<?php echo template::text('installId', [
'autocomplete' => 'off',
'label' => 'Identifiant'
]); ?>
<div class="row">
<div class="col6">
<div id="m2f">Identifiant</div><div id="m2e">Identifier</div>
<?php echo template::text('installId', [
'autocomplete' => 'off',
'label' => ''
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<div id="m3f">Mot de passe</div><div id="m3e">Password</div>
<?php echo template::password('installPassword', [
'autocomplete' => 'off',
'label' => 'Mot de passe'
'label' => ''
]); ?>
</div>
<div class="col6">
<div id="m4f">Confirmation</div><div id="m4e">Confirmation</div>
<?php echo template::password('installConfirmPassword', [
'autocomplete' => 'off',
'label' => 'Confirmation'
'label' => ''
]); ?>
</div>
</div>
<div id="m1f">Adresse mail</div><div id="m1e">Email address</div>
<?php echo template::mail('installMail', [
'autocomplete' => 'off',
'label' => 'Adresse mail'
'label' => ''
]); ?>
<div class="row">
<div class="col6">
<div id="m5f">Prénom</div><div id="m5e">Vorname</div>
<?php echo template::text('installFirstname', [
'autocomplete' => 'off',
'label' => 'Prénom'
'label' => ''
]); ?>
</div>
<div class="col6">
<div id="m6f">Nom</div><div id="m6e">Name</div>
<?php echo template::text('installLastname', [
'autocomplete' => 'off',
'label' => 'Nom'
'label' => ''
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div id="m7f">Thème</div><div id="m7e">Theme</div>
<?php echo template::select('installTheme', $module::$themes, [
'label' => 'Thème'
'label' => ''
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::checkbox('installDefaultData',true , 'Ne pas charger l\'exemple de site (utilisateurs avancés)', [
<div class="col2">
<?php echo template::checkbox('installDefaultData',true , '', [
'checked' => false
]);
?>
</div>
<div class="col10">
<div id="m8f">Sans exemple de site </div><div id="m8e">Without an example site</div>
</div>
</div>
<div class="row">
<div class="col6">
<div id="m9f">Langue d'administration</div><div id="m9e">Administration language</div>
<?php echo template::select('installLangAdmin', ['fr'=>'Français (fr)','en'=>'Anglais (en)'], [
'label' => '',
'selected' => $this->getData(['config', 'i18n' , 'langAdmin'])
]); ?>
</div>
<div class="col6">
<div id="m10f">Langue originale du site</div><div id="m10e">Original language of the site</div>
<?php echo template::select('installLangBase', core::$i18nList, [
'label' => '',
'selected' => $this->getData(['config', 'i18n' , 'langBase'])
]); ?>
</div>
</div>
<div class="row">
<div class="col3 offset9">
<?php echo template::submit('installSubmit', [
'value' => 'Installer'
'value' => 'OK'
]); ?>
</div>
</div>

View File

@ -1,26 +1,58 @@
<p><strong>Mise à jour de Deltacms <?php echo self::DELTA_VERSION; ?> vers Deltacms <?php echo $module::$newVersion; ?>.</strong></p>
<p>Afin d'assurer le bon fonctionnement de Deltacms, veuillez ne pas fermer cette page avant la fin de l'opération.</p>
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Mise à jour de Deltacms ';
$text[1] = ' vers Deltacms ';
$text[2] = 'Afin d\'assurer le bon fonctionnement de Deltacms, veuillez ne pas fermer cette page avant la fin de l\'opération.';
$text[3] = '1/4 : Préparation...';
$text[4] = '2/4 : Téléchargement...';
$text[5] = '3/4 : Installation...';
$text[6] = '4/4 : Configuration...';
$text[7] = 'Une erreur est survenue lors de l\'étape';
$text[8] = 'Mise à jour terminée avec succès.';
$text[9] = 'Terminer';
break;
case 'en' :
$text[0] = 'Updating Deltacms ';
$text[1] = ' to Deltacms ';
$text[2] = 'To ensure the proper functioning of Deltacms, please do not close this page until the operation is complete.';
$text[3] = '1/4: Preparation...';
$text[4] = '2/4 : Download...';
$text[5] = '3/4 : Installation...';
$text[6] = '4/4 : Configuration...';
$text[7] = 'An error occurred in the step';
$text[8] = 'Update successfully completed.';
$text[9] = 'Finish';
break;
}
?>
<p><strong><?php echo $text[0] . self::DELTA_VERSION . $text[1] . $module::$newVersion; ?>.</strong></p>
<p><?php echo $text[2]; ?></p>
<div class="row">
<div class="col9 verticalAlignMiddle">
<div id="installUpdateProgress">
<?php echo template::ico('spin', '', true); ?>
<span class="installUpdateProgressText" data-id="1">1/4 : Préparation...</span>
<span class="installUpdateProgressText displayNone" data-id="2">2/4 : Téléchargement...</span>
<span class="installUpdateProgressText displayNone" data-id="3">3/4 : Installation...</span>
<span class="installUpdateProgressText displayNone" data-id="4">4/4 : Configuration...</span>
<span class="installUpdateProgressText" data-id="1"><?php echo $text[3]; ?></span>
<span class="installUpdateProgressText displayNone" data-id="2"><?php echo $text[4]; ?></span>
<span class="installUpdateProgressText displayNone" data-id="3"><?php echo $text[5]; ?></span>
<span class="installUpdateProgressText displayNone" data-id="4"><?php echo $text[6]; ?></span>
</div>
<div id="installUpdateError" class="colorRed displayNone">
<?php echo template::ico('cancel', ''); ?>
Une erreur est survenue lors de l'étape <span id="installUpdateErrorStep"></span>.
<?php echo $text[7]; ?> <span id="installUpdateErrorStep"></span>.
</div>
<div id="installUpdateSuccess" class="colorGreen displayNone">
<?php echo template::ico('check', ''); ?>
Mise à jour terminée avec succès.
<?php echo $text[8]; ?>
</div>
</div>
<div class="col3 verticalAlignMiddle">
<?php echo template::button('installUpdateEnd', [
'value' => 'Terminer',
'value' => $text[9],
'href' => helper::baseUrl() . 'config',
'ico' => 'check',
'class' => 'disabled'

View File

@ -26,6 +26,17 @@ class maintenance extends common {
* Maintenance
*/
public function index() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Maintenance en cours...';
break;
case 'en' :
$text[0] = 'Maintenance in progress...';
break;
}
// Redirection vers l'accueil après rafraîchissement et que la maintenance est terminée.
if($this->getData(['config', 'maintenance']) == False){
header('Location:' . helper::baseUrl());
@ -47,7 +58,7 @@ class maintenance extends common {
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,
'title' => 'Maintenance en cours...',
'title' => $text[0],
'view' => 'index'
]);
}

View File

@ -1,8 +1,9 @@
<p>Notre site est actuellement en maintenance. Nous sommes désolés pour la gêne occasionnée et faisons notre possible pour être rapidement de retour.</p>
<p>Our site is currently undergoing maintenance. We apologise for the inconvenience and are doing our best to be back soon.</p>
<div class="row">
<div class="col4 offset8 textAlignCenter">
<?php echo template::button('maintenanceLogin', [
'value' => 'Connexion',
'value' => '',
'href' => helper::baseUrl() . 'user/login',
'ico' => 'lock'
]); ?>

View File

@ -27,9 +27,15 @@ class page extends common {
public static $pagesNoParentId = [
'' => 'Aucune'
];
public static $pagesNoParentId_en = [
'' => 'None'
];
public static $pagesBarId = [
'' => 'Aucune'
];
public static $pagesBarId_en = [
'' => 'None'
];
public static $moduleIds = [];
public static $typeMenu = [
@ -37,12 +43,22 @@ class page extends common {
'icon' => 'Icône',
'icontitle' => 'Icône avec bulle de texte'
];
public static $typeMenu_en = [
'text' => 'Text',
'icon' => 'Icon',
'icontitle' => 'Icon with text bubble'
];
// Position du module
public static $modulePosition = [
'bottom' => 'En bas',
'top' => 'En haut',
'free' => 'Libre'
];
public static $modulePosition_en = [
'bottom' => 'Bottom',
'top' => 'Top',
'free' => 'Free'
];
public static $pageBlocks = [
'12' => 'Page standard',
'4-8' => 'Barre 1/3 - page 2/3',
@ -54,17 +70,49 @@ class page extends common {
'3-7-2' => 'Barre 3/12 - page 7/12 - barre 2/12 ',
'bar' => 'Barre latérale'
];
public static $pageBlocks_en = [
'12' => 'Standard page',
'4-8' => 'Bar 1/3 - page 2/3',
'8-4' => 'Page 2/3 - bar 1/3',
'3-9' => 'Bar 1/4 - page 3/4',
'9-3' => 'Page 3/4 - bar 1/4',
'3-6-3' => 'Bar 1/4 - page 1/2 - bar 1/4',
'2-7-3' => 'Bar 2/12 - page 7/12 - bar 3/12 ',
'3-7-2' => 'Bar 3/12 - page 7/12 - bar 2/12 ',
'bar' => 'Sidebar'
];
public static $displayMenu = [
'none' => 'Aucun',
'parents' => 'Le menu',
'children' => 'Le sous-menu de la page parente'
];
public static $displayMenu_en = [
'none' => 'None',
'parents' => 'Menu',
'children' => 'The submenu of the parent page'
];
/**
* Duplication
*/
public function duplicate() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Jeton invalide';
$text[1] = 'Suppression non autorisée';
$text[2] = 'La page a été dupliquée';
$text[3] = 'La page et son module ont été dupliqués';
break;
case 'en' :
$text[0] = 'Invalid token';
$text[1] = 'Unauthorised deletion';
$text[2] = 'The page has been duplicated';
$text[3] = 'The page and its module have been duplicated';
break;
}
// Adresse sans le token
$url = explode('&',$this->getUrl(2));
// La page n'existe pas
@ -78,14 +126,14 @@ class page extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'page/edit/' . $url[0],
'notification' => 'Jeton invalide'
'notification' => $text[0]
]);
}
elseif ($_GET['csrf'] !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'page/edit/' . $url[0],
'notification' => 'Suppression non autorisée'
'notification' => $text[1]
]);
}
// Duplication de la page
@ -99,7 +147,7 @@ class page extends common {
]);
// Ecriture
$this->setData (['page',$pageId,$data]);
$notification = 'La page a été dupliquée';
$notification = $text[2];
// Duplication du module présent
if ($this->getData(['page',$url[0],'moduleId'])) {
$data = $this->getData([
@ -108,7 +156,7 @@ class page extends common {
]);
// Ecriture
$this->setData (['module',$pageId,$data]);
$notification = 'La page et son module ont été dupliqués';
$notification = $text[3];
}
// Valeurs en sortie
$this->addOutput([
@ -123,7 +171,22 @@ class page extends common {
* Création
*/
public function add() {
$pageTitle = 'Nouvelle page';
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Nouvelle page';
$text[1] = 'Contenu de votre nouvelle page.';
$text[2] = 'Nouvelle page créée';
break;
case 'en' :
$text[0] = 'New page';
$text[1] = 'Content of your new page';
$text[2] = 'New page created';
break;
}
$pageTitle = $text[0];
$pageId = helper::increment(helper::filter($pageTitle, helper::FILTER_ID), $this->getData(['page']));
$this->setData([
'page',
@ -159,13 +222,13 @@ class page extends common {
mkdir(self::DATA_DIR . self::$i18n . '/content', 0755);
}
//file_put_contents(self::DATA_DIR . self::$i18n . '/content/' . $pageId . '.html', '<p>Contenu de votre nouvelle page.</p>');
$this->setPage($pageId, '<p>Contenu de votre nouvelle page.</p>', self::$i18n);
$this->setPage($pageId, '<p>'.$text[1].'</p>', self::$i18n);
// Met à jour le site map
$this->createSitemap('all');
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $pageId,
'notification' => 'Nouvelle page créée',
'notification' => $text[2],
'state' => true
]);
}
@ -174,6 +237,25 @@ class page extends common {
* Suppression
*/
public function delete() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Jeton invalide';
$text[1] = 'Suppression non autorisée';
$text[2] = 'Désactiver la page dans la configuration avant de la supprimer';
$text[3] = 'Impossible de supprimer une page contenant des enfants';
$text[4] = 'Page supprimée';
break;
case 'en' :
$text[0] = 'Invalid token';
$text[1] = 'Unauthorised deletion';
$text[2] = 'Disable page in configuration before deleting';
$text[3] = 'Cannot delete page with children';
$text[4] = 'Page deleted';
break;
}
// $url prend l'adresse sans le token
$url = explode('&',$this->getUrl(2));
// La page n'existe pas
@ -187,14 +269,14 @@ class page extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'page/edit/' . $url[0],
'notification' => 'Jeton invalide'
'notification' => $text[0]
]);
}
elseif ($_GET['csrf'] !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'page/edit/' . $url[0],
'notification' => 'Suppression non autorisée'
'notification' => $text[1]
]);
}
// Impossible de supprimer la page d'accueil
@ -202,7 +284,7 @@ class page extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
'notification' => 'Désactiver la page dans la configuration avant de la supprimer'
'notification' => $text[2]
]);
}
// Impossible de supprimer la page de recherche affectée
@ -210,7 +292,7 @@ class page extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
'notification' => 'Désactiver la page dans la configuration avant de la supprimer'
'notification' => $text[2]
]);
}
// Impossible de supprimer la page des mentions légales affectée
@ -218,7 +300,7 @@ class page extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
'notification' => 'Désactiver la page dans la configuration avant de la supprimer'
'notification' => $text[2]
]);
}
// Impossible de supprimer la page des mentions légales affectée
@ -226,7 +308,7 @@ class page extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
'notification' => 'Désactiver la page dans la configuration avant de la supprimer'
'notification' => $text[2]
]);
}
// Impossible de supprimer la page des mentions légales affectée
@ -234,7 +316,7 @@ class page extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
'notification' => 'Désactiver la page dans la configuration avant de la supprimer'
'notification' => $text[2]
]);
}
// Impossible de supprimer la page des mentions légales affectée
@ -242,7 +324,7 @@ class page extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
'notification' => 'Désactiver la page dans la configuration avant de la supprimer'
'notification' => $text[2]
]);
}
// Jeton incorrect
@ -250,14 +332,14 @@ class page extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'page/edit/' . $url[0],
'notification' => 'Jeton invalide'
'notification' => $text[0]
]);
}
elseif ($_GET['csrf'] !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'page/edit/' . $url[0],
'notification' => 'Suppression non autorisée'
'notification' => $text[1]
]);
}
// Impossible de supprimer une page contenant des enfants
@ -265,7 +347,7 @@ class page extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'page/edit/' . $url[0],
'notification' => 'Impossible de supprimer une page contenant des enfants'
'notification' => $text[3]
]);
}
// Suppression
@ -288,7 +370,7 @@ class page extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl(false),
'notification' => 'Page supprimée',
'notification' => $text[4],
'state' => true
]);
}
@ -299,6 +381,19 @@ class page extends common {
* Édition
*/
public function edit() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Modifications enregistrées';
$text[1] ='Aucun';
break;
case 'en' :
$text[0] = 'Registered changes';
$text[1] ='None';
break;
}
// La page n'existe pas
if($this->getData(['page', $this->getUrl(2)]) === null) {
// Valeurs en sortie
@ -480,16 +575,17 @@ class page extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $pageId,
'notification' => 'Modifications enregistrées',
'notification' => $text[0],
'state' => true
]);
}
}
}
self::$moduleIds = array_merge( ['' => 'Aucun'] , helper::arrayCollumn(helper::getModules(),'realName','SORT_ASC')); // Pages sans parent
self::$moduleIds = array_merge( ['' => $text[1]] , helper::arrayCollumn(helper::getModules(),'realName','SORT_ASC')); // Pages sans parent
foreach($this->getHierarchy() as $parentPageId => $childrenPageIds) {
if($parentPageId !== $this->getUrl(2)) {
self::$pagesNoParentId[$parentPageId] = $this->getData(['page', $parentPageId, 'title']);
self::$pagesNoParentId_en[$parentPageId] = $this->getData(['page', $parentPageId, 'title']);
}
}
// Pages barre latérales
@ -497,10 +593,19 @@ class page extends common {
if($parentPageId !== $this->getUrl(2) &&
$this->getData(['page', $parentPageId, 'block']) === 'bar') {
self::$pagesBarId[$parentPageId] = $this->getData(['page', $parentPageId, 'title']);
self::$pagesBarId_en[$parentPageId] = $this->getData(['page', $parentPageId, 'title']);
}
}
// Mise à jour de la liste des pages pour TinyMCE
$this->pages2Json();
// Passage de la langue d'administration à Tinymce
$lang_admin = 'fr_FR';
if( $this->getData(['config', 'i18n', 'langAdmin']) ==='en') $lang_admin = 'en_GB';
?>
<script>
var lang_admin = "<?php echo $lang_admin ?>";
</script>
<?php
// Valeurs en sortie
$this->addOutput([
'title' => $this->getData(['page', $this->getUrl(2), 'title']),

View File

@ -20,7 +20,14 @@
*/
$("#pageEditDelete").on("click", function() {
var _this = $(this);
return core.confirm("Confirmez-vous la suppression de cette page ?", function() {
var text = "";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Êtes-vous sûr de vouloir supprimer cette page ?";' ;
}
else{
echo 'text = "Are you sure you want to delete this page ?";' ;
} ?>
return core.confirm( text, function() {
$(location).attr("href", _this.attr("href"));
});
});
@ -36,7 +43,17 @@ function protectModule() {
if ( oldModule !== "" &&
oldModule !== newModule) {
var _this = $(this);
core.confirm("Les données du module " + oldModuleText + " seront effacées. Confirmez-vous ?",
var text1 = "";
var text2 = "";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text1 = "Les données du module ";' ;
echo 'text2 = " seront effacées. Confirmez-vous ?";' ;
}
else{
echo 'text1 = "The data in the module ";' ;
echo 'text2 = " will be deleted. Do you confirm?";' ;
} ?>
core.confirm( text1 + oldModuleText + text2,
function() {
$(location).attr("href", _this.attr("href"));
return true;
@ -251,7 +268,7 @@ $( document ).ready(function() {
/**
* Cache le l'option "ne pas afficher les pages enfants dans le menu horizontal" lorsque la page est désactivée
* Cache l'option "ne pas afficher les pages enfants dans le menu horizontal" lorsque la page est désactivée
*/
var pageEditDisableDOM = $("#pageEditDisable");
pageEditDisableDOM.on("change", function() {
@ -528,14 +545,27 @@ var hierarchy = <?php echo json_encode($this->getHierarchy()); ?>;
var pages = <?php echo json_encode($this->getData(['page'])); ?>;
// 9.0.07 corrige une mauvaise sélection d'une page orpheline avec enfant
var positionInitial = <?php echo $this->getData(['page',$this->getUrl(2),"position"]); ?>;
// 9.0.07
$("#pageEditParentPageId").on("change", function() {
var positionDOM = $("#pageEditPosition");
var text1="";
var text2="";
var text3="";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text1 = "Ne pas afficher";' ;
echo 'text2 = "Au début";' ;
echo 'text3 = "Après \"";' ;
}
else{
echo 'text1 = "Do not display";' ;
echo 'text2 = "At the beginning";' ;
echo 'text3 = "After \"";' ;
} ?>
positionDOM.empty().append(
$("<option>").val(0).text("Ne pas afficher"),
$("<option>").val(1).text("Au début")
$("<option>").val(0).text(text1),
$("<option>").val(1).text(text2)
);
var parentSelected = $(this).val();
var positionSelected = 0;
@ -555,7 +585,7 @@ $("#pageEditParentPageId").on("change", function() {
positionPrevious++;
// Ajout à la liste
positionDOM.append(
$("<option>").val(positionPrevious).html("Après \"" + (pages[key].title) + "\"")
$("<option>").val(positionPrevious).html(text3 + (pages[key].title) + "\"")
);
}
}

View File

@ -1,3 +1,110 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Dupliquer';
$text[3] = 'Supprimer';
$text[4] = 'Enregistrer';
$text[5] = 'Informations générales';
$text[6] = 'Titre';
$text[7] = 'Titre court';
$text[8] = 'Le titre court est affiché dans les menus. Il peut être identique au titre de la page.';
$text[9] = 'En cas de changement de module, les données du module précédent seront supprimées.';
$text[10] = 'Module';
$text[11] = 'Aspect du lien';
$text[12] = 'Sélectionnez une image ou une icône de petite dimension';
$text[13] = 'Icône';
$text[14] = 'En position libre ajoutez le module en plaçant [MODULE] à l\'endroit voulu dans votre page.';
$text[15] = 'Position du module';
$text[16] = 'Mise en page';
$text[17] = 'Gabarits de page / Barre latérale';
$text[18] = 'Pour définir la page comme barre latérale, choisissez l\'option dans la liste.';
$text[19] = 'Barre latérale gauche :';
$text[20] = 'Barre latérale droite :';
$text[21] = 'Contenu du menu vertical';
$text[22] = 'Par défaut le menu est affiché APRES le contenu de la page. Pour le positionner à un emplacement précis, insérez [MENU] dans le contenu de la page.';
$text[23] = 'Emplacement dans le menu';
$text[24] = 'Position';
$text[25] = '\'Ne pas afficher\' crée une page orpheline non accessible par le biais des menus.';
$text[26] = 'Page parent';
$text[27] = 'Une page désactivée n\'est pas cliquable en mode déconnecté, les pages enfants sont visibles et accessibles. La page d\'accueil n\'est pas désactivable.';
$text[28] = 'Affiche le nom de la page parente suivi du nom de la page, le titre ne doit pas être masqué.';
$text[29] = 'Options d\'emplacement avancées';
$text[30] = 'Masquer les pages enfants dans le menu horizontal';
$text[31] = 'Masquer la page et les pages enfants dans le menu d\'une barre latérale';
$text[32] = 'La page est affichée dans un menu horizontal mais pas dans le menu vertical d\'une barre latérale.';
$text[33] = 'Permission et référencement';
$text[34] = 'Groupe requis pour accéder à la page :';
$text[35] = 'Méta-titre';
$text[36] = 'Méta-description';
$text[37] = 'Désactivée';
$text[38] = 'Nouvel onglet';
$text[39] = 'Titre masqué';
$text[40] = 'Fil d\'Ariane';
$typeMenu = $module::$typeMenu;
$modulePosition = $module::$modulePosition;
$pageBlocks = $module::$pageBlocks;
$displayMenu = $module::$displayMenu;
$groupPublics = self::$groupPublics;
$pagesBarId = $module::$pagesBarId;
$pagesNoParentId = $module::$pagesNoParentId;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Duplicate';
$text[3] = 'Delete';
$text[4] = 'OK';
$text[5] = 'General information';
$text[6] = 'Title';
$text[7] = 'Short title';
$text[8] = 'The short title is displayed in the menus. It can be identical to the page title.';
$text[9] = 'If the module is changed, the data of the previous module will be deleted.';
$text[10] = 'Module';
$text[11] = 'Aspect of the link';
$text[12] = 'Select a small image or icon';
$text[13] = 'Icon';
$text[14] = 'In free position add the module by placing [MODULE] at the desired location on your page.';
$text[15] = 'Module position';
$text[16] = 'Layout';
$text[17] = 'Page templates / Sidebar';
$text[18] = 'To set the page as a sidebar, choose the option from the list.';
$text[19] = 'Left sidebar :';
$text[20] = 'Right sidebar :';
$text[21] = 'Content of the vertical menu';
$text[22] = 'By default the menu is displayed AFTER the page content. To position it at a specific location, insert [MENU] into the page content.';
$text[23] = 'Location in the menu';
$text[24] = 'Position';
$text[25] = 'Do not display creates an orphan page that cannot be accessed via the menus.';
$text[26] = 'Parent page';
$text[27] = 'A deactivated page is not clickable in disconnected mode, the child pages are visible and accessible. The home page cannot be disabled.';
$text[28] = 'Displays the parent page name followed by the page name, the title should not be hidden.';
$text[29] = 'Advanced location options';
$text[30] = 'Hide child pages in the horizontal menu';
$text[31] = 'Hide the page and child pages in the sidebar menu';
$text[32] = 'The page is displayed in a horizontal menu but not in the vertical menu of a sidebar.';
$text[33] = 'Permission and referencing';
$text[34] = 'Group required to access the page:';
$text[35] = 'Meta title';
$text[36] = 'Meta description';
$text[37] = 'Disabled';
$text[38] = 'New tab';
$text[39] = 'Title hidden';
$text[40] = 'Breadcrumb';
$typeMenu = $module::$typeMenu_en;
$modulePosition = $module::$modulePosition_en;
$pageBlocks = $module::$pageBlocks_en;
$displayMenu = $module::$displayMenu_en;
$groupPublics = self::$groupPublics_en;
$pagesBarId = $module::$pagesBarId_en;
$pagesNoParentId = $module::$pagesNoParentId_en;
break;
}
?>
<?php echo template::formOpen('pageEditForm'); ?>
<div class="row">
<div class="col2">
@ -7,7 +114,7 @@
'class' => 'buttonGrey',
'href' => $href,
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -15,14 +122,14 @@
'href' => 'https://doc.deltacms.fr/edition',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset2">
<?php echo template::button('pageEditDuplicate', [
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2) . '&csrf=' . $_SESSION['csrf'],
'value' => 'Dupliquer',
'value' => $text[2],
'ico' => 'clone'
]); ?>
</div>
@ -30,20 +137,21 @@
<?php echo template::button('pageEditDelete', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '&csrf=' . $_SESSION['csrf'],
'value' => 'Supprimer',
'value' => $text[3],
'ico' => 'cancel'
]); ?>
</div>
<div class="col2">
<?php echo template::submit('pageEditSubmit', [
'uniqueSubmission' => true
'uniqueSubmission' => true,
'value' => $text[4]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="info">
<h4>Informations générales
<h4><?php echo $text[5]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/informations-generales" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -53,15 +161,15 @@
<div class="row">
<div class="col6">
<?php echo template::text('pageEditTitle', [
'label' => 'Titre',
'label' => $text[6],
'value' => $this->getData(['page', $this->getUrl(2), 'title'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('pageEditShortTitle', [
'label' => 'Titre Court',
'label' => $text[7],
'value' => $this->getData(['page', $this->getUrl(2), 'shortTitle']),
'help' => 'Le titre court est affiché dans les menus. Il peut être identique au titre de la page.'
'help' => $text[8]
]); ?>
</div>
<div class="col4">
@ -69,8 +177,8 @@
<div class="col9">
<?php echo template::hidden('pageEditModuleRedirect'); ?>
<?php echo template::select('pageEditModuleId', $module::$moduleIds, [
'help' => 'En cas de changement de module, les données du module précédent seront supprimées.',
'label' => 'Module',
'help' => $text[9],
'label' => $text[10],
'selected' => $this->getData(['page', $this->getUrl(2), 'moduleId'])
]); ?>
<?php echo template::hidden('pageEditModuleIdOld',['value' => $this->getData(['page', $this->getUrl(2), 'moduleId'])]); ?>
@ -90,22 +198,22 @@
</div>
<div class="row">
<div class="col4">
<?php echo template::select('pageTypeMenu', $module::$typeMenu,[
'label' => 'Aspect du lien',
<?php echo template::select('pageTypeMenu', $typeMenu,[
'label' => $text[11],
'selected' => $this->getData(['page', $this->getUrl(2), 'typeMenu'])
]); ?>
</div>
<div class="col4">
<?php echo template::file('pageIconUrl', [
'help' => 'Sélectionnez une image ou une icône de petite dimension',
'label' => 'Icône',
'help' => $text[12],
'label' => $text[13],
'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('configModulePosition', $module::$modulePosition,[
'help' => 'En position libre ajoutez le module en plaçant [MODULE] à l\'endroit voulu dans votre page.',
'label' => 'Position du module',
<?php echo template::select('configModulePosition', $modulePosition,[
'help' => $text[14],
'label' => $text[15],
'selected' => $this->getData(['page', $this->getUrl(2), 'modulePosition'])
]); ?>
</div>
@ -125,7 +233,7 @@
<div class="row">
<div class="col12" id="pageEditBlockLayout">
<div class="block">
<h4>Mise en page
<h4><?php echo $text[16]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/mise-en-page" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -137,9 +245,9 @@
<div class="col6">
<div class="row">
<div class="col12">
<?php echo template::select('pageEditBlock', $module::$pageBlocks, [
'label' => 'Gabarits de page / Barre latérale',
'help' => 'Pour définir la page comme barre latérale, choisissez l\'option dans la liste.',
<?php echo template::select('pageEditBlock', $pageBlocks, [
'label' => $text[17],
'help' => $text[18],
'selected' => $this->getData(['page', $this->getUrl(2) , 'block'])
]); ?>
</div>
@ -152,8 +260,8 @@
'value' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
]); ?>
<?php else: ?>
<?php echo template::select('pageEditBarLeft', $module::$pagesBarId, [
'label' => 'Barre latérale gauche :',
<?php echo template::select('pageEditBarLeft', $pagesBarId, [
'label' => $text[19],
'selected' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
]); ?>
<?php endif; ?>
@ -162,15 +270,15 @@
'value' => $this->getData(['page', $this->getUrl(2), 'barRight'])
]); ?>
<?php else: ?>
<?php echo template::select('pageEditBarRight', $module::$pagesBarId, [
'label' => 'Barre latérale droite :',
<?php echo template::select('pageEditBarRight', $pagesBarId, [
'label' => $text[20],
'selected' => $this->getData(['page', $this->getUrl(2), 'barRight'])
]); ?>
<?php endif; ?>
<?php echo template::select('pageEditDisplayMenu', $module::$displayMenu, [
'label' => 'Contenu du menu vertical',
<?php echo template::select('pageEditDisplayMenu', $displayMenu, [
'label' => $text[21],
'selected' => $this->getData(['page', $this->getUrl(2), 'displayMenu']),
'help' => 'Par défaut le menu est affiché APRES le contenu de la page. Pour le positionner à un emplacement précis, insérez [MENU] dans le contenu de la page.'
'help' => $text[22]
]); ?>
</div>
</div>
@ -181,7 +289,7 @@
<div class="row">
<div class="col12" id="pageEditMenu">
<div class="block">
<h4>Emplacement dans le menu
<h4><?php echo $text[23]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/emplacement-dans-le-menu" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -192,8 +300,8 @@
<div class="row">
<div class="col6">
<?php echo template::select('pageEditPosition', [], [
'label' => 'Position',
'help' => '\'Ne pas afficher\' crée une page orpheline non accessible par le biais des menus.'
'label' => $text[24],
'help' => $text[25]
]); ?>
</div>
<div class="col6">
@ -202,8 +310,8 @@
'value' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
]); ?>
<?php else: ?>
<?php echo template::select('pageEditParentPageId', $module::$pagesNoParentId, [
'label' => 'Page parent',
<?php echo template::select('pageEditParentPageId', $pagesNoParentId, [
'label' => $text[26],
'selected' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
]); ?>
<?php endif; ?>
@ -212,27 +320,27 @@
<div class="row">
<div class="col6">
<?php echo template::checkbox('pageEditDisable', true, 'Désactivée', [
<?php echo template::checkbox('pageEditDisable', true, $text[37], [
'checked' => $this->getData(['page', $this->getUrl(2), 'disable']),
'help' => 'Une page désactivée n\'est pas cliquable en mode déconnecté, les pages enfants sont visibles et accessibles. La page d\'accueil n\'est pas désactivable.'
'help' => $text[27]
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('pageEditTargetBlank', true, 'Nouvel onglet', [
<?php echo template::checkbox('pageEditTargetBlank', true, $text[38], [
'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('pageEditHideTitle', true, 'Titre masqué', [
<?php echo template::checkbox('pageEditHideTitle', true, $text[39], [
'checked' => $this->getData(['page', $this->getUrl(2), 'hideTitle'])
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('pageEditbreadCrumb', true, 'Fil d\'Ariane', [
<?php echo template::checkbox('pageEditbreadCrumb', true, $text[40], [
'checked' => $this->getData(['page', $this->getUrl(2), 'breadCrumb']),
'help' => 'Affiche le nom de la page parente suivi du nom de la page, le titre ne doit pas être masqué.'
'help' => $text[28]
]); ?>
</div>
</div>
@ -243,7 +351,7 @@
<div class='row' id="pageEditAdvancedWrapper">
<div class="col12">
<div class="block">
<h4>Options d'emplacement avancées
<h4><?php echo $text[29]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/options-d-emplacement-avancees" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -253,14 +361,14 @@
<div class="blockContainer">
<div class="row">
<div class="col6">
<?php echo template::checkbox('pageEditHideMenuChildren', true, 'Masquer les pages enfants dans le menu horizontal', [
<?php echo template::checkbox('pageEditHideMenuChildren', true, $text[30], [
'checked' => $this->getData(['page', $this->getUrl(2), 'hideMenuChildren'])
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('pageEditHideMenuSide', true, 'Masquer la page et les pages enfants dans le menu d\'une barre latérale' , [
<?php echo template::checkbox('pageEditHideMenuSide', true, $text[31] , [
'checked' => $this->getData(['page', $this->getUrl(2), 'hideMenuSide']),
'help' => 'La page est affichée dans un menu horizontal mais pas dans le menu vertical d\'une barre latérale.'
'help' => $text[32]
]); ?>
</div>
</div>
@ -271,7 +379,7 @@
<div class='row' id="pageEditSeoWrapper">
<div class="col12">
<div class="block">
<h4>Permission et référencement
<h4><?php echo $text[33]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/permission-et-referencement" target="_blank">
<?php echo template::ico('help', 'left');?>
@ -281,18 +389,18 @@
<div class="blockContainer">
<div class="row">
<div class='col6'>
<?php echo template::select('pageEditGroup', self::$groupPublics, [
'label' => 'Groupe requis pour accéder à la page :',
<?php echo template::select('pageEditGroup', $groupPublics, [
'label' => $text[34],
'selected' => $this->getData(['page', $this->getUrl(2), 'group'])
]); ?>
</div>
<div class='col12'>
<?php echo template::text('pageEditMetaTitle', [
'label' => 'Méta-titre',
'label' => $text[35],
'value' => $this->getData(['page', $this->getUrl(2), 'metaTitle'])
]); ?>
<?php echo template::textarea('pageEditMetaDescription', [
'label' => 'Méta-description',
'label' => $text[36],
//'maxlength' => '500',
'value' => $this->getData(['page', $this->getUrl(2), 'metaDescription'])
]); ?>

View File

@ -27,8 +27,18 @@ class sitemap extends common
/**
* Plan du site
*/
public function index()
{
public function index() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langBase']);
switch ($val) {
case 'fr' :
$text[0] = 'Plan du site';
break;
default :
$text[0] = 'Site map';
break;
}
$items = '<ul>';
foreach ($this->getHierarchy(null, true, null) as $parentId => $childIds) {
$items .= ' <li>';
@ -108,7 +118,7 @@ class sitemap extends common
// Valeurs en sortie
$this->addOutput([
'title' => 'Plan du site',
'title' => $text[0],
'view' => 'index'
]);
}

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,14 @@
*/
$(".fontDelete").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer cette police ?", function() {
var text="";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Êtes-vous sûr de vouloir supprimer cette police ?";' ;
}
else{
echo 'text = "Are you sure you want to delete this font ?";' ;
} ?>
return core.confirm(text, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -1,3 +1,40 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Enregistrer';
$text[3] = 'Paramètres de la nouvelle police';
$text[4] = 'Nom';
$text[5] = 'Nom de la police, majuscules et espaces autorisés';
$text[6] = 'Liaison avec un fichier de police';
$text[7] = 'Le fichier de police est envoyé, ou pas, depuis un dépôt local';
$text[8] = 'Vous devez au préalable téléverser le fichier de police, ttf, woff, otf, eot ou woff2 dans le dossier fonts avec le gestionnaire de fichiers.';
$text[9] = 'Sélection d\'une police';
$text[10] = 'License';
$text[11] = 'Type de license de la police';
$typeAddFont = $module::$typeAddFont;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Save';
$text[3] = 'New font settings';
$text[4] = 'Name';
$text[5] = 'Font name, upper case and spaces allowed';
$text[6] = 'Link to a font file';
$text[7] = 'The font file is sent, or not, from a local repository';
$text[8] = 'You must first upload the font file, ttf, woff, otf, eot or woff2 to the fonts folder with the file manager';
$text[9] = 'Select a font';
$text[10] = 'License';
$text[11] = 'License type of the font';
$typeAddFont = $module::$typeAddFont_en;
break;
}
?>
<?php echo template::formOpen('themeAddFonts'); ?>
<div class="row">
@ -6,7 +43,7 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme/fonts',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -14,37 +51,39 @@
'href' => 'https://doc.deltacms.fr/polices',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('addFontSubmit'); ?>
<?php echo template::submit('addFontSubmit',[
'value' => $text[2]
]); ?>
</div>
</div>
<div class="block">
<h4>Paramètres de la nouvelle police</h4>
<h4><?php echo $text[3]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::text('nameAddFont', [
'autocomplete' => 'off',
'label' => 'Nom',
'help' => 'Nom de la police, majuscules et espaces autorisés'
'label' => $text[4],
'help' => $text[5]
]); ?>
</div>
<div class="col4">
<?php echo template::select('typeAddFont', $module::$typeAddFont, [
'label' => 'Liaison avec un fichier de police',
<?php echo template::select('typeAddFont', $typeAddFont, [
'label' => $text[6],
'selected' => 'file',
'help' => 'Le fichier de police est envoyé, ou pas, depuis un dépôt local'
'help' => $text[7]
]); ?>
</div>
<div class="col4">
<!-- Sélection d'un fichier font -->
<?php echo template::select('fileAddFont', $module::$fontFiles, [
'help' => 'Vous devez au préalable téléverser le fichier de police, ttf, woff, otf, eot ou woff2 dans le dossier fonts avec le gestionnaire de fichiers.',
'label' => 'Sélection d\'une police'
'help' => $text[8],
'label' => $text[9]
]); ?>
</div>
</div>
@ -53,8 +92,8 @@
<div class="col4">
<?php echo template::text('licenseAddFont', [
'autocomplete' => 'off',
'label' => 'License',
'help' => 'Type de license de la police'
'label' => $text[10],
'help' => $text[11]
]); ?>
</div>
</div>

View File

@ -56,7 +56,14 @@ $("input, select").on("change", function() {
*/
$("#configAdminReset").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir réinitialiser à son état d'origine le thème de l\'administration ?", function() {
var text="";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Êtes-vous sûr de vouloir réinitialiser à son état d\'origine le thème de l\'administration ?";' ;
}
else{
echo 'text = "Are you sure you want to reset the administration theme to its original state ?";' ;
} ?>
return core.confirm(text, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -1,3 +1,56 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[3] = 'Réinitialiser';
$text[4] = 'Valider';
$text[5] = 'Couleurs';
$text[6] = 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.';
$text[7] = 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence. La couleur du texte est automatique.';
$text[8] = 'Arrière-plan';
$text[9] = 'Titres';
$text[10] = 'Texte';
$text[11] = 'Arrière-plan des champs';
$text[12] = 'Bordure des champs';
$text[13] = 'Bouton Aide';
$text[14] = 'Bouton retour';
$text[15] = 'Bouton standard';
$text[16] = 'Bouton effacement';
$text[17] = 'Bouton validation';
$text[18] = 'Mise en forme du texte';
$text[19] = 'Police du texte';
$text[20] = 'Taille';
$text[21] = 'Police des titres';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[3] = 'Reset';
$text[4] = 'Validate';
$text[5] = 'Colors';
$text[6] = 'The colour visible in the absence of an image.<br /> The horizontal slider adjusts the level of transparency.';
$text[7] = 'The colour visible in the absence of an image.<br /> The horizontal slider adjusts the level of transparency. The text colour is automatic.';
$text[8] = 'Background';
$text[9] = 'Title';
$text[10] = 'Text';
$text[11] = 'Field background';
$text[12] = 'Field border';
$text[13] = 'Help button';
$text[14] = 'Back button';
$text[15] = 'Standard button';
$text[16] = 'Delete button';
$text[17] = 'Validation button';
$text[18] = 'Text formatting';
$text[19] = 'Text font';
$text[20] = 'Size';
$text[21] = 'Title font';
break;
}
?>
<?php echo template::formOpen('configAdminForm'); ?>
<div class="row">
<div class="col2">
@ -5,7 +58,7 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -13,26 +66,21 @@
'href' => 'https://doc.deltacms.fr/administration',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset2">
<?php echo template::button('configAdminTest', [
'value' => 'Bouton Standard'
]); ?>
</div>
<div class="col2 offset">
<div class="col2 offset4">
<?php echo template::button('configAdminReset', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'theme/reset/admin' . '&csrf=' . $_SESSION['csrf'],
'value' => 'Réinitialiser',
'value' => $text[3],
'ico' => 'cancel'
]); ?>
</div>
<div class="col2">
<?php echo template::submit('configAdminSubmit',[
'value' => 'Valider',
'value' => $text[4],
'ico' => 'check'
]); ?>
</div>
@ -40,29 +88,29 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Couleurs</h4>
<h4><?php echo $text[5]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::text('adminBackgroundColor', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Arrière-plan',
'help' => $text[6],
'label' => $text[8],
'value' => $this->getData(['admin', 'backgroundColor'])
]); ?>
</div>
<div class="col4">
<?php echo template::text('adminColorTitle', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Titres',
'help' => $text[6],
'label' => $text[9],
'value' => $this->getData(['admin', 'colorTitle'])
]); ?>
</div>
<div class="col4">
<?php echo template::text('adminColorText', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Texte',
'help' => $text[6],
'label' => $text[10],
'value' => $this->getData(['admin', 'colorText'])
]); ?>
</div>
@ -71,24 +119,24 @@
<div class="col4">
<?php echo template::text('adminBackGroundBlockColor', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence. La couleur du texte est automatique.',
'label' => 'Arrière-plan des champs',
'help' => $text[7],
'label' => $text[11],
'value' => $this->getData(['admin', 'backgroundBlockColor'])
]); ?>
</div>
<div class="col4">
<?php echo template::text('adminBorderBlockColor', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Bordure des champs',
'help' => $text[6],
'label' => $text[12],
'value' => $this->getData(['admin', 'borderBlockColor'])
]); ?>
</div>
<div class="col3 offset1">
<?php echo template::text('adminColorHelp', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Bouton Aide',
'help' => $text[6],
'label' => $text[13],
'value' => $this->getData(['admin', 'backgroundColorButtonHelp'])
]); ?>
</div>
@ -97,32 +145,32 @@
<div class="col3">
<?php echo template::text('adminColorGrey', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Bouton retour',
'help' => $text[6],
'label' => $text[14],
'value' => $this->getData(['admin', 'backgroundColorButtonGrey'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('adminColorButton', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Bouton standard',
'help' => $text[6],
'label' => $text[15],
'value' => $this->getData(['admin', 'backgroundColorButton'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('adminColorRed', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Bouton effacement',
'help' => $text[6],
'label' => $text[16],
'value' => $this->getData(['admin', 'backgroundColorButtonRed'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('adminColorGreen', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Bouton validation',
'help' => $text[6],
'label' => $text[17],
'value' => $this->getData(['admin', 'backgroundColorButtonGreen'])
]); ?>
</div>
@ -133,24 +181,24 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Mise en forme du texte</h4>
<h4><?php echo $text[18]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::select('adminFontText', $module::$fonts, [
'label' => 'Police du texte',
'label' => $text[19],
'selected' => $this->getData(['admin', 'fontText']),
'fonts' => true
]); ?>
</div>
<div class="col4">
<?php echo template::select('adminFontTextSize', $module::$siteFontSizes, [
'label' => 'Taille',
'label' => $text[20],
'selected' => $this->getData(['admin', 'fontSize'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('adminFontTitle', $module::$fonts, [
'label' => 'Police des titres',
'label' => $text[21],
'selected' => $this->getData(['admin', 'fontTitle']),
'fonts' => true
]); ?>

View File

@ -32,7 +32,14 @@ $("#themeAdvancedCss").on("change keydown keyup", function() {
*/
$("#themeAdvancedReset").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir réinitialiser à son état d'origine la personnalisation avancée ?", function() {
var text="";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Êtes-vous sûr de vouloir réinitialiser à son état d\'origine la personnalisation avancée ?";' ;
}
else{
echo 'text = "Are you sure you want to reset the advanced customization to its original state ?";' ;
} ?>
return core.confirm(text, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -1,3 +1,22 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Réinitialiser';
$text[3] = 'Enregistrer';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Reset';
$text[3] = 'Save';
break;
}
?>
<?php echo template::formOpen('themeAdvancedForm'); ?>
<div class="row">
<div class="col2">
@ -5,7 +24,7 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -13,7 +32,7 @@
'href' => 'https://doc.deltacms.fr/editeur-css',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
@ -22,11 +41,13 @@
'href' => helper::baseUrl() . 'theme/reset/custom' . '&csrf=' . $_SESSION['csrf'],
'class' => 'buttonRed',
'ico' => 'cancel',
'value' => 'Réinitialiser'
'value' => $text[2]
]); ?>
</div>
<div class="col2">
<?php echo template::submit('themeAdvancedSubmit'); ?>
<?php echo template::submit('themeAdvancedSubmit',[
'value' => $text[3]
]); ?>
</div>
</div>
<div class="row">

View File

@ -1,3 +1,54 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Enregistrer';
$text[3] = 'Couleurs';
$text[4] = 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.';
$text[5] = 'Arrière-plan';
$text[6] = 'Le curseur horizontal règle le niveau de transparence.';
$text[7] = 'Fond icône haut de page';
$text[8] = 'Icône haut de page';
$text[9] = 'Image';
$text[10] = 'Sélectionner une image';
$text[11] = 'Arrière-plan';
$text[12] = 'Répétition';
$text[13] = 'Position';
$text[14] = 'Défilement';
$text[15] = 'Taille';
$repeats = $module::$repeats;
$imagePositions = $module::$imagePositions;
$attachments = $module::$attachments;
$bodySizes = $module::$bodySizes;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Save';
$text[3] = 'Colors';
$text[4] = 'Color visible in the absence of an image.<br />The horizontal slider adjusts the level of transparency.';
$text[5] = 'Background';
$text[6] = 'The horizontal slider sets the transparency level';
$text[7] = 'Top icon background';
$text[8] = 'Top icon';
$text[9] = 'Image';
$text[10] = 'Select an image';
$text[11] = 'Background';
$text[12] = 'Repeat';
$text[13] = 'Position';
$text[14] = 'Scroll';
$text[15] = 'Size';
$repeats = $module::$repeats_en;
$imagePositions = $module::$imagePositions_en;
$attachments = $module::$attachments_en;
$bodySizes = $module::$bodySizes_en;
break;
}
?>
<?php echo template::formOpen('themeBodyForm'); ?>
<div class="row">
<div class="col2">
@ -5,7 +56,7 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -13,24 +64,26 @@
'href' => 'https://doc.deltacms.fr/personnalisation-de-l-arriere-plan',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('themeBodySubmit'); ?>
<?php echo template::submit('themeBodySubmit',[
'value' => $text[2]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Couleurs</h4>
<h4><?php echo $text[3]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::text('themeBodyBackgroundColor', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Arrière-plan',
'help' => $text[4],
'label' => $text[5],
'value' => $this->getData(['theme', 'body', 'backgroundColor'])
]); ?>
</div>
@ -39,16 +92,16 @@
<div class="col6">
<?php echo template::text('themeBodyToTopBackground', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Fond icône haut de page',
'help' => $text[6],
'label' => $text[7],
'value' => $this->getData(['theme', 'body', 'toTopbackgroundColor'])
]); ?>
</div>
<div class="col6">
<?php echo template::text('themeBodyToTopColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Icône haut de page',
'help' => $text[6],
'label' => $text[8],
'value' => $this->getData(['theme', 'body', 'toTopColor'])
]); ?>
</div>
@ -59,14 +112,14 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Image</h4>
<h4><?php echo $text[9]; ?></h4>
<div class="row">
<div class="col12">
<?php
$imageFile = file_exists(self::FILE_DIR.'source/'.$this->getData(['theme', 'body', 'image'])) ? $this->getData(['theme', 'body', 'image']) : "";
echo template::file('themeBodyImage', [
'help' => 'Sélectionner une image',
'label' => 'Arrière-plan',
'help' => $text[10],
'label' => $text[11],
'type' => 1,
'value' => $imageFile
]); ?>
@ -75,28 +128,28 @@
<div id="themeBodyImageOptions" class="displayNone">
<div class="row">
<div class="col6">
<?php echo template::select('themeBodyImageRepeat', $module::$repeats, [
'label' => 'Répétition',
<?php echo template::select('themeBodyImageRepeat', $repeats, [
'label' => $text[12],
'selected' => $this->getData(['theme', 'body', 'imageRepeat'])
]); ?>
</div>
<div class="col6">
<?php echo template::select('themeBodyImagePosition', $module::$imagePositions, [
'label' => 'Position',
<?php echo template::select('themeBodyImagePosition', $imagePositions, [
'label' => $text[13],
'selected' => $this->getData(['theme', 'body', 'imagePosition'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::select('themeBodyImageAttachment', $module::$attachments, [
'label' => 'Défilement',
<?php echo template::select('themeBodyImageAttachment', $attachments, [
'label' => $text[14],
'selected' => $this->getData(['theme', 'body', 'imageAttachment'])
]); ?>
</div>
<div class="col6">
<?php echo template::select('themeBodyImageSize', $module::$bodySizes, [
'label' => 'Taille',
<?php echo template::select('themeBodyImageSize', $bodySizes, [
'label' => $text[15],
'selected' => $this->getData(['theme', 'body', 'imageSize'])
]); ?>
</div>

View File

@ -1,3 +1,40 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Enregistrer';
$text[3] = 'Paramètres de la police';
$text[4] = 'Nom de la police sélectionnée';
$text[5] = 'Valeur non modifiable';
$text[6] = 'Liaison avec un fichier de police';
$text[7] = 'Le fichier de police est envoyé, ou pas, depuis un dépôt local';
$text[8] = 'Vous devez au préalable téléverser le fichier de police, ttf, woff, otf, eot ou woff2 dans le dossier fonts avec le gestionnaire de fichiers.';
$text[9] = 'Sélection d\'une police';
$text[10] = 'License';
$text[11] = 'Type de license de la police';
$typeAddFont = $module::$typeAddFont;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Save';
$text[3] = 'Font settings';
$text[4] = 'Selected font name';
$text[5] = 'Value not editable';
$text[6] = 'Link to a font file';
$text[7] = 'The font file is sent, or not, from a local repository';
$text[8] = 'You must first upload the font file, ttf, woff, otf, eot or woff2 to the fonts folder with the file manager';
$text[9] = 'Select a font';
$text[10] = 'License';
$text[11] = 'License type of the font';
$typeAddFont = $module::$typeAddFont_en;
break;
}
?>
<?php echo template::formOpen('themeEditFonts'); ?>
<div class="row">
@ -6,7 +43,7 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme/fonts',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -14,31 +51,33 @@
'href' => 'https://doc.deltacms.fr/polices',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('editFontSubmit'); ?>
<?php echo template::submit('editFontSubmit',[
'value' => $text[2]
]); ?>
</div>
</div>
<div class="block">
<h4>Paramètres de la police </h4>
<h4><?php echo $text[3]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::text('nameEditFont', [
'value' => $this->getData(['fonts', $this->getUrl(2),'name']),
'label' => 'Nom de la police sélectionnée',
'label' => $text[4],
'readonly' => true,
'help' => 'Valeur non modifiable'
'help' => $text[5]
]); ?>
</div>
<div class="col4">
<?php echo template::select('typeEditFont', $module::$typeAddFont, [
'label' => 'Liaison avec un fichier de police',
<?php echo template::select('typeEditFont', $typeAddFont, [
'label' => $text[6],
'selected' => $this->getData(['fonts', $this->getUrl(2),'type']),
'help' => 'Le fichier de police est envoyé, ou pas, depuis un dépôt local'
'help' => $text[7]
]); ?>
</div>
<div class="col4">
@ -46,8 +85,8 @@
<?php $key = array_search( $this->getData(['fonts', $this->getUrl(2),'file']), $module::$fontFiles);
echo template::select('fileEditFont', $module::$fontFiles, [
'selected' => $key,
'help' => 'Vous devez au préalable téléverser le fichier de police, ttf, woff, otf, eot ou woff2 dans le dossier fonts avec le gestionnaire de fichiers.',
'label' => 'Sélection d\'une police'
'help' => $text[8],
'label' => $text[9]
]); ?>
</div>
</div>
@ -56,8 +95,8 @@
<div class="col4">
<?php echo template::text('licenseEditFont', [
'value' => $this->getData(['fonts', $this->getUrl(2),'license']),
'label' => 'License',
'help' => 'Type de license de la police'
'label' => $text[10],
'help' => $text[11]
]); ?>
</div>
</div>

View File

@ -19,7 +19,14 @@
*/
$(".fontDelete").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer cette police ?", function() {
var text="";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Êtes-vous sûr de vouloir supprimer cette police ?";' ;
}
else{
echo 'text = "Are you sure you want to delete this font ?";' ;
} ?>
return core.confirm(text, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -1,10 +1,35 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Police';
$text[3] = 'Identifiant';
$text[4] = 'Nom';
$text[5] = 'Fichier';
$text[6] = 'Aperçu';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Police';
$text[3] = 'Username';
$text[4] = 'Name';
$text[5] = 'File';
$text[6] = 'Preview';
break;
}
?>
<div class="row">
<div class="col2">
<?php echo template::button('themeFontsBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -12,7 +37,7 @@
'href' => 'https://doc.deltacms.fr/polices',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
@ -20,9 +45,9 @@
<?php echo template::button('fontAdd', [
'href' => helper::baseUrl() . 'theme/addFonts',
'ico' => 'plus',
'value' => 'Police'
'value' => $text[2]
]); ?>
</div>
</div>
<?php echo template::table([2, 2, 3, 3, 1, 1], $module::$fonts, ['Identifiant', 'Nom', 'Fichier', 'Aperçu', '', '']); ?>
<?php echo template::table([2, 2, 3, 3, 1, 1], $module::$fonts, [$text[3], $text[4], $text[5], $text[6], '', '']); ?>

View File

@ -120,12 +120,25 @@ $(".themeFooterContent").on("change",function() {
// Modification dynamique de la mise en page
$("#themeFooterTemplate").on("change",function() {
// Nettoyage des sélecteurs des contenus
var newOptions = {
var newOptions = {};
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo " newOptions = {
4: {'hide' : 'Masqué', 'left' : 'En haut', 'center' : 'Au milieu', 'right' : 'En bas'} ,
3: {'hide': 'Masqué', 'left': 'A gauche', 'center': 'Au centre', 'right': 'A droite'} ,
2: {'hide': 'Masqué', 'left': 'A gauche', 'right': 'A droite'} ,
1: {'hide': 'Masqué', 'center': 'Affiché'}
};
};";
}
else{
echo " newOptions = {
4: {'hide' : 'Hidden', 'left' : 'Top', 'center' : 'Middle', 'right' : 'Bottom'} ,
3: {'hide': 'Hidden', 'left': 'Left', 'center': 'Center', 'right': 'Right'} ,
2: {'hide': 'Hidden', 'left': 'Left', 'right': 'Right'} ,
1: {'hide': 'Hidden', 'center': 'Display'}
};" ;
} ?>
var $el = $(".themeFooterContent");
$el.empty();
// Eléments des position de contenus

View File

@ -1,3 +1,122 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Enregistrer';
$text[3] = 'Paramètres';
$text[4] = 'Position';
$text[5] = 'Marges verticales';
$text[6] = 'Couleurs';
$text[7] = 'Texte';
$text[8] = 'Arrière-plan';
$text[9] = 'Quand le pied de page est dans le site, l\'arrière plan transparent montre le fond de la page. Quand le pied de page est hors du site, l\'arrière plan transparent montre le fond du site.';
$text[10] = 'Contenu';
$text[11] = 'Motorisé par';
$text[12] = 'Affiche cette mention devant DeltaCMS';
$text[13] = 'Version';
$text[14] = 'Affiche le numéro de version après DeltaCMS';
$text[15] = 'Plan du site';
$text[16] = 'Cookies';
$text[17] = 'Message d\'information relatif aux cookies, disponible si l\'acceptation des cookies est activé.';
$text[18] = 'Lien de connexion';
$text[19] = 'Pour limiter les tentatives de piratage, enregistrez la page de connexion en favori et désactivez cette option.';
$text[20] = 'Barre du membre';
$text[21] = 'Affiche les icônes de gestion du compte et de déconnexion des membres simples connectés, ne s\'applique pas aux éditeurs et administrateurs.';
$text[22] = 'Mentions légales';
$text[23] = 'Option active si une page a été sélectionnée.';
$text[24] = 'Aucune';
$text[25] = 'Page "Mentions légales" ';
$text[26] = 'Rechercher';
$text[27] = 'Option active si une page a été sélectionnée.';
$text[28] = 'Page "Rechercher" ';
$text[29] = 'Options identique à la configuration du site';
$text[30] = 'Mise en forme du texte';
$text[31] = 'Police';
$text[32] = 'Taille';
$text[33] = 'Proportionnelle à celle définie dans le site.';
$text[34] = 'Style';
$text[35] = 'Casse';
$text[36] = 'Dispositions';
$text[37] = 'Répartition';
$text[38] = 'Contenu personnalisé';
$text[39] = 'Position';
$text[40] = 'Alignement';
$text[41] = 'Réseaux sociaux';
$text[42] = 'Informations';
$text[43] = 'Alignement avec le contenu';
$text[44] = 'Pied de page fixe';
$text[45] = 'Contenu personnalisé';
$footerPositions = $module::$footerPositions;
$footerHeights = $module::$footerHeights;
$footerFontSizes = $module::$footerFontSizes;
$fontWeights = $module::$fontWeights;
$textTransforms = $module::$textTransforms;
$footerblocks = $module::$footerblocks;
$footerTemplate = $module::$footerTemplate;
$aligns = $module::$aligns;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Save';
$text[3] = 'Settings';
$text[4] = 'Position';
$text[5] = 'Vertical margins';
$text[6] = 'Colours';
$text[7] = 'Text';
$text[8] = 'Background';
$text[9] = 'When the footer is inside the site, the transparent background shows the page background. When the footer is outside the site, the transparent background shows the site background';
$text[10] = 'Content';
$text[11] = 'Powered by';
$text[12] = 'Displays this in front of DeltaCMS';
$text[13] = 'Version';
$text[14] = 'Displays the version number after DeltaCMS';
$text[15] = 'Site map';
$text[16] = 'Cookies';
$text[17] = 'Cookie information message, available if cookie acceptance is enabled';
$text[18] = 'Login link';
$text[19] = 'To limit hacking attempts, save the login page as a favourite and disable this option';
$text[20] = 'Member bar';
$text[21] = 'Displays account management and logout icons for simple logged-in members, does not apply to editors and administrators';
$text[22] = 'Legal notice';
$text[23] = 'Option active if a page has been selected';
$text[24] = 'None';
$text[25] = 'Legal page ';
$text[26] = 'Search';
$text[27] = 'Option active if a page has been selected';
$text[28] = 'Search page ';
$text[29] = 'Options same as site configuration';
$text[30] = 'Text formatting';
$text[31] = 'Font';
$text[32] = 'Size';
$text[33] = 'Proportional to that defined in the site';
$text[34] = 'Style';
$text[35] = 'Character case';
$text[36] = 'Layout';
$text[37] = 'Breakdown';
$text[38] = 'Custom content';
$text[39] = 'Position';
$text[40] = 'Alignment';
$text[41] = 'Social networks';
$text[42] = 'Information';
$text[43] = 'Alignment with content';
$text[44] = 'Fixed footer';
$text[45] = 'Customised content';
$footerPositions = $module::$footerPositions_en;
$footerHeights = $module::$footerHeights_en;
$footerFontSizes = $module::$footerFontSizes_en;
$fontWeights = $module::$fontWeights_en;
$textTransforms = $module::$textTransforms_en;
$footerblocks = $module::$footerblocks_en;
$footerTemplate = $module::$footerTemplate_en;
$aligns = $module::$aligns_en;
break;
}
?>
<?php echo template::formOpen('themeFooterForm'); ?>
<div class="row">
<div class="col2">
@ -5,7 +124,7 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -13,28 +132,30 @@
'href' => 'https://doc.deltacms.fr/personnalisation-du-pied-de-page',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('themeFooterSubmit'); ?>
<?php echo template::submit('themeFooterSubmit',[
'value' => $text[2]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres</h4>
<h4><?php echo $text[3]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::select('themeFooterPosition', $module::$footerPositions, [
'label' => 'Position',
<?php echo template::select('themeFooterPosition', $footerPositions, [
'label' => $text[4],
'selected' => $this->getData(['theme', 'footer', 'position'])
]); ?>
</div>
<div class="col6">
<?php echo template::select('themeFooterHeight', $module::$footerHeights, [
'label' => 'Marges verticales',
<?php echo template::select('themeFooterHeight', $footerHeights, [
'label' => $text[5],
'selected' => $this->getData(['theme', 'footer', 'height'])
]); ?>
</div>
@ -45,21 +166,21 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Couleurs</h4>
<h4><?php echo $text[6]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::text('themeFooterTextColor', [
'class' => 'colorPicker',
'label' => 'Texte',
'label' => $text[7],
'value' => $this->getData(['theme', 'footer', 'textColor'])
]); ?>
</div>
<div class="col6">
<?php echo template::text('themeFooterBackgroundColor', [
'class' => 'colorPicker',
'label' => 'Arrière-plan',
'label' => $text[8],
'value' => $this->getData(['theme', 'footer', 'backgroundColor']),
'help' => 'Quand le pied de page est dans le site, l\'arrière plan transparent montre le fond de la page. Quand le pied de page est hors du site, l\'arrière plan transparent montre le fond du site.'
'help' => $text[9]
]); ?>
</div>
</div>
@ -69,75 +190,77 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Contenu</h4>
<h4><?php echo $text[10]; ?></h4>
<div class="row">
<div class="col3">
<?php echo template::checkbox('themefooterDisplayCopyright', true, 'Motorisé par', [
<?php echo template::checkbox('themefooterDisplayCopyright', true, $text[11], [
'checked' => $this->getData(['theme', 'footer','displayCopyright']),
'help' => 'Affiche cette mention devant DeltaCMS'
'help' => $text[12]
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('themefooterDisplayVersion', true, 'Version', [
<?php echo template::checkbox('themefooterDisplayVersion', true, $text[13], [
'checked' => $this->getData(['theme', 'footer','displayVersion']),
'help' => 'Affiche le numéro de version après DeltaCMS'
'help' => $text[14]
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('themefooterDisplaySiteMap', true, 'Plan du site', [
<?php echo template::checkbox('themefooterDisplaySiteMap', true, $text[15], [
'checked' => $this->getData(['theme', 'footer', 'displaySiteMap'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('themefooterDisplayCookie', true, 'Cookies', [
<?php echo template::checkbox('themefooterDisplayCookie', true, $text[16], [
'checked' => $this->getData(['config', 'cookieConsent']) === true ? $this->getData(['theme', 'footer', 'displayCookie']) : false,
'help' => 'Message d\'information relatif aux cookies, disponible si l\'acceptation des cookies est activé.',
'help' => $text[17],
'disabled' => !$this->getData(['config', 'cookieConsent'])
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::checkbox('themeFooterLoginLink', true, 'Lien de connexion', [
<?php echo template::checkbox('themeFooterLoginLink', true, $text[18], [
'checked' => $this->getData(['theme', 'footer', 'loginLink']),
'help' => 'Pour limiter les tentatives de piratage, enregistrez la page de connexion en favori et désactivez cette option.'
'help' => $text[19]
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('themeFooterDisplayMemberBar', true, 'Barre du membre', [
<?php echo template::checkbox('themeFooterDisplayMemberBar', true, $text[20], [
'checked' => $this->getData(['theme', 'footer', 'displayMemberBar']),
'help' => 'Affiche les icônes de gestion du compte et de déconnexion des membres simples connectés, ne s\'applique pas aux éditeurs et administrateurs.'
'help' => $text[21]
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::checkbox('themeFooterDisplayLegal', true, 'Mentions légales', [
<?php echo template::checkbox('themeFooterDisplayLegal', true, $text[22], [
'checked' => $this->getData(['locale', 'legalPageId']) === 'none' ? false : $this->getData(['theme', 'footer', 'displayLegal']),
'disabled' => $this->getData(['locale', 'legalPageId']) === 'none' ? true : false,
'help' => 'Option active si une page a été sélectionnée.'
'help' => $text[23]
]); ?>
</div>
<div class="col3">
<?php echo template::select('configLegalPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
'label' => 'Page "Mentions légales" ' . template::flag('site', '20px'),
<?php // drapeau pour la langue d'origine ou la langue en traduction rédigée
$flag = 'site';
if( $this->getInput('DELTA_I18N_SITE') === 'base') $flag = $this->getData(['config', 'i18n', 'langBase']); ?>
<?php echo template::select('configLegalPageId', array_merge(['none' => $text[24]] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
'label' => $text[25] . template::flag($flag, '20px'),
'selected' => $this->getData(['locale', 'legalPageId'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('themeFooterDisplaySearch', true, 'Rechercher', [
<?php echo template::checkbox('themeFooterDisplaySearch', true, $text[26], [
'checked' => $this->getData(['locale', 'searchPageId']) === 'none' ? false : $this->getData(['theme', 'footer', 'displaySearch']),
'disabled' => $this->getData(['locale', 'searchPageId']) === 'none' ? true : false,
'help' => 'Option active si une page a été sélectionnée.'
'help' => $text[27]
]); ?>
</div>
<div class="col3">
<?php echo template::select('configSearchPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
'label' => 'Page "Rechercher" ' . template::flag('site', '20px'),
<?php echo template::select('configSearchPageId', array_merge(['none' => $text[24]] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
'label' => $text[28] . template::flag($flag, '20px'),
'selected' => $this->getData(['locale', 'searchPageId']),
'help' => 'Options identique à la configuration du site',
'help' => $text[29]
]); ?>
</div>
</div>
@ -147,7 +270,7 @@
<div class="row">
<div class="col12">
<?php echo template::textarea('themeFooterText', [
'label' => '<div class="titleWysiwygContent">Contenu personnalisé</div>',
'label' => '<div class="titleWysiwygContent">'.$text[45].'</div>',
'value' => $this->getData(['theme', 'footer', 'text']),
'class' => 'editorWysiwyg'
]); ?>
@ -156,31 +279,31 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Mise en forme du texte</h4>
<h4><?php echo $text[30]; ?></h4>
<div class="row">
<div class="col3">
<?php echo template::select('themeFooterFont', $module::$fonts, [
'label' => 'Police',
'label' => $text[31],
'selected' => $this->getData(['theme', 'footer', 'font']),
'fonts' => true
]); ?>
</div>
<div class="col3">
<?php echo template::select('themeFooterFontSize', $module::$footerFontSizes, [
'label' => 'Taille',
'help' => 'Proportionnelle à celle définie dans le site.',
<?php echo template::select('themeFooterFontSize', $footerFontSizes, [
'label' => $text[32],
'help' => $text[33],
'selected' => $this->getData(['theme', 'footer', 'fontSize'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('themeFooterFontWeight', $module::$fontWeights, [
'label' => 'Style',
<?php echo template::select('themeFooterFontWeight', $fontWeights, [
'label' => $text[34],
'selected' => $this->getData(['theme', 'footer', 'fontWeight'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('themeFooterTextTransform', $module::$textTransforms, [
'label' => 'Casse',
<?php echo template::select('themeFooterTextTransform', $textTransforms, [
'label' => $text[35],
'selected' => $this->getData(['theme', 'footer', 'textTransform'])
]); ?>
</div>
@ -191,23 +314,23 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Dispositions</h4>
<h4><?php echo $text[36]; ?></h4>
<div class="row">
<div class="col4">
<?php $footerBlockPosition = is_null($this->getData(['theme', 'footer', 'template'])) ? $module::$footerblocks[3] : $module::$footerblocks [$this->getData(['theme', 'footer', 'template'])] ;?>
<?php echo template::select('themeFooterTemplate', $module::$footerTemplate, [
'label' => 'Répartition',
<?php $footerBlockPosition = is_null($this->getData(['theme', 'footer', 'template'])) ? $footerblocks[3] : $footerblocks [$this->getData(['theme', 'footer', 'template'])] ;?>
<?php echo template::select('themeFooterTemplate', $footerTemplate, [
'label' => $text[37],
'selected' => is_null($this->getData(['theme', 'footer', 'template'])) ? 4 : $this->getData(['theme', 'footer', 'template'])
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<p><strong>Contenu personnalisé</strong></p>
<p><strong><?php echo $text[38]; ?></strong></p>
<div class="row">
<div class="col12">
<?php echo template::select('themeFooterTextPosition', $footerBlockPosition, [
'label' => 'Position',
'label' => $text[39],
'selected' => $this->getData(['theme', 'footer', 'textPosition']),
'class' => 'themeFooterContent'
]); ?>
@ -215,19 +338,19 @@
</div>
<div class="row">
<div class="col12">
<?php echo template::select('themeFooterTextAlign', $module::$aligns, [
'label' => 'Alignement',
<?php echo template::select('themeFooterTextAlign', $aligns, [
'label' => $text[40],
'selected' => $this->getData(['theme', 'footer', 'textAlign'])
]); ?>
</div>
</div>
</div>
<div class="col4">
<p><strong>Réseaux sociaux</strong></p>
<p><strong><?php echo $text[41]; ?></strong></p>
<div class="row">
<div class="col12">
<?php echo template::select('themeFooterSocialsPosition', $footerBlockPosition, [
'label' => 'Position',
'label' => $text[39],
'selected' => $this->getData(['theme', 'footer', 'socialsPosition']),
'class' => 'themeFooterContent'
]); ?>
@ -235,19 +358,19 @@
</div>
<div class="row">
<div class="col12">
<?php echo template::select('themeFooterSocialsAlign', $module::$aligns, [
'label' => 'Alignement',
<?php echo template::select('themeFooterSocialsAlign', $aligns, [
'label' => $text[40],
'selected' => $this->getData(['theme', 'footer', 'socialsAlign'])
]); ?>
</div>
</div>
</div>
<div class="col4">
<p><strong>Informations</strong></p>
<p><strong><?php echo $text[42]; ?></strong></p>
<div class="row">
<div class="col12">
<?php echo template::select('themeFooterCopyrightPosition', $footerBlockPosition, [
'label' => 'Position',
'label' => $text[39],
'selected' => $this->getData(['theme', 'footer', 'copyrightPosition']),
'class' => 'themeFooterContent'
]); ?>
@ -255,8 +378,8 @@
</div>
<div class="row">
<div class="col12">
<?php echo template::select('themeFooterCopyrightAlign', $module::$aligns, [
'label' => 'Alignement',
<?php echo template::select('themeFooterCopyrightAlign', $aligns, [
'label' => $text[40],
'selected' => $this->getData(['theme', 'footer', 'copyrightAlign'])
]); ?>
</div>
@ -264,14 +387,14 @@
</div>
<div class="col6">
<div id="themeFooterPositionOptions">
<?php echo template::checkbox('themeFooterMargin', true, 'Alignement avec le contenu', [
<?php echo template::checkbox('themeFooterMargin', true, $text[43], [
'checked' => $this->getData(['theme', 'footer', 'margin'])
]); ?>
</div>
</div>
<div class="col6">
<div id="themeFooterPositionFixed" class="displayNone">
<?php echo template::checkbox('themeFooterFixed', true, 'Pied de page fixe', [
<?php echo template::checkbox('themeFooterFixed', true, $text[44], [
'checked' => $this->getData(['theme', 'footer', 'fixed'])
]); ?>
</div>

View File

@ -70,7 +70,14 @@ $("input, select").on("change", function() {
// Modifier la valeur
$("#themeHeaderHeight option:eq(0)").val(tmpImgHeight + "px");
// Modifier l'option
$("#themeHeaderHeight option:eq(0)").html("Hauteur de l\'image sélectionnée (" + tmpImgHeight + "px)");
var text="";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Hauteur de l\'image sélectionnée (";' ;
}
else{
echo 'text = "Height of the selected image (";' ;
} ?>
$("#themeHeaderHeight option:eq(0)").html( text + tmpImgHeight + "px)");
}
};

View File

@ -1,3 +1,106 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Paramètres';
$text[3] = 'Position';
$text[4] = 'Nature de contenu';
$text[5] = 'Hauteur maximale';
$text[6] = 'La hauteur maximale est de 600 pixels, même si les dimensions de l\'image sélectionnée sont supérieures. <br />Lorsque l\'adaptation est positionnée sur Responsive, la hauteur diminue proportionnellement à la largeur.';
$text[7] = 'Largeur';
$text[8] = 'Masquer la bannière en écran réduit';
$text[9] = 'Aligner la bannière avec le contenu';
$text[10] = 'Couleurs';
$text[11] = 'Le curseur horizontal règle le niveau de transparence.';
$text[12] = 'Arrière-plan';
$text[13] = 'Le curseur horizontal règle le niveau de transparence.';
$text[14] = 'Texte';
$text[15] = 'Mise en forme du titre';
$text[16] = 'Masquer le titre du site';
$text[17] = 'Police';
$text[18] = 'Taille';
$text[19] = 'Style';
$text[20] = 'Casse';
$text[21] = 'Proportionnelle à celle définie dans le site.';
$text[22] = 'Alignement du contenu';
$text[23] = 'Papier peint';
$text[24] = 'Sélectionner une image aux dimensions recommandées ci-dessous :';
$text[25] = 'Image';
$text[26] = 'Répétition';
$text[27] = 'Adaptation';
$text[28] = 'Les modes responsives permettent de conserver des dimensions proportionnelles.<br />Cover pour une image plus grande que la bannière, Contain pour une image plus petite. Les modes Auto et Etiré ne provoquent pas de modification de la hauteur de la bannière.';
$text[29] = 'Bannière cliquable';
$text[30] = 'Largeur : ';
$text[31] = ' | Hauteur : ';
$text[32] = ' | ratio : ';
$text[33] = 'Contenu personnalisé';
$text[34] ='Enregistrer';
$headerPositions = $module::$headerPositions;
$headerFeatures = $module::$headerFeatures;
$headerHeights = $module::$headerHeights;
$containerWides = $module::$containerWides;
$headerFontSizes = $module::$headerFontSizes;
$fontWeights = $module::$fontWeights;
$textTransforms = $module::$textTransforms;
$aligns = $module::$aligns;
$repeats = $module::$repeats;
$headerWide = $module::$headerWide;
$imagePositions = $module::$imagePositions;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Settings';
$text[3] = 'Position';
$text[4] = 'Type of content';
$text[5] = 'Maximum height';
$text[6] = 'The maximum height is 600 pixels, even if the selected image size is larger. <br/>When the adaptation is set to Responsive, the height decreases in proportion to the width.';
$text[7] = 'Width';
$text[8] = 'Hide banner in small screen';
$text[9] = 'Align banner with content';
$text[10] = 'Colors';
$text[11] = 'Horizontal slider sets transparency level';
$text[12] = 'Background';
$text[13] = 'Horizontal slider sets transparency level';
$text[14] = 'Text';
$text[15] = 'Title formatting';
$text[16] = 'Hide site title';
$text[17] = 'Font';
$text[18] = 'Size';
$text[19] = 'Style';
$text[20] = 'Character case';
$text[21] = 'Proportional to that defined in the site';
$text[22] = 'Content alignment';
$text[23] = 'Wallpaper';
$text[24] = 'Select an image with the following recommended dimensions:';
$text[25] = 'Image';
$text[26] = 'Repeat';
$text[27] = 'Adaptation';
$text[28] = 'Responsive modes allow proportional dimensions to be maintained.<br/>Cover for an image larger than the banner, Contain for a smaller image. The Auto and Stretch modes do not change the height of the banner.';
$text[29] = 'Clickable banner';
$text[30] = 'Width : ';
$text[31] = ' | Height : ';
$text[32] = ' | ratio : ';
$text[33] = 'Custom content';
$text[34] ='Save';
$headerPositions = $module::$headerPositions_en;
$headerFeatures = $module::$headerFeatures_en;
$headerHeights = $module::$headerHeights_en;
$containerWides = $module::$containerWides_en;
$headerFontSizes = $module::$headerFontSizes_en;
$fontWeights = $module::$fontWeights_en;
$textTransforms = $module::$textTransforms_en;
$aligns = $module::$aligns_en;
$repeats = $module::$repeats_en;
$headerWide = $module::$headerWide_en;
$imagePositions = $module::$imagePositions_en;
break;
}
?>
<?php echo template::formOpen('themeHeaderForm'); ?>
<div class="row">
<div class="col2">
@ -5,7 +108,7 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -13,57 +116,59 @@
'href' => 'https://doc.deltacms.fr/personnalisation-de-la-banniere',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('themeHeaderSubmit'); ?>
<?php echo template::submit('themeHeaderSubmit',[
'value' => $text[34]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres</h4>
<h4><?php echo $text[2]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::select('themeHeaderPosition', $module::$headerPositions, [
'label' => 'Position',
<?php echo template::select('themeHeaderPosition', $headerPositions, [
'label' => $text[3],
'selected' => $this->getData(['theme', 'header', 'position'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderFeature', $module::$headerFeatures, [
'label' => 'Nature de contenu',
<?php echo template::select('themeHeaderFeature', $headerFeatures, [
'label' => $text[4],
'selected' => $this->getData(['theme', 'header', 'feature'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderHeight', $module::$headerHeights, [
'label' => 'Hauteur maximale',
<?php echo template::select('themeHeaderHeight', $headerHeights, [
'label' => $text[5],
'selected' => $this->getData(['theme', 'header', 'height']),
'help' => 'La hauteur maximale est de 600 pixels, même si les dimensions de l\'image sélectionnée sont supérieures. <br />Lorsque l\'adaptation est positionnée sur Responsive, la hauteur diminue proportionnellement à la largeur.'
'help' => $text[6]
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('themeHeaderWide', $module::$containerWides, [
'label' => 'Largeur',
<?php echo template::select('themeHeaderWide', $containerWides, [
'label' => $text[7],
'selected' => $this->getData(['theme', 'header', 'wide'])
]); ?>
</div>
<div class="col4">
<div id="themeHeaderSmallDisplay" class="displayNone">
<?php echo template::checkbox('themeHeaderTinyHidden', true, 'Masquer la bannière en écran réduit', [
<?php echo template::checkbox('themeHeaderTinyHidden', true, $text[8], [
'checked' => $this->getData(['theme', 'header', 'tinyHidden'])
]); ?>
</div>
</div>
<div class="col4">
<div id="themeHeaderPositionOptions" class="displayNone">
<?php echo template::checkbox('themeHeaderMargin', true, 'Aligner la bannière avec le contenu', [
<?php echo template::checkbox('themeHeaderMargin', true, $text[9], [
'checked' => $this->getData(['theme', 'header', 'margin'])
]); ?>
</div>
@ -75,21 +180,21 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Couleurs</h4>
<h4><?php echo $text[10]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::text('themeHeaderBackgroundColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Arrière-plan',
'help' => $text[11],
'label' => $text[12],
'value' => $this->getData(['theme', 'header', 'backgroundColor'])
]); ?>
</div>
<div class="col6">
<?php echo template::text('themeHeaderTextColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Texte',
'help' => $text[13],
'label' => $text[14],
'value' => $this->getData(['theme', 'header', 'textColor'])
]); ?>
</div>
@ -100,44 +205,44 @@
<div class="row wallpaperContainer">
<div class="col12">
<div class="block">
<h4>Mise en forme du titre</h4>
<h4><?php echo $text[15]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::checkbox('themeHeaderTextHide', true, 'Masquer le titre du site', [
<?php echo template::checkbox('themeHeaderTextHide', true, $text[16], [
'checked' => $this->getData(['theme', 'header', 'textHide'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderFont', $module::$fonts, [
'label' => 'Police',
'label' => $text[17],
'selected' => $this->getData(['theme', 'header', 'font']),
'fonts' => true
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderFontSize', $module::$headerFontSizes, [
'label' => 'Taille',
'help' => 'Proportionnelle à celle définie dans le site.',
<?php echo template::select('themeHeaderFontSize', $headerFontSizes, [
'label' => $text[18],
'help' => $text[21],
'selected' => $this->getData(['theme', 'header', 'fontSize'])
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('themeHeaderFontWeight', $module::$fontWeights, [
'label' => 'Style',
<?php echo template::select('themeHeaderFontWeight', $fontWeights, [
'label' => $text[19],
'selected' => $this->getData(['theme', 'header', 'fontWeight'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderTextTransform', $module::$textTransforms, [
'label' => 'Casse',
<?php echo template::select('themeHeaderTextTransform', $textTransforms, [
'label' => $text[20],
'selected' => $this->getData(['theme', 'header', 'textTransform'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderTextAlign', $module::$aligns, [
'label' => 'Alignement du contenu',
<?php echo template::select('themeHeaderTextAlign', $aligns, [
'label' => $text[22],
'selected' => $this->getData(['theme', 'header', 'textAlign'])
]); ?>
</div>
@ -149,15 +254,15 @@
<div class="row wallpaperContainer">
<div class="col12">
<div class="block">
<h4>Papier peint</h4>
<h4><?php echo $text[23]; ?></h4>
<div class="row">
<div class="col12">
<?php
$imageFile = file_exists(self::FILE_DIR.'source/'.$this->getData(['theme', 'header', 'image'])) ?
$this->getData(['theme', 'header', 'image']) : "";
echo template::file('themeHeaderImage', [
'help' => 'Sélectionner une image aux dimensions recommandées ci-dessous :',
'label' => 'Image',
'help' => $text[24],
'label' => $text[25],
'type' => 1,
'value' => $imageFile
]); ?>
@ -166,28 +271,26 @@
<div id="themeHeaderImageOptions" class="displayNone">
<div class="row">
<div class="col3">
<?php echo template::select('themeHeaderImageRepeat', $module::$repeats, [
'label' => 'Répétition',
<?php echo template::select('themeHeaderImageRepeat', $repeats, [
'label' => $text[26],
'selected' => $this->getData(['theme', 'header', 'imageRepeat'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('themeHeaderImageContainer', $module::$headerWide, [
'label' => 'Adaptation',
<?php echo template::select('themeHeaderImageContainer', $headerWide, [
'label' => $text[27],
'selected' => $this->getData(['theme', 'header', 'imageContainer']),
'help' => 'Les modes responsives permettent de conserver des dimensions proportionnelles.<br />
Cover pour une image plus grande que la bannière, Contain pour une image plus petite.
Les modes Auto et Etiré ne provoquent pas de modification de la hauteur de la bannière.'
'help' => $text[28]
]); ?>
</div>
<div class="col3">
<?php echo template::select('themeHeaderImagePosition', $module::$imagePositions, [
'label' => 'Position',
<?php echo template::select('themeHeaderImagePosition', $imagePositions, [
'label' => $text[3],
'selected' => $this->getData(['theme', 'header', 'imagePosition'])
]); ?>
</div>
<div id="themeHeaderShow" class="col3">
<?php echo template::checkbox('themeHeaderlinkHomePage', true, 'Bannière cliquable', [
<?php echo template::checkbox('themeHeaderlinkHomePage', true, $text[29], [
'checked' => $this->getData(['theme', 'header', 'linkHomePage'])
]); ?>
</div>
@ -195,7 +298,7 @@
<div class="row">
<div class="col12 textAlignCenter">
<span id="themeHeaderImage">
Largeur : <span id="themeHeaderImageWidth"></span> | Hauteur : <span id="themeHeaderImageHeight"></span> | ratio : <span id="themeHeaderImageRatio"></span>
<?php echo $text[30]; ?><span id="themeHeaderImageWidth"></span><?php echo $text[31]; ?><span id="themeHeaderImageHeight"></span><?php echo $text[32]; ?><span id="themeHeaderImageRatio"></span>
</span>
</div>
</div>
@ -208,7 +311,7 @@
<div class="row">
<div class="col12">
<?php echo template::textarea('themeHeaderText', [
'label' => '<div class="titleWysiwygContent">Contenu personnalisé</div>',
'label' => '<div class="titleWysiwygContent">'.$text[33].'</div>',
'class' => 'editorWysiwyg',
'value' => $this->getData(['theme', 'header', 'featureContent'])
]); ?>

View File

@ -1,16 +1,45 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Cliquez sur une zone afin d\'accéder à ses options de personnalisation. Vous pouvez également afficher les zones cachées à l\'aide du bouton ci-dessous.';
$text[1] = 'Accueil';
$text[2] = 'Aide';
$text[3] = 'Zones cachées';
$text[4] = 'Gestion';
$text[5] = 'Administration';
$text[6] = 'Éditeur CSS';
$text[7] = 'Polices';
$text[8] = 'Cliquez sur une zone afin d\'accéder à ses options de personnalisation.';
break;
case 'en' :
$text[0] = 'Click on an area to access its customisation options. You can also display hidden areas using the button below';
$text[1] = 'Home';
$text[2] = 'Help';
$text[3] = 'Hidden areas';
$text[4] = 'Management';
$text[5] = 'Administration';
$text[6] = 'CSS Editor';
$text[7] = 'Fonts';
$text[8] = 'Click on a zone to access its customisation options';
break;
}
?>
<?php if(
$this->getData(['theme', 'header', 'position']) === 'hide'
OR $this->getData(['theme', 'menu', 'position']) === 'hide'
OR $this->getData(['theme', 'footer', 'position']) === 'hide'
): ?>
<?php echo template::speech('Cliquez sur une zone afin d\'accéder à ses options de personnalisation. Vous pouvez également afficher les zones cachées à l\'aide du bouton ci-dessous.'); ?>
<?php echo template::speech($text[0]); ?>
<div class="row">
<div class="col2 offset3">
<?php echo template::button('themeBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl(false),
'ico' => 'home',
'value' => 'Accueil'
'value' => $text[1]
]); ?>
</div>
<div class="col2">
@ -18,14 +47,14 @@
'href' => 'https://doc.deltacms.fr/theme-2',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[2],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2">
<?php echo template::button('themeShowAll', [
'ico' => 'eye',
'value' => 'Zones cachées'
'value' => $text[3]
]); ?>
</div>
</div>
@ -34,14 +63,14 @@
<?php echo template::button('themeManage', [
'ico' => 'cogs',
'href' => helper::baseUrl() . $this->getUrl(0) . '/manage',
'value' => 'Gestion'
'value' => $text[4]
]); ?>
</div>
<div class="col2">
<?php echo template::button('themeAdmin', [
'ico' => 'brush',
'href' => helper::baseUrl() . $this->getUrl(0) . '/admin',
'value' => 'Administration'
'value' => $text[5]
]); ?>
</div>
@ -49,7 +78,7 @@
<?php echo template::button('themeAdvanced', [
'ico' => 'code',
'href' => helper::baseUrl() . $this->getUrl(0) . '/advanced',
'value' => 'Éditeur CSS'
'value' => $text[6]
]); ?>
</div>
</div>
@ -58,19 +87,19 @@
<?php echo template::button('themeFonts', [
'ico' => 'pencil',
'href' => helper::baseUrl() . $this->getUrl(0) . '/fonts',
'value' => 'Polices'
'value' => $text[7]
]); ?>
</div>
</div>
<?php else: ?>
<?php echo template::speech('Cliquez sur une zone afin d\'accéder à ses options de personnalisation.'); ?>
<?php echo template::speech($text[8]); ?>
<div class="row">
<div class="col2 offset4">
<?php echo template::button('themeBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl(false),
'ico' => 'home',
'value' => 'Accueil'
'value' => $text[1]
]); ?>
</div>
<div class="col2">
@ -78,7 +107,7 @@
'href' => 'https://doc.deltacms.fr/theme-2',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[2],
'class' => 'buttonHelp'
]); ?>
</div>
@ -88,14 +117,14 @@
<?php echo template::button('themeManage', [
'ico' => 'cogs',
'href' => helper::baseUrl() . $this->getUrl(0) . '/manage',
'value' => 'Gestion'
'value' => $text[4]
]); ?>
</div>
<div class="col2">
<?php echo template::button('themeAdmin', [
'ico' => 'brush',
'href' => helper::baseUrl() . $this->getUrl(0) . '/admin',
'value' => 'Administration'
'value' => $text[5]
]); ?>
</div>
@ -103,7 +132,7 @@
<?php echo template::button('themeAdvanced', [
'ico' => 'code',
'href' => helper::baseUrl() . $this->getUrl(0) . '/advanced',
'value' => 'Éditeur CSS'
'value' => $text[6]
]); ?>
</div>
</div>
@ -112,7 +141,7 @@
<?php echo template::button('themeFonts', [
'ico' => 'pencil',
'href' => helper::baseUrl() . $this->getUrl(0) . '/fonts',
'value' => 'Polices'
'value' => $text[7]
]); ?>
</div>
</div>

View File

@ -19,7 +19,14 @@
*/
$("#configManageReset").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir réinitialiser à son état d'origine le thème du site ?", function() {
var text="";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Êtes-vous sûr de vouloir réinitialiser à son état d\'origine le thème du site ?";' ;
}
else{
echo 'text = "Are you sure you want to reset the site theme to its original state ?";' ;
} ?>
return core.confirm(text, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -1,3 +1,42 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Réinitialiser';
$text[3] = 'Appliquer';
$text[4] = 'Installer un thème archivé (site ou administration)';
$text[5] = 'Archive ZIP :';
$text[6] = 'Sauvegarde du thème dans les ';
$text[7] = 'fichiers';
$text[8] = ' du site';
$text[9] = 'Thème du site';
$text[10] = 'Thème de l\'administration';
$text[11] = 'Télécharger le thème';
$text[12] = 'Thème du site';
$text[13] = 'Thème de l\'administration';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Reset';
$text[3] = 'Apply';
$text[4] = 'Install archived theme (site or admin)';
$text[5] = 'ZIP archive:';
$text[6] = 'Save theme in ';
$text[7] = 'files';
$text[8] = ' of the site';
$text[9] = 'Site theme';
$text[10] = 'Administration theme';
$text[11] = 'Download theme';
$text[12] = 'Site theme';
$text[13] = 'Administration theme';
break;
}
?>
<?php echo template::formOpen('themeManageForm'); ?>
<div class="row">
<div class="col2">
@ -5,7 +44,7 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -13,7 +52,7 @@
'href' => 'https://doc.deltacms.fr/gestion',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
@ -21,24 +60,24 @@
<?php echo template::button('configManageReset', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'theme/reset/manage' . '&csrf=' . $_SESSION['csrf'],
'value' => 'Réinitialiser',
'value' => $text[2],
'ico' => 'cancel'
]); ?>
</div>
<div class="col2">
<?php echo template::submit('themeImportSubmit', [
'value' => 'Appliquer'
'value' => $text[3]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Installer un thème archivé (site ou administration)</h4>
<h4><?php echo $text[4]; ?></h4>
<div class="row">
<div class="col6 offset3">
<?php echo template::file('themeManageImport', [
'label' => 'Archive ZIP :',
'label' => $text[5],
'type' => 2
]); ?>
</div>
@ -49,20 +88,20 @@
<div class="row">
<div class="col6">
<div class="block">
<h4>Sauvegarde du thème dans les <a href="<?php echo helper::baseUrl(false); ?>core/vendor/filemanager/dialog.php?fldr=theme&type=0&akey=<?php echo md5_file(self::DATA_DIR.'core.json'); ?>" data-lity>fichiers</a> du site</h4>
<h4><?php echo $text[6]; ?><a href="<?php echo helper::baseUrl(false); ?>core/vendor/filemanager/dialog.php?fldr=theme&type=0&akey=<?php echo md5_file(self::DATA_DIR.'core.json'); ?>" data-lity><?php echo $text[7]; ?></a><?php echo $text[8]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::button('themeSave', [
'href' => helper::baseUrl() . 'theme/save/theme',
'ico' => 'download-cloud',
'value' => 'Thème du site'
'value' => $text[9]
]); ?>
</div>
<div class="col6">
<?php echo template::button('themeSaveAdmin', [
'href' => helper::baseUrl() . 'theme/save/admin',
'ico' => 'download-cloud',
'value' => 'Thème de l\'administration'
'value' => $text[10]
]); ?>
</div>
</div>
@ -71,20 +110,20 @@
<div class="col6">
<div class="block">
<h4>Télécharger le thème</h4>
<h4><?php echo $text[11]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::button('themeExport', [
'href' => helper::baseUrl() . 'theme/export/theme',
'ico' => 'download',
'value' => 'Thème du site'
'value' => $text[12]
]); ?>
</div>
<div class="col6">
<?php echo template::button('themeExport', [
'href' => helper::baseUrl() . 'theme/export/admin',
'ico' => 'download',
'value' => 'Thème de l\'administration'
'value' => $text[13]
]); ?>
</div>
</div>

View File

@ -1,3 +1,108 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Enregistrer';
$text[3] = 'Paramètres';
$text[4] = 'Position';
$text[5] = 'Largeur';
$text[6] = 'Bords arrondis';
$text[7] = 'Autour de la page sélectionnée';
$text[8] = 'Hauteur';
$text[9] = 'Alignement du contenu';
$text[10] = 'Aligner le menu avec le contenu';
$text[11] = 'Menu fixe';
$text[12] = 'Contenus';
$text[13] = 'Lien de connexion';
$text[14] = 'Barre de membre';
$text[15] = 'Icônes de gestion de compte et de déconnexion. Uniquement pour les membres connectés';
$text[16] = 'Affichage dans le menu burger';
$text[17] = 'Le menu burger remplace le menu complet lorsque la largeur de l\'écran n\'est pas suffisante.';
$text[18] = 'Sélectionner une image, ses dimensions seront adaptées automatiquement';
$text[19] = 'Logo du menu burger';
$text[20] = 'Couleurs';
$text[21] = 'Le curseur horizontal règle le niveau de transparence.';
$text[22] = 'Texte';
$text[23] = 'Le curseur horizontal règle le niveau de transparence.';
$text[24] = 'Arrière-plan';
$text[25] = 'Fond du sous-menu';
$text[26] = 'Texte page active';
$text[27] = 'La couleur de fond de la page active peut être définie automatique ou selon une couleur définie, comme par exemple celle de fond des pages.';
$text[28] = 'Couleur de fond de la page sélectionnée dans le menu.<br>Le curseur horizontal règle le niveau de transparence.';
$text[29] = 'Fond page active';
$text[30] = 'Mise en forme du texte';
$text[31] = 'Police';
$text[32] = 'Taille';
$text[33] = 'Proportionnelle à celle définie dans le site';
$text[34] = 'Style';
$text[35] = 'Casse';
$text[36] = 'Couleur de fond automatique';
$menuPositionsSite = $module::$menuPositionsSite;
$menuPositionsBody = $module::$menuPositionsBody;
$containerWides = $module::$containerWides;
$menuRadius = $module::$menuRadius;
$menuHeights = $module::$menuHeights;
$aligns = $module::$aligns;
$burgerContent = $module::$burgerContent;
$menuFontSizes = $module::$menuFontSizes;
$fontWeights = $module::$fontWeights;
$textTransforms = $module::$textTransforms;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Save';
$text[3] = 'Settings';
$text[4] = 'Position';
$text[5] = 'Width';
$text[6] = 'Rounded edges';
$text[7] = 'Around the selected page';
$text[8] = 'Height';
$text[9] = 'Alignment of content';
$text[10] = 'Align menu with content';
$text[11] = 'Fixed menu';
$text[12] = 'Contents';
$text[13] = 'Login link';
$text[14] = 'Member bar';
$text[15] = 'Account management and logout icons. Only for logged in members';
$text[16] = 'Display in burger menu';
$text[17] = 'The burger menu replaces the full menu when the screen width is not sufficient';
$text[18] = 'Select an image, its dimensions will be adapted automatically';
$text[19] = 'Logo of the burger menu';
$text[20] = 'Colors';
$text[21] = 'The horizontal slider sets the transparency level';
$text[22] = 'Text';
$text[23] = 'Horizontal slider sets transparency level';
$text[24] = 'Background';
$text[25] = 'Submenu background';
$text[26] = 'Text active page';
$text[27] = 'The background colour of the active page can be set automatically or according to a defined colour, such as the background colour of the pages.';
$text[28] = 'Background colour of the page selected in the menu.<br>The horizontal slider sets the transparency level.';
$text[29] = 'Active page background';
$text[30] = 'Text formatting';
$text[31] = 'Font';
$text[32] = 'Size';
$text[33] = 'Proportional to that defined in the site';
$text[34] = 'Style';
$text[35] = 'Character case';
$text[36] = 'Automatic background color';
$menuPositionsSite = $module::$menuPositionsSite_en;
$menuPositionsBody = $module::$menuPositionsBody_en;
$containerWides = $module::$containerWides_en;
$menuRadius = $module::$menuRadius_en;
$menuHeights = $module::$menuHeights_en;
$aligns = $module::$aligns_en;
$burgerContent = $module::$burgerContent_en;
$menuFontSizes = $module::$menuFontSizes_en;
$fontWeights = $module::$fontWeights_en;
$textTransforms = $module::$textTransforms_en;
break;
}
?>
<?php echo template::formOpen('themeMenuForm'); ?>
<div class="row">
<div class="col2">
@ -5,7 +110,7 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -13,68 +118,70 @@
'href' => 'https://doc.deltacms.fr/personnalisation-du-menu',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('themeMenuSubmit'); ?>
<?php echo template::submit('themeMenuSubmit',[
'value' => $text[2]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres</h4>
<h4><?php echo $text[3]; ?></h4>
<div class="row">
<div class="col6">
<?php
if ( $this->getData(['theme', 'header', 'position']) == "site")
{ echo template::select('themeMenuPosition', $module::$menuPositionsSite, [
'label' => 'Position',
{ echo template::select('themeMenuPosition', $menuPositionsSite, [
'label' => $text[4],
'selected' => $this->getData(['theme', 'menu', 'position'])
]);
}else{
echo template::select('themeMenuPosition', $module::$menuPositionsBody, [
'label' => 'Position',
echo template::select('themeMenuPosition', $menuPositionsBody, [
'label' => $text[4],
'selected' => $this->getData(['theme', 'menu', 'position'])
]); }
?>
</div>
<div class="col6">
<?php echo template::select('themeMenuWide', $module::$containerWides, [
'label' => 'Largeur',
<?php echo template::select('themeMenuWide', $containerWides, [
'label' => $text[5],
'selected' => $this->getData(['theme', 'menu', 'wide'])
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('themeMenuRadius', $module::$menuRadius, [
'label' => 'Bords arrondis',
<?php echo template::select('themeMenuRadius', $menuRadius, [
'label' => $text[6],
'selected' => $this->getData(['theme', 'menu', 'radius']),
'help' => 'Autour de la page sélectionnée'
'help' => $text[7]
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeMenuHeight', $module::$menuHeights, [
'label' => 'Hauteur',
<?php echo template::select('themeMenuHeight', $menuHeights, [
'label' => $text[8],
'selected' => $this->getData(['theme', 'menu', 'height'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeMenuTextAlign', $module::$aligns, [
'label' => 'Alignement du contenu',
<?php echo template::select('themeMenuTextAlign', $aligns, [
'label' => $text[9],
'selected' => $this->getData(['theme', 'menu', 'textAlign'])
]); ?>
</div>
</div>
<div id="themeMenuPositionOptions" class="displayNone">
<?php echo template::checkbox('themeMenuMargin', true, 'Aligner le menu avec le contenu', [
<?php echo template::checkbox('themeMenuMargin', true, $text[10], [
'checked' => $this->getData(['theme', 'menu', 'margin'])
]); ?>
</div>
<div id="themeMenuPositionFixed" class="displayNone">
<?php echo template::checkbox('themeMenuFixed', true, 'Menu fixe', [
<?php echo template::checkbox('themeMenuFixed', true, $text[11], [
'checked' => $this->getData(['theme', 'menu', 'fixed'])
]); ?>
</div>
@ -84,24 +191,24 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Contenus</h4>
<h4><?php echo $text[12]; ?></h4>
<div class="row">
<div class="col3">
<?php echo template::checkbox('themeMenuLoginLink', true, 'Lien de connexion', [
<?php echo template::checkbox('themeMenuLoginLink', true, $text[13], [
'checked' => $this->getData(['theme', 'menu', 'loginLink'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('themeMenuMemberBar', true, 'Barre de membre', [
<?php echo template::checkbox('themeMenuMemberBar', true, $text[14], [
'checked' => $this->getData(['theme', 'menu', 'memberBar']),
'help' => 'Icônes de gestion de compte et de déconnexion. Uniquement pour les membres connectés'
'help' => $text[15]
]); ?>
</div>
<div class="col6">
<?php echo template::select('themeMenuBurgerContent', $module::$burgerContent, [
'label' => 'Affichage dans le menu burger',
<?php echo template::select('themeMenuBurgerContent', $burgerContent, [
'label' => $text[16],
'selected' => $this->getData(['theme', 'menu', 'burgerContent']),
'help' => 'Le menu burger remplace le menu complet lorsque la largeur de l\'écran n\'est pas suffisante.'
'help' => $text[17]
]); ?>
</div>
</div>
@ -111,8 +218,8 @@
$imageFile = file_exists(self::FILE_DIR.'source/'.$this->getData(['theme', 'menu', 'burgerLogo'])) ?
$this->getData(['theme', 'menu', 'burgerLogo']) : "";
echo template::file('themeMenuBurgerLogo', [
'help' => 'Sélectionner une image, ses dimensions seront adaptées automatiquement',
'label' => 'Logo du menu burger',
'help' => $text[18],
'label' => $text[19],
'type' => 1,
'value' => $imageFile
]); ?>
@ -124,29 +231,29 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Couleurs</h4>
<h4><?php echo $text[20]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::text('themeMenuTextColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Texte',
'help' => $text[21],
'label' => $text[22],
'value' => $this->getData(['theme', 'menu', 'textColor'])
]); ?>
</div>
<div class="col4">
<?php echo template::text('themeMenuBackgroundColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Arrière-plan',
'help' => $text[23],
'label' => $text[24],
'value' => $this->getData(['theme', 'menu', 'backgroundColor'])
]); ?>
</div>
<div class="col4">
<?php echo template::text('themeMenuBackgroundColorSub', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Fond du sous-menu',
'help' => $text[23],
'label' => $text[25],
'value' => $this->getData(['theme', 'menu', 'backgroundColorSub'])
]); ?>
</div>
@ -155,23 +262,23 @@
<div class="col4">
<?php echo template::text('themeMenuActiveTextColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Texte page active',
'help' => $text[23],
'label' => $text[26],
'value' => $this->getData(['theme', 'menu', 'activeTextColor'])
]); ?>
</div>
<div class="col4 verticalAlignBottom">
<?php
echo template::checkbox('themeMenuActiveColorAuto', true, 'Couleur de fond automatique', [
echo template::checkbox('themeMenuActiveColorAuto', true, $text[36], [
'checked' => $this->getData(['theme', 'menu', 'activeColorAuto']),
'help' => 'La couleur de fond de la page active peut être définie automatique ou selon une couleur définie, comme par exemple celle de fond des pages.'
'help' => $text[27]
]); ?>
</div>
<div class="col4">
<?php echo template::text('themeMenuActiveColor', [
'class' => 'colorPicker',
'help' => 'Couleur de fond de la page sélectionnée dans le menu.<br>Le curseur horizontal règle le niveau de transparence.',
'label' => 'Fond page active',
'help' => $text[28],
'label' => $text[29],
'value' => $this->getData(['theme', 'menu', 'activeColor'])
]); ?>
</div>
@ -182,33 +289,33 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Mise en forme du texte</h4>
<h4><?php echo $text[30]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::select('themeMenuFont', $module::$fonts, [
'label' => 'Police',
'label' => $text[31],
'selected' => $this->getData(['theme', 'menu', 'font']),
'fonts' => true
]); ?>
</div>
<div class="col6">
<?php echo template::select('themeMenuFontSize', $module::$menuFontSizes, [
'label' => 'Taille',
'help' => 'Proportionnelle à celle définie dans le site',
<?php echo template::select('themeMenuFontSize', $menuFontSizes, [
'label' => $text[32],
'help' => $text[33],
'selected' => $this->getData(['theme', 'menu', 'fontSize'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::select('themeMenuFontWeight', $module::$fontWeights, [
'label' => 'Style',
<?php echo template::select('themeMenuFontWeight', $fontWeights, [
'label' => $text[34],
'selected' => $this->getData(['theme', 'menu', 'fontWeight'])
]); ?>
</div>
<div class="col6">
<?php echo template::select('themeMenuTextTransform', $module::$textTransforms, [
'label' => 'Casse',
<?php echo template::select('themeMenuTextTransform', $textTransforms, [
'label' => $text[35],
'selected' => $this->getData(['theme', 'menu', 'textTransform'])
]); ?>
</div>

View File

@ -1,3 +1,90 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Enregistrer';
$text[3] = 'Paramètres';
$text[4] = 'Largeur du site';
$text[5] = 'Arrondi des angles';
$text[6] = 'Ombre sur les bords du site';
$text[7] = 'Pas de marge au-dessus et en-dessous du site';
$text[8] = 'Couleurs';
$text[9] = 'Le curseur horizontal règle le niveau de transparence.';
$text[10] = 'Arrière-plan';
$text[11] = 'Texte';
$text[12] = 'Titres';
$text[13] = 'Liens';
$text[14] = 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.';
$text[15] = 'Arrière-plan des blocs';
$text[16] = 'Bordure des blocs';
$text[17] = 'Arrondi des angles du bloc';
$text[18] = 'Ombre sur les bords du bloc';
$text[19] = 'Arrière-plan du titre des blocs';
$text[20] = 'Boutons';
$text[21] = 'Titre';
$text[22] = 'Sous-titre';
$text[23] = 'Bouton';
$text[24] = 'Bloc';
$text[25] = 'Mise en forme du texte';
$text[26] = 'Police';
$text[27] = 'Style';
$text[28] = 'Casse';
$text[29] = 'Taille';
$text[30] = 'Taille de référence pour le site. Les tailles des polices de la bannière, de menu et de pied de page sont proportionnelles à cette taille.';
$text[31] = 'Mise en forme des titres';
$siteWidths = $module::$siteWidths;
$radius = $module::$radius;
$shadows = $module::$shadows;
$blockShadows = $module::$blockShadows;
$fontWeights = $module::$fontWeights;
$textTransforms = $module::$textTransforms;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Save';
$text[3] = 'Settings';
$text[4] = 'Site width';
$text[5] = 'Rounding of corners';
$text[6] = 'Shadow on site edges';
$text[7] = 'No margin above and below site';
$text[8] = 'Colors';
$text[9] = 'Horizontal slider sets transparency level';
$text[10] = 'Background';
$text[11] = 'Text';
$text[12] = 'Title';
$text[13] = 'Links';
$text[14] = 'Color visible in the absence of an image';
$text[15] = 'Background of blocks';
$text[16] = 'Block border';
$text[17] = 'Block corner rounding';
$text[18] = 'Shadow on block edges';
$text[19] = 'Block title background';
$text[20] = 'Buttons';
$text[21] = 'Title';
$text[22] = 'Subtitle';
$text[23] = 'Button';
$text[24] = 'Block';
$text[25] = 'Text formatting';
$text[26] = 'Font';
$text[27] = 'Style';
$text[28] = 'Character case';
$text[29] = 'Size';
$text[30] = 'Reference size for the site. The font sizes of the banner, menu and footer are proportional to this size';
$text[31] = 'Title formatting';
$siteWidths = $module::$siteWidths_en;
$radius = $module::$radius_en;
$shadows = $module::$shadows_en;
$blockShadows = $module::$blockShadows_en;
$fontWeights = $module::$fontWeights_en;
$textTransforms = $module::$textTransforms_en;
break;
}
?>
<?php echo template::formOpen('themeSiteForm'); ?>
<div class="row">
<div class="col2">
@ -5,7 +92,7 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -13,41 +100,43 @@
'href' => 'https://doc.deltacms.fr/personnalisation-du-site',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('themeSiteSubmit'); ?>
<?php echo template::submit('themeSiteSubmit',[
'value' => $text[2]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres</h4>
<h4><?php echo $text[3]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::select('themeSiteWidth', $module::$siteWidths, [
'label' => 'Largeur du site',
<?php echo template::select('themeSiteWidth', $siteWidths, [
'label' => $text[4],
'selected' => $this->getData(['theme', 'site', 'width'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeSiteRadius', $module::$radius, [
'label' => 'Arrondi des angles',
<?php echo template::select('themeSiteRadius', $radius, [
'label' => $text[5],
'selected' => $this->getData(['theme', 'site', 'radius'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeSiteShadow', $module::$shadows, [
'label' => 'Ombre sur les bords du site',
<?php echo template::select('themeSiteShadow', $shadows, [
'label' => $text[6],
'selected' => $this->getData(['theme', 'site', 'shadow'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('themeSiteMargin',true, 'Pas de marge au-dessus et en-dessous du site', [
<?php echo template::checkbox('themeSiteMargin',true, $text[7], [
'checked' => $this->getData(['theme', 'site', 'margin'])
]); ?>
</div>
@ -58,23 +147,23 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Couleurs</h4>
<h4><?php echo $text[8]; ?></h4>
<div class="row">
<div class="col8">
<div class="row">
<div class="col6">
<?php echo template::text('themeSiteBackgroundColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Arrière-plan',
'help' => $text[9],
'label' => $text[10],
'value' => $this->getData(['theme', 'site', 'backgroundColor'])
]); ?>
</div>
<div class="col6">
<?php echo template::text('themeTextTextColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Texte',
'help' => $text[9],
'label' => $text[11],
'value' => $this->getData(['theme', 'text', 'textColor'])
]); ?>
</div>
@ -83,16 +172,16 @@
<div class="col6">
<?php echo template::text('themeTitleTextColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Titres',
'help' => $text[9],
'label' => $text[12],
'value' => $this->getData(['theme', 'title', 'textColor'])
]); ?>
</div>
<div class="col6">
<?php echo template::text('themeTextLinkColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Liens',
'help' => $text[9],
'label' => $text[13],
'value' => $this->getData(['theme', 'text', 'linkColor'])
]); ?>
</div>
@ -101,16 +190,16 @@
<div class="col6">
<?php echo template::text('themeBlockBackgroundColor', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Arrière-plan des blocs',
'help' => $text[14],
'label' => $text[15],
'value' => $this->getData(['theme', 'block', 'backgroundColor'])
]); ?>
</div>
<div class="col6">
<?php echo template::text('themeBlockBorderColor', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Bordure des blocs',
'help' => $text[14],
'label' => $text[16],
'value' => $this->getData(['theme', 'block', 'borderColor'])
]); ?>
</div>
@ -118,14 +207,14 @@
<!-- Plus -->
<div class="row">
<div class="col6">
<?php echo template::select('themeBlockBorderRadius', $module::$radius, [
'label' => 'Arrondi des angles du bloc',
<?php echo template::select('themeBlockBorderRadius', $radius, [
'label' => $text[17],
'selected' => $this->getData(['theme', 'block', 'blockBorderRadius'])
]); ?>
</div>
<div class="col6">
<?php echo template::select('themeBlockBorderShadow', $module::$blockShadows, [
'label' => 'Ombre sur les bords du bloc',
<?php echo template::select('themeBlockBorderShadow', $blockShadows, [
'label' => $text[18],
'selected' => $this->getData(['theme', 'block', 'blockBorderShadow'])
]); ?>
</div>
@ -134,16 +223,16 @@
<div class="col6">
<?php echo template::text('themeBlockBackgroundTitleColor', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Arrière-plan du titre des blocs',
'help' => $text[14],
'label' => $text[19],
'value' => $this->getData(['theme', 'block', 'backgroundTitleColor'])
]); ?>
</div>
<div class="col6">
<?php echo template::text('themeButtonBackgroundColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Boutons',
'help' => $text[9],
'label' => $text[20],
'value' => $this->getData(['theme', 'button', 'backgroundColor'])
]); ?>
</div>
@ -154,20 +243,20 @@
<div class="bgPreview">
<div class="row">
<div class="col6">
<h1 class="headerPreview">Titre</h1>
<h2 class="headerPreview">Sous-titre </h2>
<h1 class="headerPreview"><?php echo $text[21]; ?></h1>
<h2 class="headerPreview"><?php echo $text[22]; ?></h2>
</div>
<div class="col6">
<?php echo template::button('themeSiteSubmitButtonPreview', [
'class' => 'buttonSubmitPreview',
'value' => 'Bouton'
'value' => $text[23]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block preview">
<h4 class="preview">Bloc</h4> <p class="textPreview">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<h4 class="preview"><?php echo $text[24]; ?></h4> <p class="textPreview">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<p><a href="#" class="urlPreview">Lorem ipsum dolor sit amet.</a></p>
</div>
</div>
@ -181,19 +270,19 @@
<div class="row">
<div class="col6">
<div class="block">
<h4>Mise en forme du texte</h4>
<h4><?php echo $text[25]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::select('themeTextFont', $module::$fonts, [
'label' => 'Police',
'label' => $text[26],
'selected' => $this->getData(['theme', 'text', 'font']),
'fonts' => true
]); ?>
</div>
<div class="col6">
<?php echo template::select('themeTextFontSize', $module::$siteFontSizes, [
'label' => 'Taille',
'help' => 'Taille de référence pour le site. Les tailles des polices de la bannière, de menu et de pied de page sont proportionnelles à cette taille.',
'label' => $text[29],
'help' => $text[30],
'selected' => $this->getData(['theme', 'text', 'fontSize'])
]); ?>
</div>
@ -202,24 +291,24 @@
</div>
<div class="col6">
<div class="block">
<h4>Mise en forme des titres</h4>
<h4><?php echo $text[31]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::select('themeTitleFont', $module::$fonts, [
'label' => 'Police',
'label' => $text[26],
'selected' => $this->getData(['theme', 'title', 'font']),
'fonts' => true
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeTitleFontWeight', $module::$fontWeights, [
'label' => 'Style',
<?php echo template::select('themeTitleFontWeight', $fontWeights, [
'label' => $text[27],
'selected' => $this->getData(['theme', 'title', 'fontWeight'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeTitleTextTransform', $module::$textTransforms, [
'label' => 'Casse',
<?php echo template::select('themeTitleTextTransform', $textTransforms, [
'label' => $text[28],
'selected' => $this->getData(['theme', 'title', 'textTransform'])
]); ?>
</div>

View File

@ -38,6 +38,27 @@ class translate extends common {
* Configuration avancée des langues
*/
public function copy() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Quelque chose n\'a pas fonctionné, vérifiez les permissions.';
$text[1] = 'Les langues doivent être différentes.';
$text[2] = 'Utilitaire de copie';
$text[3] = 'Données ';
$text[4] = ' copiées vers ';
$text[5] = 'Langue d\'origine';
break;
case 'en' :
$text[0] = 'Something went wrong, check the permissions.';
$text[1] = 'The languages must be different.';
$text[2] = 'Copy utility';
$text[3] = 'Data ';
$text[4] = ' copied to ';
$text[5] = 'Language of origin';
break;
}
// Soumission du formulaire
if ($this->isPost()) {
@ -61,34 +82,37 @@ class translate extends common {
// Enregistrer la langue
if ($success) {
$this->setData(['config', 'i18n', $toCreate, 'site' ]);
$notification = 'Données ' . self::$i18nList[$copyFrom] . ' copiées vers ' . self::$i18nList[$toCreate];
$notification = $text[3] . self::$i18nList[$copyFrom] . $text[4] . self::$i18nList[$toCreate];
} else {
$notification = "Quelque chose n\'a pas fonctionné, vérifiez les permissions.";
$notification = $text[0];
}
} else {
$success = false;
$notification = 'Les langues doivent être différentes.';
$notification = $text[1];
}
// Valeurs en sortie
$this->addOutput([
'notification' => $notification,
'title' => 'Utilitaire de copie',
'title' => $text[2],
'view' => 'index',
'state' => $success
]);
}
// Tableau des langues installées
foreach (self::$i18nList as $key => $value) {
$i18nList = self::$i18nList;
if( $this->getData(['config', 'i18n', 'langAdmin']) === 'en' ) $i18nList = self::$i18nList_en;
foreach ($i18nList as $key => $value) {
if ($this->getData(['config','i18n', $key]) === 'site') {
self::$languagesTarget[$key] = $value;
}
}
// Langues cibles fr en plus
self::$languagesInstalled = array_merge(['fr' => 'Français (fr)'],self::$languagesTarget);
// Langues cibles base en plus
self::$languagesInstalled = array_merge(['base' => $text[5] ],self::$languagesTarget);
// Valeurs en sortie
$this->addOutput([
'title' => 'Utilitaire de copie',
'title' => $text[2],
'view' => 'copy'
]);
}
@ -97,18 +121,41 @@ class translate extends common {
* Configuration
*/
public function index() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Modifications enregistrées';
$text[1] = 'Drapeau masqué';
$text[2] = 'Traduction automatique';
$text[3] = 'Traduction rédigée';
$text[4] = 'Supprimer la traduction';
$text[5] = 'Drapeau affiché';
$text[6] = 'Gestion des langues';
break;
case 'en' :
$text[0] = 'Registered changes';
$text[1] = 'Masked flag';
$text[2] = 'Google translation';
$text[3] = 'Written translation';
$text[4] = 'Delete translation';
$text[5] = 'Flag displayed';
$text[6] = 'Language management';
break;
}
// Soumission du formulaire
if($this->isPost()) {
// Désactivation du script Google
$script = $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN);
if ($script === false) {
setrawcookie('googtrans', '/fr/fr', time() + 3600, helper::baseUrl(false,false));
$_SESSION['googtrans'] = '/fr/fr';
setrawcookie('googtrans', '/base/base', time() + 3600, helper::baseUrl(false,false));
$_SESSION['googtrans'] = '/base/base';
}
// Edition des langues
foreach (self::$i18nList as $keyi18n => $value) {
if ($keyi18n === 'fr') continue;
if ($keyi18n === 'base') continue;
// Effacement d'une langue installée
if ( is_dir( self::DATA_DIR . $keyi18n ) === true
@ -134,6 +181,8 @@ class translate extends common {
'showCredits' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false,
'autoDetect' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateAutoDetect', helper::FILTER_BOOLEAN) : false,
//'admin' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateAdmin', helper::FILTER_BOOLEAN) : false,
'langAdmin' => $this->getInput('translateLangAdmin'),
'langBase' => $this->getInput('translateLangBase'),
'fr' => $this->getInput('translateFR'),
'de' => $this->getInput('translateDE'),
'en' => $this->getInput('translateEN'),
@ -143,10 +192,16 @@ class translate extends common {
'pt' => $this->getInput('translatePT')
]]);
// Modification de core/vendor/i18n/translation.js
$translation = "function scriptGoogleElementInit() { new google.translate.TranslateElement({ pageLanguage: '".$this->getData(['config', 'i18n', 'langBase'])."'}, 'google_translate_element');}";
file_put_contents( './core/vendor/i18n/translation.js', $translation);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
'notification' => 'Modifications enregistrées',
'notification' => $text[0],
'state' => true
]);
}
@ -154,23 +209,30 @@ class translate extends common {
foreach (self::$i18nList as $key => $value) {
if ($this->getData(['config','i18n',$key]) === 'site') {
self::$translateOptions [$key] = [
'none' => 'Drapeau masqué',
'script' => 'Traduction automatique',
'site' => 'Traduction rédigée',
'delete' => 'Supprimer la traduction'
'none' => $text[1],
'script' => $text[2],
'site' => $text[3],
'delete' => $text[4]
];
self::$siteTranslate = $key !== 'fr' ? false : true;
self::$siteTranslate = $key !== $this->getData(['config', 'i18n', 'langBase']) ? false : true;
} else {
self::$translateOptions [$key] = [
'none' => 'Drapeau masqué',
'script' => 'Traduction automatique',
'site' => 'Traduction rédigée'
'none' => $text[1],
'script' => $text[2],
'site' => $text[3]
];
}
// Limitation du choix pour la langue d'origine
if ( $key === $this->getData(['config', 'i18n', 'langBase'])){
self::$translateOptions [$key] = [
'none' => $text[1],
'site' => $text[5]
];
}
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Gestion des langues',
'title' => $text[6],
'view' => 'index'
]);
}
@ -189,15 +251,15 @@ class translate extends common {
helper::deleteCookie('DELTA_I18N_SCRIPT');
// Sélectionner
setcookie('DELTA_I18N_' . strtoupper($this->getUrl(3)) , $this->getUrl(2), time() + 3600, helper::baseUrl(false, false) , '', helper::isHttps(), true);
setrawcookie('googtrans', '/fr/' . $this->getUrl(2), time() + 3600, helper::baseUrl(false,false));
$_SESSION['googtrans'] = '/fr/' . $this->getUrl(2);
// Désactivation du drapeau, langue FR par défaut
setrawcookie('googtrans', '/' . $this->getData(['config', 'i18n', 'langBase']) .'/' . $this->getUrl(2), time() + 3600, helper::baseUrl(false,false));
$_SESSION['googtrans'] = '/'.$this->getData(['config', 'i18n', 'langBase']).'/' . $this->getUrl(2);
// Désactivation du drapeau, langue base par défaut
} else {
setcookie('DELTA_I18N_SITE' , 'fr', time() + 3600, helper::baseUrl(false, false) , '', helper::isHttps(), true);
setcookie('DELTA_I18N_SITE' , 'base', time() + 3600, helper::baseUrl(false, false) , '', helper::isHttps(), true);
helper::deleteCookie('DELTA_I18N_SCRIPT');
// Désactivation du script Google
setrawcookie('googtrans', '/fr/fr', time() + 3600, helper::baseUrl(false,false));
$_SESSION['googtrans'] = '/fr/fr';
setrawcookie('googtrans', '/' . $this->getData(['config', 'i18n', 'langBase']) .'/' . $this->getData(['config', 'i18n', 'langBase']) , time() + 3600, helper::baseUrl(false,false));
$_SESSION['googtrans'] = '/' . $this->getData(['config', 'i18n', 'langBase']) .'/' . $this->getData(['config', 'i18n', 'langBase']);
}
// Valeurs en sortie

View File

@ -1,11 +1,33 @@
<?php echo template::formOpen('translateFormCopy'); ?>
<?php echo template::formOpen('translateFormCopy');
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Enregistrer';
$text[3] = 'Copie de site (traductions rédigées)';
$text[4] = 'Pages et les modules de';
$text[5] = 'Vers';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Submit';
$text[3] = 'Site copy (written translations)';
$text[4] = 'Pages and modules of';
$text[5] = 'to';
break;
}
?>
<div class="row">
<div class="col2">
<?php echo template::button('translateFormCopyBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'translate',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -13,27 +35,29 @@
'href' => 'https://doc.deltacms.fr/utilitaire-de-copie',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('translateFormCopySubmit'); ?>
<?php echo template::submit('translateFormCopySubmit', [
'value'=> $text[2]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Copie de site (traductions rédigées)</h4>
<h4><?php echo $text[3]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::select('translateFormCopySource', $module::$languagesInstalled, [
'label' => 'Pages et les modules de'
'label' => $text[4]
]); ?>
</div>
<div class="col6">
<?php echo template::select('translateFormCopyTarget', $module::$languagesTarget, [
'label' => 'Vers'
'label' => $text[5]
]); ?>
</div>
</div>

View File

@ -1,11 +1,53 @@
<?php echo template::formOpen('translateForm'); ?>
<?php echo template::formOpen('translateForm');
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Utilitaire de copie';
$text[3] = 'Enregistrer';
$text[4] = 'Langue d\'administration';
$text[5] = 'Langue originale de rédaction du site';
$text[6] = 'Langages d\'origine et d\'administration';
$text[7] = 'Traduction automatique du site';
$text[8] = 'Active le script de traduction automatique';
$text[9] = 'Le script Google Translate assure la traduction automatique du site.';
$text[10] = 'Détection automatique de la langue du navigateur';
$text[11] = 'Détecte la langue du navigateur, dans ce mode il n\'est pas nécessaire d\'afficher les drapeaux.';
$text[12] = 'Afficher les crédits du script Google';
$text[13] = 'Option recommandée pour le respect du droit d\'auteur';
$text[14] = 'Mode de traduction du site et affichage des drapeaux';
$i18nList = core::$i18nList;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Copy utility';
$text[3] = 'Submit';
$text[4] = 'Language of administration';
$text[5] = 'Original language of the site';
$text[6] = 'Languages of origin and administration';
$text[7] = 'Automatic website translation';
$text[8] = 'Activate the automatic translation script';
$text[9] = 'The Google Translate script automatically translates the site.';
$text[10] = 'Automatic detection of the browser language';
$text[11] = 'Detects the language of the browser, in this mode it is not necessary to display the flags.';
$text[12] = 'Show Google script credits';
$text[13] = 'Recommended option for copyright compliance';
$text[14] = 'Site translation mode and flag display';
$i18nList = core::$i18nList_en;
break;
}
?>
<div class="row">
<div class="col2">
<?php echo template::button('translateFormBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl(),
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -13,47 +55,71 @@
'href' => 'https://doc.deltacms.fr/gestion-des-langues',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col3 offset3">
<?php echo template::button('translateButton', [
'href' => helper::baseUrl() . 'translate/copy',
'value' => 'Utilitaire de copie',
'ico' => 'cog-alt',
'disabled' => $module::$siteTranslate
]); ?>
<?php echo template::button('translateButton', [
'href' => helper::baseUrl() . 'translate/copy',
'value' => $text[2],
'ico' => 'cog-alt',
'disabled' => $module::$siteTranslate
]); ?>
</div>
<div class="col2">
<?php echo template::submit('translateFormSubmit'); ?>
<?php echo template::submit('translateFormSubmit', [
'value'=> $text[3]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Traduction automatique</h4>
<h4><?php echo $text[6]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::checkbox('translateScriptGoogle', true, 'Active le script de traduction automatique', [
<?php echo template::select('translateLangAdmin', ['fr'=>'Français (fr)','en'=>'English (en)'], [
'label' => $text[4],
'selected' => $this->getData(['config', 'i18n' , 'langAdmin'])
]); ?>
</div>
<div class="col6">
<?php echo template::select('translateLangBase', $i18nList, [
'label' => $text[5],
'selected' => $this->getData(['config', 'i18n' , 'langBase'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4><?php echo $text[7]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::checkbox('translateScriptGoogle', true, $text[8], [
'checked' => $this->getData(['config','i18n', 'scriptGoogle']),
'help' => 'Le script Google Translate assure la traduction automatique du site.'
'help' => $text[9]
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('translateAutoDetect', true, 'Détection automatique de la langue du navigateur', [
<?php echo template::checkbox('translateAutoDetect', true, $text[10], [
'checked' => $this->getData(['config','i18n', 'autoDetect']),
'class' => 'translateGoogleScriptOption',
'help' => 'Détecte la langue du navigateur, dans ce mode il n\'est pas nécessaire d\'afficher les drapeaux.'
'help' => $text[11]
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('translateCredits', true, 'Afficher les crédits du script Google', [
<?php echo template::checkbox('translateCredits', true, $text[12], [
'checked' => $this->getData(['config','i18n', 'showCredits']),
'class' => 'translateGoogleScriptOption',
'help' => 'Option recommandée pour le respect du droit d\'auteur'
'help' => $text[13]
]); ?>
</div>
</div>
@ -63,61 +129,58 @@
<div class="row">
<div class="col12">
<div class="block" id="flagsWrapper">
<h4>Mode de traduction et affichage des drapeaux</h4>
<h4><?php echo $text[14]; ?></h4>
<div class="row">
<div class="col3">
<?php echo template::select('translateFR', ['none'=>'Drapeau masqué','site'=>'Drapeau affiché'], [
'label' => template::flag('', '30px'),
<?php echo template::select('translateFR', $module::$translateOptions['fr'], [
'label' => template::flag('fr', '30px'),
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'fr']),
]); ?>
</div>
<div class="col3">
<div class="col12">
<?php echo template::select('translateDE', $module::$translateOptions['de'], [
'label' => template::flag('de', '30px'),
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'de'])
]); ?>
</div>
<div class="col12">
<?php echo template::select('translateEN', $module::$translateOptions['en'], [
'label' => template::flag('en', '30px'),
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'en'])
]); ?>
</div>
</div>
<div class="col3">
<?php echo template::select('translateEN', $module::$translateOptions['en'], [
'label' => template::flag('en', '30px'),
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'en'])
]); ?>
</div>
<div class="col3">
<div class="col12">
<?php echo template::select('translateES', $module::$translateOptions['es'], [
'label' => template::flag('es', '30px'),
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'es'])
]); ?>
</div>
<div class="col12">
<?php echo template::select('translateIT', $module::$translateOptions['it'], [
'label' => template::flag('it', '30px'),
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'it'])
]); ?>
</div>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::select('translateIT', $module::$translateOptions['it'], [
'label' => template::flag('it', '30px'),
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'it'])
]); ?>
</div>
<div class="col3">
<div class="col12">
<?php echo template::select('translateNL', $module::$translateOptions['nl'], [
'label' => template::flag('nl', '30px'),
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'nl'])
]); ?>
</div>
<div class="col12">
</div>
<div class="col3">
<?php echo template::select('translatePT', $module::$translateOptions['pt'], [
'label' => template::flag('pt', '30px'),
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'pt'])
]); ?>
</div>
</div>
</div>
</div>

View File

@ -39,7 +39,12 @@ class user extends common {
self::SIGNATURE_FIRSTLASTNAME => 'Prénom Nom',
self::SIGNATURE_LASTFIRSTNAME => 'Nom Prénom'
];
public static $signature_en = [
self::SIGNATURE_ID => 'Identifier',
self::SIGNATURE_PSEUDO => 'Username',
self::SIGNATURE_FIRSTLASTNAME => 'First name Name',
self::SIGNATURE_LASTFIRSTNAME => 'Name First name'
];
public static $userId = '';
public static $userLongtime = false;
@ -58,18 +63,49 @@ class user extends common {
* Ajout
*/
public function add() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Identifiant déjà utilisé';
$text[1] = 'Incorrect';
$text[2] = 'Compte créé sur ';
$text[3] = 'Bonjour ';
$text[4] = 'Un administrateur vous a créé un compte sur le site. ';
$text[5] = 'Vous trouverez ci-dessous les détails de votre compte.';
$text[6] = 'Identifiant du compte :';
$text[7] = '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.';
$text[8] = 'Utilisateur créé';
$text[9] = 'Nouvel utilisateur';
$text[10] = 'Aucune';
break;
case 'en' :
$text[0] = 'Identifier already in use';
$text[1] = 'Incorrect';
$text[2] = 'Account created on ';
$text[3] = 'Hello ';
$text[4] = 'An administrator has created an account for you on the site. ';
$text[5] = 'Below you will find your account details.';
$text[6] = 'Account ID :';
$text[7] = 'We do not store passwords, therefore we advise you to keep this message until you have logged in. You can change your password after your first login.';
$text[8] = 'User created';
$text[9] = 'New user';
$text[10] = 'None';
break;
}
// Soumission du formulaire
if($this->isPost()) {
$check=true;
// L'identifiant d'utilisateur est indisponible
$userId = $this->getInput('userAddId', helper::FILTER_ID, true);
if($this->getData(['user', $userId])) {
self::$inputNotices['userAddId'] = 'Identifiant déjà utilisé';
self::$inputNotices['userAddId'] = $text[0];
$check=false;
}
// Double vérification pour le mot de passe
if($this->getInput('userAddPassword', helper::FILTER_STRING_SHORT, true) !== $this->getInput('userAddConfirmPassword', helper::FILTER_STRING_SHORT, true)) {
self::$inputNotices['userAddConfirmPassword'] = 'Incorrect';
self::$inputNotices['userAddConfirmPassword'] = $text[1];
$check = false;
}
// Crée l'utilisateur
@ -105,23 +141,23 @@ class user extends common {
if($this->getInput('userAddSendMail', helper::FILTER_BOOLEAN) && $check === true) {
$sent = $this->sendMail(
$userMail,
'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(['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>',
$text[2] . $this->getData(['locale', 'title']),
$text[3].'<strong>' . $userFirstname . ' ' . $userLastname . '</strong>,<br><br>' .
$text[4] . $this->getData(['locale', 'title']) . $text[5].'<br><br>' .
'<strong>'.$text[6].'</strong> ' . $this->getInput('userAddId') . '<br>' .
'<small>'.$text[7].'</small>',
null
);
}
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'user',
'notification' => $sent === true ? 'Utilisateur créé' : $sent,
'notification' => $sent === true ? $text[8] : $sent,
'state' => $sent === true ? true : null
]);
}
// Générer la liste des pages disponibles
$redirectPage = array( 'noRedirect'=> array( 'title'=>'Aucune'));
$redirectPage = array( 'noRedirect'=> array( 'title'=>$text[10]));
self::$pagesList = $this->getData(['page']);
foreach(self::$pagesList as $page => $pageId) {
if ($this->getData(['page',$page,'block']) === 'bar' ||
@ -132,7 +168,7 @@ class user extends common {
self::$pagesList = array_merge( $redirectPage, self::$pagesList);
// Valeurs en sortie
$this->addOutput([
'title' => 'Nouvel utilisateur',
'title' => $text[9],
'view' => 'add'
]);
}
@ -141,6 +177,21 @@ class user extends common {
* Suppression
*/
public function delete() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Action non autorisée';
$text[1] = 'Impossible de supprimer votre propre compte';
$text[2] = 'Utilisateur supprimé';
break;
case 'en' :
$text[0] = 'Unauthorised action';
$text[1] = 'Unable to delete your own account';
$text[2] = 'Deleted user';
break;
}
// Accès refusé
if(
// L'utilisateur n'existe pas
@ -158,7 +209,7 @@ class user extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'user',
'notification' => 'Action non autorisée'
'notification' => $text[0]
]);
}
// Bloque la suppression de son propre compte
@ -166,7 +217,7 @@ class user extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'user',
'notification' => 'Impossible de supprimer votre propre compte'
'notification' => $text[1]
]);
}
// Suppression
@ -175,7 +226,7 @@ class user extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'user',
'notification' => 'Utilisateur supprimé',
'notification' => $text[2],
'state' => true
]);
}
@ -185,12 +236,29 @@ class user extends common {
* Édition
*/
public function edit() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Action non autorisée';
$text[1] = 'Incorrect';
$text[2] = 'Modifications enregistrées';
$text[3] = 'Aucune';
break;
case 'en' :
$text[0] = 'Unauthorised action';
$text[1] = 'Incorrect';
$text[2] = 'Registered changes';
$text[3] = 'None';
break;
}
if ($this->getUrl(3) !== $_SESSION['csrf'] &&
$this->getUrl(4) !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'user',
'notification' => 'Action non autorisée'
'notification' => $text[0]
]);
}
// Accès refusé
@ -232,11 +300,11 @@ class user extends common {
}
}
else {
self::$inputNotices['userEditConfirmPassword'] = 'Incorrect';
self::$inputNotices['userEditConfirmPassword'] = $text[1];
}
}
else {
self::$inputNotices['userEditOldPassword'] = 'Incorrect';
self::$inputNotices['userEditOldPassword'] = $text[1];
}
}
// Modification du groupe
@ -295,12 +363,12 @@ class user extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => $redirect,
'notification' => 'Modifications enregistrées',
'notification' => $text[2],
'state' => true
]);
}
// Générer la liste des pages disponibles
$redirectPage = array( 'noRedirect'=> array( 'title'=>'Aucune'));
$redirectPage = array( 'noRedirect'=> array( 'title'=> $text[3]) );
self::$pagesList = $this->getData(['page']);
foreach(self::$pagesList as $page => $pageId) {
if ($this->getData(['page',$page,'block']) === 'bar' ||
@ -321,6 +389,29 @@ class user extends common {
* Mot de passe perdu
*/
public function forgot() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Réinitialisation de votre mot de passe';
$text[1] = 'Bonjour ';
$text[2] = 'Vous avez demandé à changer le mot de passe lié à votre compte. Vous trouverez ci-dessous un lien vous permettant de modifier celui-ci.';
$text[3] = 'Si nous n\'avez pas demandé à réinitialiser votre mot de passe, veuillez ignorer ce mail.';
$text[4] = 'Un mail vous a été envoyé afin de continuer la réinitialisation';
$text[5] = 'Cet utilisateur n\'existe pas';
$text[6] = 'Mot de passe oublié ?';
break;
case 'en' :
$text[0] = 'Reset your password';
$text[1] = 'Hello ';
$text[2] = 'You have requested to change the password linked to your account. Below you will find a link to change your password.';
$text[3] = 'If you have not asked us to reset your password, please ignore this email.';
$text[4] = 'An email has been sent to you to continue the reset';
$text[5] = 'This user does not exist';
$text[6] = 'Forgot your password ?';
break;
}
// Soumission du formulaire
if($this->isPost()) {
$userId = $this->getInput('userForgotId', helper::FILTER_ID, true);
@ -332,16 +423,16 @@ class user extends common {
// Envoi le mail
$sent = $this->sendMail(
$this->getData(['user', $userId, 'mail']),
'Réinitialisation de votre mot de passe',
'Bonjour <strong>' . $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']) . '</strong>,<br><br>' .
'Vous avez demandé à changer le mot de passe lié à votre compte. Vous trouverez ci-dessous un lien vous permettant de modifier celui-ci.<br><br>' .
$text[0],
$text[1] .'<strong>' . $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']) . '</strong>,<br><br>' .
$text[2].'<br><br>' .
'<a href="' . helper::baseUrl() . 'user/reset/' . $userId . '/' . $uniqId . '" target="_blank">' . helper::baseUrl() . 'user/reset/' . $userId . '/' . $uniqId . '</a><br><br>' .
'<small>Si nous n\'avez pas demandé à réinitialiser votre mot de passe, veuillez ignorer ce mail.</small>',
$text[3].'</small>',
null
);
// Valeurs en sortie
$this->addOutput([
'notification' => ($sent === true ? 'Un mail vous a été envoyé afin de continuer la réinitialisation' : $sent),
'notification' => ($sent === true ? $text[4] : $sent),
'state' => ($sent === true ? true : null)
]);
}
@ -349,14 +440,14 @@ class user extends common {
else {
// Valeurs en sortie
$this->addOutput([
'notification' => 'Cet utilisateur n\'existe pas'
'notification' => $text[5]
]);
}
}
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,
'title' => 'Mot de passe oublié',
'title' => $text[6],
'view' => 'forgot'
]);
}
@ -365,6 +456,17 @@ class user extends common {
* Liste des utilisateurs
*/
public function index() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Liste des utilisateurs';
break;
case 'en' :
$text[0] = 'List of users';
break;
}
$userIdsFirstnames = helper::arrayCollumn($this->getData(['user']), 'firstname');
ksort($userIdsFirstnames);
foreach($userIdsFirstnames as $userId => $userFirstname) {
@ -387,7 +489,7 @@ class user extends common {
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Liste des utilisateurs',
'title' => $text[0],
'view' => 'index'
]);
}
@ -396,6 +498,42 @@ class user extends common {
* Connexion
*/
public function login() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Compte inconnu';
$text[1] = 'Compte inconnu verrouillé';
$text[2] = 'Compte verrouillé';
$text[3] = 'Captcha, identifiant ou mot de passe incorrects';
$text[4] = 'Seul un administrateur peut se connecter lors d\'une maintenance';
$text[5] = 'Connexion réussie';
$text[6] = 'Bienvenue ';
$text[7] = 'Captcha, identifiant ou mot de passe incorrects';
$text[8] = 'Erreur de mot de passe';
$text[9] = 'Erreur de captcha';
$text[10] = 'Accès bloqué ';
$text[11] = 'Connexion';
$text[12] = '';
break;
case 'en' :
$text[0] = 'unknown account';
$text[1] = 'Unknown account locked';
$text[2] = 'Account locked';
$text[3] = 'Incorrect captcha, username or password';
$text[4] = 'Only an administrator can log in during maintenance';
$text[5] = 'Successful connection';
$text[6] = 'Welcome ';
$text[7] = 'Incorrect captcha, username or password';
$text[8] = 'Password error';
$text[9] = 'Captcha error';
$text[10] = 'Account locked ';
$text[11] = 'Connection';
$text[12] = '';
break;
}
// Soumission du formulaire
$logStatus = '';
if($this->isPost()) {
@ -414,7 +552,7 @@ class user extends common {
* Aucun compte existant
*/
if ( !$this->getData(['user', $userId])) {
$logStatus = 'Compte inconnu';
$logStatus = $text[0];
//Stockage de l'IP
$this->setData([
'blacklist',
@ -429,17 +567,17 @@ class user extends common {
$ipBlackList = helper::arrayCollumn($this->getData(['blacklist']), 'ip');
if ( $this->getData(['blacklist',$userId,'connectFail']) >= $this->getData(['config', 'connect', 'attempt'])
AND in_array($this->getData(['blacklist',$userId,'ip']),$ipBlackList) ) {
$logStatus = 'Compte inconnu verrouillé';
$logStatus = $text[1];
// Valeurs en sortie
$this->addOutput([
'notification' => 'Compte verrouillé',
'notification' => $text[2],
'redirect' => helper::baseUrl(),
'state' => false
]);
} else {
// Valeurs en sortie
$this->addOutput([
'notification' => 'Captcha, identifiant ou mot de passe incorrects'
'notification' => $text[3]
]);
}
/**
@ -478,26 +616,26 @@ class user extends common {
AND $this->getData(['user', $userId, 'group']) < self::GROUP_ADMIN
) {
$this->addOutput([
'notification' => 'Seul un administrateur peut se connecter lors d\'une maintenance',
'notification' => $text[4],
'redirect' => helper::baseUrl(),
'state' => false
]);
} else {
$logStatus = 'Connexion réussie';
$logStatus = $text[5];
// Page de redirection par défaut
$redirectPage = helper::baseUrl() . str_replace('_', '/', str_replace('__', '#', $this->getUrl(2)));
if( null !==($this->getData(['user',$userId,'redirectPageId'])) AND $this->getData(['user',$userId,'redirectPageId']) !== 'noRedirect') $redirectPage = helper::baseUrl() . $this->getData(['user',$userId,'redirectPageId']);
// Valeurs en sortie
$this->addOutput([
'notification' => 'Bienvenue ' . $this->getData(['user',$userId,'firstname']) . ' ' . $this->getData(['user',$userId,'lastname']) ,
'notification' => $text[6] . $this->getData(['user',$userId,'firstname']) . ' ' . $this->getData(['user',$userId,'lastname']) ,
'redirect' => $redirectPage,
'state' => true
]);
}
// Sinon notification d'échec
} else {
$notification = 'Captcha, identifiant ou mot de passe incorrects';
$logStatus = $captcha === true ? 'Erreur de mot de passe' : 'Erreur de captcha';
$notification = $text[7];
$logStatus = $captcha === true ? $text[8] : $text[9];
// Cas 1 le nombre de connexions est inférieur aux tentatives autorisées : incrément compteur d'échec
if ($this->getData(['user',$userId,'connectFail']) < $this->getData(['config', 'connect', 'attempt'])) {
$this->setData(['user',$userId,'connectFail',$this->getdata(['user',$userId,'connectFail']) + 1 ]);
@ -508,7 +646,7 @@ class user extends common {
}
// Cas 3 le délai de bloquage court
if ($this->getData(['user',$userId,'connectTimeout']) + $this->getData(['config', 'connect', 'timeout']) > time() ) {
$notification = 'Accès bloqué ' . ($this->getData(['config', 'connect', 'timeout']) / 60) . ' minutes.';
$notification = $text[10] . ($this->getData(['config', 'connect', 'timeout']) / 60) . ' minutes.';
}
// Valeurs en sortie
@ -540,7 +678,7 @@ class user extends common {
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,
'title' => 'Connexion',
'title' => $text[11],
'view' => 'login'
]);
}
@ -549,6 +687,17 @@ class user extends common {
* Déconnexion
*/
public function logout() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Déconnexion réussie';
break;
case 'en' :
$text[0] = 'Successfully disconnected';
break;
}
// Ne pas effacer l'identifiant mais seulement le mot de passe
if (array_key_exists('DELTA_USER_LONGTIME',$_COOKIE)
AND $_COOKIE['DELTA_USER_LONGTIME'] !== 'true' ) {
@ -559,7 +708,7 @@ class user extends common {
session_destroy();
// Valeurs en sortie
$this->addOutput([
'notification' => 'Déconnexion réussie',
'notification' => $text[0],
'redirect' => helper::baseUrl(false),
'state' => true
]);
@ -569,6 +718,21 @@ class user extends common {
* Réinitialisation du mot de passe
*/
public function reset() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Incorrect';
$text[1] = 'Nouveau mot de passe enregistré';
$text[2] = 'Réinitialisation du mot de passe';
break;
case 'en' :
$text[0] = 'Incorrect';
$text[1] = 'New password registered';
$text[2] = 'Resetting the password';
break;
}
// Accès refusé
if(
// L'utilisateur n'existe pas
@ -592,7 +756,7 @@ class user extends common {
// La confirmation ne correspond pas au mot de passe
if($this->getInput('userResetNewPassword', helper::FILTER_STRING_SHORT, true) !== $this->getInput('userResetConfirmPassword', helper::FILTER_STRING_SHORT, true)) {
$newPassword = $this->getData(['user', $this->getUrl(2), 'password']);
self::$inputNotices['userResetConfirmPassword'] = 'Incorrect';
self::$inputNotices['userResetConfirmPassword'] = $text[0];
}
else {
$newPassword = $this->getInput('userResetNewPassword', helper::FILTER_PASSWORD, true);
@ -606,7 +770,7 @@ class user extends common {
$this->setData(['user', $this->getUrl(2),'connectTimeout',0 ]);
// Valeurs en sortie
$this->addOutput([
'notification' => 'Nouveau mot de passe enregistré',
'notification' => $text[1],
//'redirect' => helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()),
'redirect' => helper::baseUrl(),
'state' => true
@ -616,7 +780,7 @@ class user extends common {
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,
'title' => 'Réinitialisation du mot de passe',
'title' => $text[2],
'view' => 'reset'
]);
}
@ -626,6 +790,35 @@ class user extends common {
* Importation CSV d'utilisateurs
*/
public function import() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Compte créé sur ';
$text[1] = 'Bonjour ';
$text[2] = 'Un administrateur vous a créé un compte sur le site';
$text[3] = '. Vous trouverez ci-dessous les détails de votre compte.';
$text[4] = 'Identifiant du compte :';
$text[5] = 'Un mot de passe provisoire vous été attribué, à la première connexion cliquez sur Mot de passe Oublié.';
$text[6] = 'Rien à importer, erreur de format ou fichier incorrect';
$text[7] = 'Importation effectuée';
$text[8] = 'Erreur de lecture, vérifiez les permissions';
$text[9] = 'Importation';
break;
case 'en' :
$text[0] = 'Account created on ';
$text[1] = 'Hello ';
$text[2] = 'An administrator has created an account for you on the site';
$text[3] = '. You will find your account details below.';
$text[4] = 'Account ID :';
$text[5] = 'A temporary password has been assigned to you, the first time you log in click on Forgot password.';
$text[6] = 'Nothing to import, format error or incorrect file';
$text[7] = 'Importation done';
$text[8] = 'Read error, check permissions';
$text[9] = 'Importation';
break;
}
// Soumission du formulaire
$notification = '';
$success = true;
@ -703,11 +896,11 @@ class user extends common {
AND $this->getInput('userImportNotification',helper::FILTER_BOOLEAN) === true) {
$sent = $this->sendMail(
$item['email'],
'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(['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>'
$text[0] . $this->getData(['locale', 'title']),
$text[0].' <strong>' . $item['prenom'] . ' ' . $item['nom'] . '</strong>,<br><br>' .
$text[2]. $this->getData(['locale', 'title']) . $text[3].'<br><br>' .
'<strong>'.$text[4].'</strong> ' . $userId . '<br>' .
'<small>'.$text[5].'</small>'
);
if ($sent === true) {
// Mail envoyé changement de l'icône
@ -728,20 +921,20 @@ class user extends common {
}
}
if (empty(self::$users)) {
$notification = 'Rien à importer, erreur de format ou fichier incorrect' ;
$notification = $text[6] ;
$success = false;
} else {
$notification = 'Importation effectuée' ;
$notification = $text[7] ;
$success = true;
}
} else {
$notification = 'Erreur de lecture, vérifiez les permissions';
$notification = $text[8];
$success = false;
}
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Importation',
'title' => $text[9],
'view' => 'import',
'notification' => $notification,
'state' => $success

View File

@ -1,11 +1,85 @@
<?php echo template::formOpen('userAddForm'); ?>
<?php echo template::formOpen('userAddForm');
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Prénom';
$text[3] = 'Nom';
$text[4] = 'Pseudo';
$text[5] = 'Signature';
$text[6] = 'Adresse mail';
$text[7] = 'Groupe';
$text[8] = 'Partage de fichiers autorisé';
$text[9] = 'Ce membre pourra téléverser ou télécharger des fichiers dans le dossier \'partage\' et ses sous-dossiers';
$text[10] = 'Autorisations :';
$text[11] = 'Accès aux pages privées membres';
$text[12] = 'Accès aux pages privées membres et éditeurs';
$text[13] = 'Informations générales';
$text[14] = 'Ajout / Édition / Suppression de pages';
$text[15] = 'Ajout / Édition / Suppression de fichiers';
$text[16] = 'Accès à toutes les pages privées';
$text[17] = 'Ajout / Édition / Suppression de dossiers';
$text[18] = 'Ajout / Édition / Suppression d\'utilisateurs';
$text[19] = 'Configuration du site';
$text[20] = 'Personnalisation du thème';
$text[21] = 'Authentification';
$text[22] = 'Identifiant';
$text[23] = 'Mot de passe';
$text[24] = 'Confirmation';
$text[25] = 'Prévenir l\'utilisateur par mail';
$text[26] = 'Redirection';
$text[27] = 'Redirection après connexion';
$text[28] = 'Choisir Aucune si vous ne souhaitez pas de redirection.';
$text[29] = 'Enregistrer';
$groupNews = self::$groupNews;
$signature = $module::$signature;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Vorname';
$text[3] = 'Name';
$text[4] = 'Pseudo';
$text[5] = 'Signature';
$text[6] = 'Email address';
$text[7] = 'Group';
$text[8] = 'File sharing allowed';
$text[9] = 'This member will be able to upload or download files to the \'partage\' folder and its subfolders';
$text[10] = 'Authorisations :';
$text[11] = 'Access to private member pages';
$text[12] = 'Access to members\' and editors\' private pages';
$text[13] = 'General information';
$text[14] = 'Add / Edit / Delete pages';
$text[15] = 'Add / Edit / Delete files';
$text[16] = 'Access to all private pages';
$text[17] = 'Add / Edit / Delete folders';
$text[18] = 'Add / Edit / Delete users';
$text[19] = 'Site configuration';
$text[20] = 'Theme customisation';
$text[21] = 'Authentification';
$text[22] = 'Identifier';
$text[23] = 'Password';
$text[24] = 'Confirmation';
$text[25] = 'Notify the user by email';
$text[26] = 'Redirection';
$text[27] = 'Redirection after login';
$text[28] = 'Select \'Aucune\' if you do not want a redirection.';
$text[29] = 'Register';
$groupNews = self::$groupNews_en;
$signature = $module::$signature_en;
break;
}
?>
<div class="row">
<div class="col2">
<?php echo template::button('userAddBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'user',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -13,99 +87,101 @@
'href' => 'https://doc.deltacms.fr/nouvel-utilisateur',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('userAddSubmit'); ?>
<?php echo template::submit('userAddSubmit', [
'value'=> $text[29]
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<div class="block">
<h4>Informations générales</h4>
<h4><?php echo $text[13]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::text('userAddFirstname', [
'autocomplete' => 'off',
'label' => 'Prénom'
'label' => $text[2]
]); ?>
</div>
<div class="col6">
<?php echo template::text('userAddLastname', [
'autocomplete' => 'off',
'label' => 'Nom'
'label' => $text[3]
]); ?>
</div>
</div>
<?php echo template::text('userAddPseudo', [
'autocomplete' => 'off',
'label' => 'Pseudo'
'label' => $text[4]
]); ?>
<?php echo template::select('userAddSignature', $module::$signature, [
'label' => 'Signature',
<?php echo template::select('userAddSignature', $signature, [
'label' => $text[5],
'selected' => 1
]); ?>
<?php echo template::mail('userAddMail', [
'autocomplete' => 'off',
'label' => 'Adresse mail'
'label' => $text[6]
]); ?>
<?php echo template::select('userAddGroup', self::$groupNews, [
'label' => 'Groupe',
<?php echo template::select('userAddGroup', $groupNews, [
'label' => $text[7],
'selected' => self::GROUP_MEMBER
]); ?>
<div id="userAddMemberFiles" class="displayNone">
<?php echo template::checkbox('userAddFiles', true, 'Partage de fichiers autorisé', [
<?php echo template::checkbox('userAddFiles', true, $text[8] , [
'checked' => false,
'help' => 'Ce membre pourra téléverser ou télécharger des fichiers dans le dossier \'partage\' et ses sous-dossiers'
'help' => $text[9]
]); ?>
</div>
Autorisations :
<?php echo $text[10]; ?>
<ul id="userAddGroupDescription<?php echo self::GROUP_MEMBER; ?>" class="userAddGroupDescription displayNone">
<li>Accès aux pages privées membres</li>
<li><?php echo $text[11]; ?></li>
</ul>
<ul id="userAddGroupDescription<?php echo self::GROUP_MODERATOR; ?>" class="userAddGroupDescription displayNone">
<li>Accès aux pages privées membres et éditeurs</li>
<li>Ajout / Édition / Suppression de pages</li>
<li>Ajout / Édition / Suppression de fichiers</li>
<li><?php echo $text[12]; ?></li>
<li><?php echo $text[14]; ?></li>
<li><?php echo $text[15]; ?></li>
</ul>
<ul id="userAddGroupDescription<?php echo self::GROUP_ADMIN; ?>" class="userAddGroupDescription displayNone">
<li>Accès à toutes les pages privées</li>
<li>Ajout / Édition / Suppression de pages</li>
<li>Ajout / Édition / Suppression de fichiers</li>
<li>Ajout / Édition / Suppression de dossiers</li>
<li>Ajout / Édition / Suppression d'utilisateurs</li>
<li>Configuration du site</li>
<li>Personnalisation du thème</li>
<li><?php echo $text[16]; ?></li>
<li><?php echo $text[14]; ?></li>
<li><?php echo $text[15]; ?></li>
<li><?php echo $text[17]; ?></li>
<li><?php echo $text[18]; ?></li>
<li><?php echo $text[19]; ?></li>
<li><?php echo $text[20]; ?></li>
</ul>
</div>
</div>
<div class="col6">
<div class="block">
<h4>Authentification</h4>
<h4><?php echo $text[21]; ?></h4>
<?php echo template::text('userAddId', [
'autocomplete' => 'off',
'label' => 'Identifiant'
'label' => $text[22]
]); ?>
<?php echo template::password('userAddPassword', [
'autocomplete' => 'off',
'label' => 'Mot de passe'
'label' => $text[23]
]); ?>
<?php echo template::password('userAddConfirmPassword', [
'autocomplete' => 'off',
'label' => 'Confirmation'
'label' => $text[24]
]); ?>
<?php echo template::checkbox('userAddSendMail', true,
'Prévenir l\'utilisateur par mail');
$text[25]);
?>
</div>
<div class="block">
<h4>Redirection</h4>
<h4><?php echo $text[26]; ?></h4>
<?php echo template::select('userRedirectPageId', helper::arrayCollumn($module::$pagesList, 'title'), [
'label' => 'Redirection après connexion',
'label' => $text[27],
'selected' =>$this->getData(['user', $this->getUrl(2),'redirectPageId']),
'help' => 'Choisir Aucune si vous ne souhaitez pas de redirection.'
'help' => $text[28]
]); ?>
</div>
</div>

View File

@ -1,4 +1,84 @@
<?php echo template::formOpen('userEditForm'); ?>
<?php echo template::formOpen('userEditForm');
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Prénom';
$text[3] = 'Nom';
$text[4] = 'Pseudo';
$text[5] = 'Signature';
$text[6] = 'Adresse mail';
$text[7] = 'Groupe';
$text[8] = 'Partage de fichiers autorisé';
$text[9] = 'Ce membre pourra téléverser ou télécharger des fichiers dans le dossier \'partage\' et ses sous-dossiers';
$text[10] = 'Autorisations :';
$text[11] = 'Accès aux pages privées membres';
$text[12] = 'Accès aux pages privées membres et éditeurs';
$text[13] = 'Informations générales';
$text[14] = 'Ajout / Édition / Suppression de pages';
$text[15] = 'Ajout / Édition / Suppression de fichiers';
$text[16] = 'Accès à toutes les pages privées';
$text[17] = 'Ajout / Édition / Suppression de dossiers';
$text[18] = 'Ajout / Édition / Suppression d\'utilisateurs';
$text[19] = 'Configuration du site';
$text[20] = 'Personnalisation du thème';
$text[21] = 'Authentification';
$text[22] = 'Identifiant';
$text[23] = 'Ancien mot de passe';
$text[24] = 'Confirmation';
$text[25] = 'Prévenir l\'utilisateur par mail';
$text[26] = 'Redirection';
$text[27] = 'Redirection après connexion';
$text[28] = 'Choisir Aucune si vous ne souhaitez pas de redirection.';
$text[29] = 'Enregistrer';
$text[30] = 'Impossible de modifier votre propre groupe.';
$text[31] = 'L\'identifiant est défini lors de la création du compte, il ne peut pas être modifié.';
$text[32] = 'Nouveau mot de passe';
$signature = $module::$signature;
$groupEdits = self::$groupEdits;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Vorname';
$text[3] = 'Name';
$text[4] = 'Pseudo';
$text[5] = 'Signature';
$text[6] = 'Email address';
$text[7] = 'Group';
$text[8] = 'File sharing allowed';
$text[9] = 'This member will be able to upload or download files to the \'partage\' folder and its subfolders';
$text[10] = 'Authorisations :';
$text[11] = 'Access to private member pages';
$text[12] = 'Access to members\' and editors\' private pages';
$text[13] = 'General information';
$text[14] = 'Add / Edit / Delete pages';
$text[15] = 'Add / Edit / Delete files';
$text[16] = 'Access to all private pages';
$text[17] = 'Add / Edit / Delete folders';
$text[18] = 'Add / Edit / Delete users';
$text[19] = 'Site configuration';
$text[20] = 'Theme customisation';
$text[21] = 'Authentification';
$text[22] = 'Identifier';
$text[23] = 'Old Password';
$text[24] = 'Confirmation';
$text[25] = 'Notify the user by email';
$text[26] = 'Redirection';
$text[27] = 'Redirection after login';
$text[28] = 'Select \'Aucune\' if you do not want a redirection.';
$text[29] = 'Register';
$text[30] = 'You cannot change your own group.';
$text[31] = 'The username is defined when the account is created and cannot be changed.';
$text[32] = 'New password';
$signature = $module::$signature_en;
$groupEdits = self::$groupEdits_en;
break;
}
?>
<div class="row">
<div class="col2">
<?php if($this->getUser('group') === self::GROUP_ADMIN): ?>
@ -6,31 +86,33 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'user',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
<?php else: ?>
<?php echo template::button('userEditBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl(false),
'ico' => 'home',
'value' => 'Accueil'
'value' => $text[0]
]); ?>
<?php endif; ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('userEditSubmit'); ?>
<?php echo template::submit('userEditSubmit', [
'value'=> $text[29]
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<div class="block">
<h4>Informations générales</h4>
<h4><?php echo $text[13]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::text('userEditFirstname', [
'autocomplete' => 'off',
'disabled' => $this->getUser('group') > 2 ? false : true,
'label' => 'Prénom',
'label' => $text[2],
'value' => $this->getData(['user', $this->getUrl(2), 'firstname'])
]); ?>
</div>
@ -38,88 +120,88 @@
<?php echo template::text('userEditLastname', [
'autocomplete' => 'off',
'disabled' => $this->getUser('group') > 2 ? false : true,
'label' => 'Nom',
'label' => $text[3],
'value' => $this->getData(['user', $this->getUrl(2), 'lastname'])
]); ?>
</div>
</div>
<?php echo template::text('userEditPseudo', [
'autocomplete' => 'off',
'label' => 'Pseudo',
'label' => $text[4],
'value' => $this->getData(['user', $this->getUrl(2), 'pseudo'])
]); ?>
<?php echo template::select('userEditSignature', $module::$signature, [
'label' => 'Signature',
<?php echo template::select('userEditSignature', $signature, [
'label' => $text[5],
'selected' => $this->getData(['user', $this->getUrl(2), 'signature'])
]); ?>
<?php echo template::mail('userEditMail', [
'autocomplete' => 'off',
'label' => 'Adresse mail',
'label' => $text[6],
'value' => $this->getData(['user', $this->getUrl(2), 'mail'])
]); ?>
<?php if($this->getUser('group') === self::GROUP_ADMIN): ?>
<?php echo template::select('userEditGroup', self::$groupEdits, [
<?php echo template::select('userEditGroup', $groupEdits, [
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
'label' => 'Groupe',
'help' => ($this->getUrl(2) === $this->getUser('id') ? $text[30] : ''),
'label' => $text[7],
'selected' => $this->getData(['user', $this->getUrl(2), 'group'])
]); ?>
<div id="userEditMemberFiles" class="displayNone">
<?php echo template::checkbox('userEditFiles', true, 'Partage de fichiers autorisé', [
<?php echo template::checkbox('userEditFiles', true, $text[8], [
'checked' => $this->getData(['user', $this->getUrl(2), 'files']),
'help' => 'Ce membre pourra téléverser ou télécharger des fichiers dans le dossier \'partage\' et ses sous-dossiers'
'help' => $text[9]
]); ?>
</div>
<div id="userEditLabelAuth">Autorisations :</div>
<div id="userEditLabelAuth"><?php echo $text[10]; ?></div>
<ul id="userEditGroupDescription<?php echo self::GROUP_MEMBER; ?>" class="userEditGroupDescription displayNone">
<li>Accès aux pages privées membres</li>
<li><?php echo $text[11]; ?></li>
</ul>
<ul id="userEditGroupDescription<?php echo self::GROUP_MODERATOR; ?>" class="userEditGroupDescription displayNone">
<li>Accès aux pages privées membres et éditeurs</li>
<li>Ajout / Édition / Suppression de pages</li>
<li>Ajout / Édition / Suppression de fichiers</li>
<li><?php echo $text[12]; ?></li>
<li><?php echo $text[14]; ?></li>
<li><?php echo $text[15]; ?></li>
</ul>
<ul id="userEditGroupDescription<?php echo self::GROUP_ADMIN; ?>" class="userEditGroupDescription displayNone">
<li>Accès à toutes les pages privées</li>
<li>Ajout / Édition / Suppression de pages</li>
<li>Ajout / Édition / Suppression de fichiers</li>
<li>Ajout / Édition / Suppression de dossiers</li>
<li>Ajout / Édition / Suppression d'utilisateurs</li>
<li>Configuration du site</li>
<li>Personnalisation du thème</li>
<li><?php echo $text[16]; ?></li>
<li><?php echo $text[14]; ?></li>
<li><?php echo $text[15]; ?></li>
<li><?php echo $text[17]; ?></li>
<li><?php echo $text[18]; ?></li>
<li><?php echo $text[19]; ?></li>
<li><?php echo $text[20]; ?></li>
</ul>
<?php endif; ?>
</div>
</div>
<div class="col6">
<div class="block">
<h4>Authentification</h4>
<h4><?php echo $text[21]; ?></h4>
<?php echo template::text('userEditId', [
'autocomplete' => 'off',
'help' => 'L\'identifiant est défini lors de la création du compte, il ne peut pas être modifié.',
'label' => 'Identifiant',
'help' => $text[31],
'label' => $text[22],
'readonly' => true,
'value' => $this->getUrl(2)
]); ?>
<?php echo template::password('userEditOldPassword', [
'autocomplete' => 'new-password', // remplace 'off' pour éviter le pré remplissage auto
'label' => 'Ancien mot de passe'
'label' => $text[23]
]); ?>
<?php echo template::password('userEditNewPassword', [
'autocomplete' => 'off',
'label' => 'Nouveau mot de passe'
'label' => $text[32]
]); ?>
<?php echo template::password('userEditConfirmPassword', [
'autocomplete' => 'off',
'label' => 'Confirmation'
'label' => $text[24]
]); ?>
</div>
<div class="block">
<h4>Redirection</h4>
<h4><?php echo $text[26]; ?></h4>
<?php echo template::select('userRedirectPageId', helper::arrayCollumn($module::$pagesList, 'title'), [
'label' => 'Redirection après connexion',
'label' => $text[27],
'selected' =>$this->getData(['user', $this->getUrl(2),'redirectPageId']),
'help' => 'Choisir Aucune si vous ne souhaitez pas de redirection.'
'help' => $text[28]
]); ?>
</div>
</div>

View File

@ -1,18 +1,34 @@
<?php echo template::formOpen('userForgotForm'); ?>
<?php echo template::formOpen('userForgotForm');
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Identifiant';
$text[1] = 'Retour';
$text[2] = 'Valider';
break;
case 'en' :
$text[0] = 'Identifier';
$text[1] = 'Back';
$text[2] = 'Validate';
break;
}
?>
<?php echo template::text('userForgotId', [
'label' => 'Identifiant'
'label' => $text[0]
]); ?>
<div class="row">
<div class="col3 offset6">
<?php echo template::button('userForgotBack', [
'href' => helper::baseUrl() . 'user/login/' . $this->getUrl(2),
'ico' => 'left',
'value' => 'Retour'
'value' => $text[1]
]); ?>
</div>
<div class="col3">
<?php echo template::submit('userForgotSubmit', [
'value' => 'Valider'
'value' => $text[2]
]); ?>
</div>
</div>

View File

@ -1,11 +1,54 @@
<?php echo template::formOpen('userImportForm'); ?>
<?php echo template::formOpen('userImportForm');
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Importer';
$text[3] = 'Importation de fichier plat CSV';
$text[4] = 'Liste d\'utilisateurs :';
$text[5] = 'Séparateur';
$text[6] = 'Envoyer un message de confirmation';
$text[7] = 'Id';
$text[8] = 'Nom';
$text[9] = 'Prénom';
$text[10] = 'Groupe';
$text[11] = 'Pseudo';
$text[12] = 'Email';
$text[13] = ' Compte créé | ';
$text[14] = ' Compte créé et notifié | ';
$text[15] = ' Erreur dans le fichier, compte non créé.';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Import';
$text[3] = 'CSV flat file import';
$text[4] = 'List of users :';
$text[5] = 'Separator';
$text[6] = 'Send a confirmation message';
$text[7] = 'Id';
$text[8] = 'Name';
$text[9] = 'Vorname';
$text[10] = 'Group';
$text[11] = 'Pseudo';
$text[12] = 'Email';
$text[13] = ' Account created | ';
$text[14] = ' Account created and notified | ';
$text[15] = ' Error in the file, account not created.';
break;
}
?>
<div class="row">
<div class="col2">
<?php echo template::button('userImportBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'user',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -13,35 +56,35 @@
'href' => 'https://doc.deltacms.fr/importation',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('userImportSubmit', [
'value' => 'Importer'
'value' => $text[2]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Importation de fichier plat CSV</h4>
<h4><?php echo $text[3]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::file('userImportCSVFile', [
'label' => 'Liste d\'utilisateurs :'
'label' => $text[4]
]); ?>
</div>
<div class="col2">
<?php echo template::select('userImportSeparator', $module::$separators, [
'label' => 'Séparateur'
'label' => $text[5]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::checkbox('userImportNotification', true, 'Envoyer un message de confirmation', [
<?php echo template::checkbox('userImportNotification', true, $text[6], [
'checked' => false
]); ?>
</div>
@ -53,8 +96,8 @@
<?php if ($module::$users): ?>
<div class="row">
<div class="col12 textAlignCenter">
<?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éé.
<?php echo template::table([1, 3, 3, 1, 1, 2, 1], $module::$users, [$text[7], $text[8], $text[9],$text[10], $text[11], $text[12], '']); ?>
<?php echo template::ico('check'). $text[13]; echo template::ico('mail'). $text[14]; echo template::ico('cancel'). $text[15];?>
</div>
</div>
<?php endif;?>

View File

@ -19,7 +19,14 @@
*/
$(".userDelete").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer cet utilisateur ?", function() {
var text = "";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Êtes-vous sûr de vouloir supprimer cet utilisateur ?";' ;
}
else{
echo 'text = "Are you sure you want to delete this user";' ;
} ?>
return core.confirm( text, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -1,10 +1,35 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Accueil';
$text[1] = 'Aide';
$text[2] = 'Importation';
$text[3] = 'Utilisateur';
$text[4] = 'Identifiant';
$text[5] = 'Nom';
$text[6] = 'Groupe';
break;
case 'en' :
$text[0] = 'Home';
$text[1] = 'Help';
$text[2] = 'Import';
$text[3] = 'User';
$text[4] = 'Identifier';
$text[5] = 'Name';
$text[6] = 'Group';
break;
}
?>
<div class="row">
<div class="col2">
<?php echo template::button('userAddBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl(false),
'ico' => 'home',
'value' => 'Accueil'
'value' => $text[0]
]); ?>
</div>
<div class="col2">
@ -12,7 +37,7 @@
'href' => 'https://doc.deltacms.fr/liste-des-utilisateurs',
'target' => '_blank',
'ico' => 'help',
'value' => 'Aide',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
@ -20,15 +45,15 @@
<?php echo template::button('userImport', [
'href' => helper::baseUrl() . 'user/import',
'ico' => 'plus',
'value' => 'Importation'
'value' => $text[2]
]); ?>
</div>
<div class="col2">
<?php echo template::button('userAdd', [
'href' => helper::baseUrl() . 'user/add',
'ico' => 'plus',
'value' => 'Utilisateur'
'value' => $text[3]
]); ?>
</div>
</div>
<?php echo template::table([3, 4, 3, 1, 1], $module::$users, ['Identifiant', 'Nom', 'Groupe', '', '']); ?>
<?php echo template::table([3, 4, 3, 1, 1], $module::$users, [$text[4], $text[5], $text[6], '', '']); ?>

View File

@ -1,14 +1,45 @@
<?php echo template::formOpen('userLoginForm'); ?>
<?php echo template::formOpen('userLoginForm');
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Identifiant';
$text[1] = 'Mot de passe';
$text[2] = 'Annuler';
$text[3] = 'Connexion';
$text[4] = 'Se souvenir de mon identifiant';
$text[5] = 'Mot de passe perdu';
break;
case 'en' :
$text[0] = 'Identifier';
$text[1] = 'Password';
$text[2] = 'Cancel';
$text[3] = 'Connection';
$text[4] = 'Remember my ID';
$text[5] = 'Lost password';
break;
default:
$text[0] = 'Identifiant';
$text[1] = 'Mot de passe';
$text[2] = 'Annuler';
$text[3] = 'Connexion';
$text[4] = 'Se souvenir de mon identifiant';
$text[5] = 'Mot de passe perdu';
break;
}
?>
<div class="row">
<div class="col6">
<?php echo template::text('userLoginId', [
'label' => 'Identifiant',
'label' => $text[0],
'value' => $module::$userId
]); ?>
</div>
<div class="col6">
<?php echo template::password('userLoginPassword', [
'label' => 'Mot de passe'
'label' => $text[1]
]); ?>
</div>
</div>
@ -24,12 +55,12 @@
<?php endif;?>
<div class="row">
<div class="col6">
<?php echo template::checkbox('userLoginLongTime', true, 'Se souvenir de mon identifiant', [
<?php echo template::checkbox('userLoginLongTime', true, $text[4], [
'checked' => $module::$userLongtime
]); ?>
</div>
<div class="col6 textAlignRight">
<a href="<?php echo helper::baseUrl(); ?>user/forgot/<?php echo $this->getUrl(2); ?>">Mot de passe perdu ?</a>
<a href="<?php echo helper::baseUrl(); ?>user/forgot/<?php echo $this->getUrl(2); ?>"><?php echo $text[5]; ?> ?</a>
</div>
</div>
<div class="row">
@ -37,12 +68,12 @@
<?php echo template::button('userLoginBack', [
'href' => helper::baseUrl() . str_replace('_', '/', str_replace('__', '#', $this->getUrl(2))),
'ico' => 'left',
'value' => 'Annuler'
'value' => $text[2]
]); ?>
</div>
<div class="col3">
<?php echo template::submit('userLoginSubmit', [
'value' => 'Connexion',
'value' => $text[3],
'ico' => 'lock'
]); ?>
</div>

View File

@ -1,20 +1,36 @@
<?php echo template::formOpen('userResetForm'); ?>
<?php echo template::formOpen('userResetForm');
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Nouveau mot de passe';
$text[1] = 'Confirmation';
$text[2] = 'Valider';
break;
case 'en' :
$text[0] = 'New password';
$text[1] = 'Confirmation';
$text[2] = 'Validate';
break;
}
?>
<div class="row">
<div class="col6">
<?php echo template::password('userResetNewPassword', [
'label' => 'Nouveau mot de passe'
'label' => $text[0]
]); ?>
</div>
<div class="col6">
<?php echo template::password('userResetConfirmPassword', [
'label' => 'Confirmation'
'label' => $text[1]
]); ?>
</div>
</div>
<div class="row">
<div class="col2 offset10">
<?php echo template::submit('userResetSubmit', [
'value' => 'Valider'
'value' => $text[2]
]); ?>
</div>
</div>

View File

@ -3,8 +3,8 @@
return array(
'Select' => 'Sélectionner',
'Deselect_All' => 'Deselect All',
'Select_All' => 'Select All',
'Deselect_All' => 'Désélectionner tout',
'Select_All' => 'Sélectionner tout',
'Erase' => 'Effacer',
'Open' => 'Ouvrir',
'Confirm_del' => 'Êtes-vous sûr de vouloir effacer ce fichier ?',

View File

@ -7,10 +7,14 @@
/**
* Quand tinyMCE est invoqué hors connexion, initialiser privateKey
*/
if ( typeof(privateKey) == 'undefined') {
if ( typeof(privateKey) == 'undefined') {
var privateKey = null;
};
if ( typeof(lang_admin) == 'undefined') {
var lang_admin = "fr_FR";
};
tinymce.init({
// Classe où appliquer l'éditeur
selector: ".editorWysiwyg",
@ -27,7 +31,7 @@ tinymce.init({
});
},
// Langue
language: "fr_FR",
language: lang_admin,
// Plugins
plugins: "advlist anchor autolink autoresize autosave codemirror colorpicker contextmenu fullscreen hr image imagetools link lists media paste searchreplace stickytoolbar tabfocus table template textcolor nonbreaking",
// Contenu de la barre d'outils

261
core/vendor/tinymce/langs/en_GB.js vendored Normal file
View File

@ -0,0 +1,261 @@
tinymce.addI18n('en_GB',{
"Redo": "Redo",
"Undo": "Undo",
"Cut": "Cut",
"Copy": "Copy",
"Paste": "Paste",
"Select all": "Select all",
"New document": "New document",
"Ok": "Ok",
"Cancel": "Cancel",
"Visual aids": "Visual aids",
"Bold": "Bold",
"Italic": "Italic",
"Underline": "Underline",
"Strikethrough": "Strike-through",
"Superscript": "Superscript",
"Subscript": "Subscript",
"Clear formatting": "Clear formatting",
"Align left": "Align left",
"Align center": "Align centre",
"Align right": "Align right",
"Justify": "Justify",
"Bullet list": "Bullet list",
"Numbered list": "Numbered list",
"Decrease indent": "Decrease indent",
"Increase indent": "Increase indent",
"Close": "Close",
"Formats": "Formats",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.",
"Headers": "Headers",
"Header 1": "Header 1",
"Header 2": "Header 2",
"Header 3": "Header 3",
"Header 4": "Header 4",
"Header 5": "Header 5",
"Header 6": "Header 6",
"Headings": "Headings",
"Heading 1": "Heading 1",
"Heading 2": "Heading 2",
"Heading 3": "Heading 3",
"Heading 4": "Heading 4",
"Heading 5": "Heading 5",
"Heading 6": "Heading 6",
"Preformatted": "Preformatted",
"Div": "Div",
"Pre": "Pre",
"Code": "Code",
"Paragraph": "Paragraph",
"Blockquote": "Blockquote",
"Inline": "Inline",
"Blocks": "Blocks",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",
"Font Family": "Font Family",
"Font Sizes": "Font Sizes",
"Class": "Class",
"Browse for an image": "Browse for an image",
"OR": "OR",
"Drop an image here": "Drop an image here",
"Upload": "Upload",
"Block": "Block",
"Align": "Align",
"Default": "Default",
"Circle": "Circle",
"Disc": "Disc",
"Square": "Square",
"Lower Alpha": "Lower Alpha",
"Lower Greek": "Lower Greek",
"Lower Roman": "Lower Roman",
"Upper Alpha": "Upper Alpha",
"Upper Roman": "Upper Roman",
"Anchor": "Anchor",
"Name": "Name",
"Id": "ID",
"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.",
"You have unsaved changes are you sure you want to navigate away?": "You have unsaved changes are you sure you want to navigate away?",
"Restore last draft": "Restore last draft",
"Special character": "Special character",
"Source code": "Source code",
"Insert\/Edit code sample": "Insert\/Edit code sample",
"Language": "Language",
"Code sample": "Code sample",
"Color": "Colour",
"R": "R",
"G": "G",
"B": "B",
"Left to right": "Left to right",
"Right to left": "Right to left",
"Emoticons": "Emoticons",
"Document properties": "Document properties",
"Title": "Title",
"Keywords": "Keywords",
"Description": "Description",
"Robots": "Robots",
"Author": "Author",
"Encoding": "Encoding",
"Fullscreen": "Full-screen",
"Action": "Action",
"Shortcut": "Shortcut",
"Help": "Help",
"Address": "Address",
"Focus to menubar": "Focus to menubar",
"Focus to toolbar": "Focus to toolbar",
"Focus to element path": "Focus to element path",
"Focus to contextual toolbar": "Focus to contextual toolbar",
"Insert link (if link plugin activated)": "Insert link (if link plugin activated)",
"Save (if save plugin activated)": "Save (if save plugin activated)",
"Find (if searchreplace plugin activated)": "Find (if searchreplace plugin activated)",
"Plugins installed ({0}):": "Plugins installed ({0}):",
"Premium plugins:": "Premium plugins:",
"Learn more...": "Learn more...",
"You are using {0}": "You are using {0}",
"Plugins": "Plugins",
"Handy Shortcuts": "Handy Shortcuts",
"Horizontal line": "Horizontal line",
"Insert\/edit image": "Insert\/edit image",
"Image description": "Image description",
"Source": "Source",
"Dimensions": "Dimensions",
"Constrain proportions": "Constrain proportions",
"General": "General",
"Advanced": "Advanced",
"Style": "Style",
"Vertical space": "Vertical space",
"Horizontal space": "Horizontal space",
"Border": "Border",
"Insert image": "Insert image",
"Image": "Image",
"Image list": "Image list",
"Rotate counterclockwise": "Rotate counterclockwise",
"Rotate clockwise": "Rotate clockwise",
"Flip vertically": "Flip vertically",
"Flip horizontally": "Flip horizontally",
"Edit image": "Edit image",
"Image options": "Image options",
"Zoom in": "Zoom in",
"Zoom out": "Zoom out",
"Crop": "Crop",
"Resize": "Resize",
"Orientation": "Orientation",
"Brightness": "Brightness",
"Sharpen": "Sharpen",
"Contrast": "Contrast",
"Color levels": "Colour levels",
"Gamma": "Gamma",
"Invert": "Invert",
"Apply": "Apply",
"Back": "Back",
"Insert date\/time": "Insert date\/time",
"Date\/time": "Date\/time",
"Insert link": "Insert link",
"Insert\/edit link": "Insert\/edit link",
"Text to display": "Text to display",
"Url": "URL",
"Target": "Target",
"None": "None",
"New window": "New window",
"Remove link": "Remove link",
"Anchors": "Anchors",
"Link": "Link",
"Paste or type a link": "Paste or type a link",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?",
"Link list": "Link list",
"Insert video": "Insert video",
"Insert\/edit video": "Insert\/edit video",
"Insert\/edit media": "Insert\/edit media",
"Alternative source": "Alternative source",
"Poster": "Poster",
"Paste your embed code below:": "Paste your embed code below:",
"Embed": "Embed",
"Media": "Media",
"Nonbreaking space": "Non-breaking space",
"Page break": "Page break",
"Paste as text": "Paste as text",
"Preview": "Preview",
"Print": "Print",
"Save": "Save",
"Find": "Find",
"Replace with": "Replace with",
"Replace": "Replace",
"Replace all": "Replace all",
"Prev": "Prev",
"Next": "Next",
"Find and replace": "Find and replace",
"Could not find the specified string.": "Could not find the specified string.",
"Match case": "Match case",
"Whole words": "Whole words",
"Spellcheck": "Spell-check",
"Ignore": "Ignore",
"Ignore all": "Ignore all",
"Finish": "Finish",
"Add to Dictionary": "Add to Dictionary",
"Insert table": "Insert table",
"Table properties": "Table properties",
"Delete table": "Delete table",
"Cell": "Cell",
"Row": "Row",
"Column": "Column",
"Cell properties": "Cell properties",
"Merge cells": "Merge cells",
"Split cell": "Split cell",
"Insert row before": "Insert row before",
"Insert row after": "Insert row after",
"Delete row": "Delete row",
"Row properties": "Row properties",
"Cut row": "Cut row",
"Copy row": "Copy row",
"Paste row before": "Paste row before",
"Paste row after": "Paste row after",
"Insert column before": "Insert column before",
"Insert column after": "Insert column after",
"Delete column": "Delete column",
"Cols": "Cols",
"Rows": "Rows",
"Width": "Width",
"Height": "Height",
"Cell spacing": "Cell spacing",
"Cell padding": "Cell padding",
"Caption": "Caption",
"Left": "Left",
"Center": "Centre",
"Right": "Right",
"Cell type": "Cell type",
"Scope": "Scope",
"Alignment": "Alignment",
"H Align": "H Align",
"V Align": "V Align",
"Top": "Top",
"Middle": "Middle",
"Bottom": "Bottom",
"Header cell": "Header cell",
"Row group": "Row group",
"Column group": "Column group",
"Row type": "Row type",
"Header": "Header",
"Body": "Body",
"Footer": "Footer",
"Border color": "Border colour",
"Insert template": "Insert template",
"Templates": "Templates",
"Template": "Template",
"Text color": "Text colour",
"Background color": "Background colour",
"Custom...": "Custom...",
"Custom color": "Custom colour",
"No color": "No colour",
"Table of Contents": "Table of Contents",
"Show blocks": "Show blocks",
"Show invisible characters": "Show invisible characters",
"Words: {0}": "Words: {0}",
"{0} words": "{0} words",
"File": "File",
"Edit": "Edit",
"Insert": "Insert",
"View": "View",
"Format": "Format",
"Table": "Table",
"Tools": "Tools",
"Powered by {0}": "Powered by {0}",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"
});

View File

@ -0,0 +1,261 @@
tinymce.addI18n('en_GB',{
"Redo": "Redo",
"Undo": "Undo",
"Cut": "Cut",
"Copy": "Copy",
"Paste": "Paste",
"Select all": "Select all",
"New document": "New document",
"Ok": "Ok",
"Cancel": "Cancel",
"Visual aids": "Visual aids",
"Bold": "Bold",
"Italic": "Italic",
"Underline": "Underline",
"Strikethrough": "Strike-through",
"Superscript": "Superscript",
"Subscript": "Subscript",
"Clear formatting": "Clear formatting",
"Align left": "Align left",
"Align center": "Align centre",
"Align right": "Align right",
"Justify": "Justify",
"Bullet list": "Bullet list",
"Numbered list": "Numbered list",
"Decrease indent": "Decrease indent",
"Increase indent": "Increase indent",
"Close": "Close",
"Formats": "Formats",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.",
"Headers": "Headers",
"Header 1": "Header 1",
"Header 2": "Header 2",
"Header 3": "Header 3",
"Header 4": "Header 4",
"Header 5": "Header 5",
"Header 6": "Header 6",
"Headings": "Headings",
"Heading 1": "Heading 1",
"Heading 2": "Heading 2",
"Heading 3": "Heading 3",
"Heading 4": "Heading 4",
"Heading 5": "Heading 5",
"Heading 6": "Heading 6",
"Preformatted": "Preformatted",
"Div": "Div",
"Pre": "Pre",
"Code": "Code",
"Paragraph": "Paragraph",
"Blockquote": "Blockquote",
"Inline": "Inline",
"Blocks": "Blocks",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",
"Font Family": "Font Family",
"Font Sizes": "Font Sizes",
"Class": "Class",
"Browse for an image": "Browse for an image",
"OR": "OR",
"Drop an image here": "Drop an image here",
"Upload": "Upload",
"Block": "Block",
"Align": "Align",
"Default": "Default",
"Circle": "Circle",
"Disc": "Disc",
"Square": "Square",
"Lower Alpha": "Lower Alpha",
"Lower Greek": "Lower Greek",
"Lower Roman": "Lower Roman",
"Upper Alpha": "Upper Alpha",
"Upper Roman": "Upper Roman",
"Anchor": "Anchor",
"Name": "Name",
"Id": "ID",
"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.",
"You have unsaved changes are you sure you want to navigate away?": "You have unsaved changes are you sure you want to navigate away?",
"Restore last draft": "Restore last draft",
"Special character": "Special character",
"Source code": "Source code",
"Insert\/Edit code sample": "Insert\/Edit code sample",
"Language": "Language",
"Code sample": "Code sample",
"Color": "Colour",
"R": "R",
"G": "G",
"B": "B",
"Left to right": "Left to right",
"Right to left": "Right to left",
"Emoticons": "Emoticons",
"Document properties": "Document properties",
"Title": "Title",
"Keywords": "Keywords",
"Description": "Description",
"Robots": "Robots",
"Author": "Author",
"Encoding": "Encoding",
"Fullscreen": "Full-screen",
"Action": "Action",
"Shortcut": "Shortcut",
"Help": "Help",
"Address": "Address",
"Focus to menubar": "Focus to menubar",
"Focus to toolbar": "Focus to toolbar",
"Focus to element path": "Focus to element path",
"Focus to contextual toolbar": "Focus to contextual toolbar",
"Insert link (if link plugin activated)": "Insert link (if link plugin activated)",
"Save (if save plugin activated)": "Save (if save plugin activated)",
"Find (if searchreplace plugin activated)": "Find (if searchreplace plugin activated)",
"Plugins installed ({0}):": "Plugins installed ({0}):",
"Premium plugins:": "Premium plugins:",
"Learn more...": "Learn more...",
"You are using {0}": "You are using {0}",
"Plugins": "Plugins",
"Handy Shortcuts": "Handy Shortcuts",
"Horizontal line": "Horizontal line",
"Insert\/edit image": "Insert\/edit image",
"Image description": "Image description",
"Source": "Source",
"Dimensions": "Dimensions",
"Constrain proportions": "Constrain proportions",
"General": "General",
"Advanced": "Advanced",
"Style": "Style",
"Vertical space": "Vertical space",
"Horizontal space": "Horizontal space",
"Border": "Border",
"Insert image": "Insert image",
"Image": "Image",
"Image list": "Image list",
"Rotate counterclockwise": "Rotate counterclockwise",
"Rotate clockwise": "Rotate clockwise",
"Flip vertically": "Flip vertically",
"Flip horizontally": "Flip horizontally",
"Edit image": "Edit image",
"Image options": "Image options",
"Zoom in": "Zoom in",
"Zoom out": "Zoom out",
"Crop": "Crop",
"Resize": "Resize",
"Orientation": "Orientation",
"Brightness": "Brightness",
"Sharpen": "Sharpen",
"Contrast": "Contrast",
"Color levels": "Colour levels",
"Gamma": "Gamma",
"Invert": "Invert",
"Apply": "Apply",
"Back": "Back",
"Insert date\/time": "Insert date\/time",
"Date\/time": "Date\/time",
"Insert link": "Insert link",
"Insert\/edit link": "Insert\/edit link",
"Text to display": "Text to display",
"Url": "URL",
"Target": "Target",
"None": "None",
"New window": "New window",
"Remove link": "Remove link",
"Anchors": "Anchors",
"Link": "Link",
"Paste or type a link": "Paste or type a link",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?",
"Link list": "Link list",
"Insert video": "Insert video",
"Insert\/edit video": "Insert\/edit video",
"Insert\/edit media": "Insert\/edit media",
"Alternative source": "Alternative source",
"Poster": "Poster",
"Paste your embed code below:": "Paste your embed code below:",
"Embed": "Embed",
"Media": "Media",
"Nonbreaking space": "Non-breaking space",
"Page break": "Page break",
"Paste as text": "Paste as text",
"Preview": "Preview",
"Print": "Print",
"Save": "Save",
"Find": "Find",
"Replace with": "Replace with",
"Replace": "Replace",
"Replace all": "Replace all",
"Prev": "Prev",
"Next": "Next",
"Find and replace": "Find and replace",
"Could not find the specified string.": "Could not find the specified string.",
"Match case": "Match case",
"Whole words": "Whole words",
"Spellcheck": "Spell-check",
"Ignore": "Ignore",
"Ignore all": "Ignore all",
"Finish": "Finish",
"Add to Dictionary": "Add to Dictionary",
"Insert table": "Insert table",
"Table properties": "Table properties",
"Delete table": "Delete table",
"Cell": "Cell",
"Row": "Row",
"Column": "Column",
"Cell properties": "Cell properties",
"Merge cells": "Merge cells",
"Split cell": "Split cell",
"Insert row before": "Insert row before",
"Insert row after": "Insert row after",
"Delete row": "Delete row",
"Row properties": "Row properties",
"Cut row": "Cut row",
"Copy row": "Copy row",
"Paste row before": "Paste row before",
"Paste row after": "Paste row after",
"Insert column before": "Insert column before",
"Insert column after": "Insert column after",
"Delete column": "Delete column",
"Cols": "Cols",
"Rows": "Rows",
"Width": "Width",
"Height": "Height",
"Cell spacing": "Cell spacing",
"Cell padding": "Cell padding",
"Caption": "Caption",
"Left": "Left",
"Center": "Centre",
"Right": "Right",
"Cell type": "Cell type",
"Scope": "Scope",
"Alignment": "Alignment",
"H Align": "H Align",
"V Align": "V Align",
"Top": "Top",
"Middle": "Middle",
"Bottom": "Bottom",
"Header cell": "Header cell",
"Row group": "Row group",
"Column group": "Column group",
"Row type": "Row type",
"Header": "Header",
"Body": "Body",
"Footer": "Footer",
"Border color": "Border colour",
"Insert template": "Insert template",
"Templates": "Templates",
"Template": "Template",
"Text color": "Text colour",
"Background color": "Background colour",
"Custom...": "Custom...",
"Custom color": "Custom colour",
"No color": "No colour",
"Table of Contents": "Table of Contents",
"Show blocks": "Show blocks",
"Show invisible characters": "Show invisible characters",
"Words: {0}": "Words: {0}",
"{0} words": "{0} words",
"File": "File",
"Edit": "Edit",
"Insert": "Insert",
"View": "View",
"Format": "Format",
"Table": "Table",
"Tools": "Tools",
"Powered by {0}": "Powered by {0}",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"
});

View File

@ -53,4 +53,4 @@
.zwiico-youtube:before { content: '\f167'; } /* '' */
.zwiico-instagram:before { content: '\f16d'; } /* '' */
.zwiico-brush:before { content: '\f1fc'; } /* '' */
.zwiico-pinterest:before { content: '\f231'; } /* '' */
.zwiico-pinterest:before { content: '\f231'; } /* '' */

View File

@ -110,4 +110,5 @@
.zwiico-youtube:before { content: '\f167'; } /* '' */
.zwiico-instagram:before { content: '\f16d'; } /* '' */
.zwiico-brush:before { content: '\f1fc'; } /* '' */
.zwiico-pinterest:before { content: '\f231'; } /* '' */
.zwiico-pinterest:before { content: '\f231'; } /* '' */

View File

@ -35,7 +35,7 @@
}
},
plugins: [ 'dayGrid', 'interaction' ],
locale : 'fr',
locale : '<?php echo $this->getData(['config', 'i18n', 'langBase']) ;?>',
defaultView: '<?php echo $this->getData(['module', $this->getUrl(0), 'vue', 'vueagenda']) ;?>',
defaultDate: '<?php echo $this->getData(['module', $this->getUrl(0), 'vue', 'debagenda']) ;?>',
selectable: true,

View File

@ -61,6 +61,15 @@ class form extends common {
self::TYPE_CHECKBOX => 'Case à cocher',
self::TYPE_DATETIME => 'Date'
];
public static $types_en = [
self::TYPE_LABEL => 'Label',
self::TYPE_TEXT => 'Text field',
self::TYPE_TEXTAREA => 'Large text field',
self::TYPE_MAIL => 'Mail field',
self::TYPE_SELECT => 'Selection',
self::TYPE_CHECKBOX => 'Check box',
self::TYPE_DATETIME => 'Date'
];
public static $listUsers = [
];
@ -69,7 +78,10 @@ class form extends common {
'text' => 'Nom du site',
'logo' => 'Logo du site'
];
public static $signature_en = [
'text' => 'Name of the site',
'logo' => 'Website logo'
];
public static $logoWidth = [
'40' => '40%',
'60' => '60%',
@ -81,6 +93,19 @@ class form extends common {
* Configuration
*/
public function config() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Modifications enregistrées';
$text[1] = 'Configuration du module';
break;
case 'en' :
$text[0] = 'Saved changes';
$text[1] = 'Module configuration';
break;
}
// Liste des utilisateurs
$userIdsFirstnames = helper::arrayCollumn($this->getData(['user']), 'firstname');
ksort($userIdsFirstnames);
@ -127,7 +152,7 @@ class form extends common {
$this->setData(['module', $this->getUrl(0), 'input', $inputs]);
// Valeurs en sortie
$this->addOutput([
'notification' => 'Modifications enregistrées',
'notification' => $text[0],
'redirect' => helper::baseUrl() . $this->getUrl(),
'state' => true
]);
@ -141,7 +166,7 @@ class form extends common {
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration du module',
'title' => $text[1],
'vendor' => [
'html-sortable',
'flatpickr'
@ -154,6 +179,17 @@ class form extends common {
* Données enregistrées
*/
public function data() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Données enregistrées';
break;
case 'en' :
$text[0] = 'Registered data';
break;
}
$data = $this->getData(['module', $this->getUrl(0), 'data']);
if($data) {
// Pagination
@ -181,7 +217,7 @@ class form extends common {
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Données enregistrées',
'title' => $text[0],
'view' => 'data'
]);
}
@ -192,12 +228,27 @@ class form extends common {
* @copyright Copyright (C) 2018-2021, Frédéric Tempez
*/
public function export2csv() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Action non autorisée';
$text[1] = 'Export CSV effectué dans le gestionnaire de fichiers<br />sous le nom ';
$text[2] = 'Aucune donnée à exporter';
break;
case 'en' :
$text[0] = 'Action not allowed';
$text[1] = 'CSV export performed in the file manager under the name ';
$text[2] = 'No data to export';
break;
}
// Jeton incorrect
if ($this->getUrl(2) !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/data',
'notification' => 'Action non autorisée'
'notification' => $text[0]
]);
} else {
$data = $this->getData(['module', $this->getUrl(0), 'data']);
@ -214,13 +265,13 @@ class form extends common {
fclose($fp);
// Valeurs en sortie
$this->addOutput([
'notification' => 'Export CSV effectué dans le gestionnaire de fichiers<br />sous le nom '.$csvfilename,
'notification' => $text[1].$csvfilename,
'redirect' => helper::baseUrl() . $this->getUrl(0) .'/data',
'state' => true
]);
} else {
$this->addOutput([
'notification' => 'Aucune donnée à exporter',
'notification' => $text[2],
'redirect' => helper::baseUrl() . $this->getUrl(0) .'/data'
]);
}
@ -232,12 +283,27 @@ class form extends common {
* Suppression
*/
public function deleteall() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Action non autorisée';
$text[1] = 'Données supprimées';
$text[2] = 'Aucune donnée à supprimer';
break;
case 'en' :
$text[0] = 'Unauthorised action';
$text[1] = 'Data deleted';
$text[2] = 'No data to be deleted';
break;
}
// Jeton incorrect
if ($this->getUrl(2) !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/data',
'notification' => 'Action non autorisée'
'notification' => $text[0]
]);
} else {
$data = ($this->getData(['module', $this->getUrl(0), 'data']));
@ -249,14 +315,14 @@ class form extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/data',
'notification' => 'Données supprimées',
'notification' => $text[1],
'state' => true
]);
} else {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/data',
'notification' => 'Aucune donnée à supprimer'
'notification' => $text[2]
]);
}
}
@ -267,12 +333,25 @@ class form extends common {
* Suppression
*/
public function delete() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Action non autorisée';
$text[1] = 'Donnée supprimée';
break;
case 'en' :
$text[0] = 'Unauthorised action';
$text[1] = 'Data deleted';
break;
}
// Jeton incorrect
if ($this->getUrl(3) !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/data',
'notification' => 'Action non autorisée'
'notification' => $text[0]
]);
} else {
// La donnée n'existe pas
@ -288,7 +367,7 @@ class form extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/data',
'notification' => 'Donnée supprimée',
'notification' => $text[1],
'state' => true
]);
}
@ -302,6 +381,23 @@ class form extends common {
* Accueil
*/
public function index() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Incorrect';
$text[1] = 'Nouveau message en provenance de votre site';
$text[2] = 'Nouveau message en provenance de la page "';
$text[3] = 'Formulaire soumis';
break;
case 'en' :
$text[0] = 'Incorrect';
$text[1] = 'New message from your site';
$text[2] = 'New message from the page "';
$text[3] = 'Form submitted';
break;
}
// Soumission du formulaire
if($this->isPost()) {
// Check la captcha
@ -310,7 +406,7 @@ class form extends common {
// AND $this->getInput('formcaptcha', helper::FILTER_INT) !== $this->getInput('formcaptchaFirstNumber', helper::FILTER_INT) + $this->getInput('formcaptchaSecondNumber', helper::FILTER_INT))
AND password_verify($this->getInput('formCaptcha', helper::FILTER_INT), $this->getInput('formCaptchaResult') ) === false )
{
self::$inputNotices['formCaptcha'] = 'Incorrect';
self::$inputNotices['formCaptcha'] = $text[0];
}
// Préparation le contenu du mail
@ -384,13 +480,13 @@ class form extends common {
// Sujet du mail
$subject = $this->getData(['module', $this->getUrl(0), 'config', 'subject']);
if($subject === '') {
$subject = 'Nouveau message en provenance de votre site';
$subject = $text[1];
}
// Envoi le mail
$sent = $this->sendMail(
$to,
$subject,
'Nouveau message en provenance de la page "' . $this->getData(['page', $this->getUrl(0), 'title']) . '" :<br><br>' .
$text[2] . $this->getData(['page', $this->getUrl(0), 'title']) . '" :<br><br>' .
$content,
$replyTo
);
@ -400,7 +496,7 @@ class form extends common {
$redirect = $this->getData(['module', $this->getUrl(0), 'config', 'pageId']);
// Valeurs en sortie
$this->addOutput([
'notification' => ($sent === true ? 'Formulaire soumis' : $sent),
'notification' => ($sent === true ? $text[3] : $sent),
'redirect' => $redirect ? helper::baseUrl() . $redirect : '',
'state' => ($sent === true ? true : null),
'vendor' => [

View File

@ -1,3 +1,80 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Intitulé';
$text[1] = 'Aucune option pour une étiquette';
$text[2] = 'Liste des valeurs séparées par des virgules (valeur1,valeur2,...)';
$text[3] = 'Champ obligatoire';
$text[4] = 'Retour';
$text[5] = 'Gérer les données';
$text[6] = 'Configuration';
$text[7] = 'Laissez vide afin de conserver le texte par défaut.';
$text[8] = 'Texte du bouton de soumission';
$text[9] = 'Envoyer par mail les données saisies :';
$text[10] = 'Sélectionnez au moins un groupe, un utilisateur ou saississez un email. Votre serveur doit autoriser les envois de mail.';
$text[11] = 'Laissez vide afin de conserver le texte par défaut.';
$text[12] = 'Sujet du mail';
$text[13] = 'Aux groupes à partir de ';
$text[14] = 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs';
$text[15] = 'A un membre';
$text[16] = 'A une adresse email';
$text[17] = 'Un email ou une liste de diffusion';
$text[18] = 'Répondre à l\'expéditeur depuis le mail de notification';
$text[19] = 'Cette option permet de réponse drectement à l\'expéditeur du message si celui-ci a indiqué un email valide.';
$text[20] = 'Sélectionner le type de signature';
$text[21] = 'Sélectionnez le logo du site';
$text[22] = 'Logo';
$text[23] = 'Sélectionner la largeur du logo';
$text[24] = 'Redirection après soumission du formulaire';
$text[25] = 'Sélectionner une page du site :';
$text[26] = 'Valider un captcha afin de soumettre le formulaire.';
$text[27] = 'Liste des champs';
$text[28] = 'Le formulaire ne contient aucun champ.';
$text[29] = 'Version n°';
$text[30] = 'Enregistrer';
$types = $module::$types;
$signature = $module::$signature;
break;
case 'en' :
$text[0] = 'Heading';
$text[1] = 'No option for a label';
$text[2] = 'Comma separated list of values (value1,value2,...)';
$text[3] = 'Required field';
$text[4] = 'Back';
$text[5] = 'Manage data';
$text[6] = 'Configuration';
$text[7] = 'Leave blank to keep default text';
$text[8] = 'Submit button text';
$text[9] = 'Send entered data by email :';
$text[10] = 'Select at least one group, user or enter an email. Your server must allow mail to be sent.';
$text[11] = 'Leave blank to keep the default text';
$text[12] = 'Mail subject';
$text[13] = 'To groups from ';
$text[14] = 'Publishers = publishers + administrators<br/> Members = members + editors + administrators';
$text[15] = 'To a member';
$text[16] = 'To an email address';
$text[17] = 'An email or mailing list';
$text[18] = 'Reply to the sender from the notification email';
$text[19] = 'This option allows the sender of the message to be replied to directly if he/she has given a valid email address';
$text[20] = 'Select signature type';
$text[21] = 'Select the site logo';
$text[22] = 'Logo';
$text[23] = 'Select logo width';
$text[24] = 'Redirect after form submission';
$text[25] = 'Select a page from the site:';
$text[26] = 'Validate a captcha in order to submit the form';
$text[27] = 'List of fields';
$text[28] = 'The form contains no fields';
$text[29] = 'Version no.';
$text[30] = 'Register';
$types = $module::$types_en;
$signature = $module::$signature_en;
break;
}
?>
<div id="formConfigCopy" class="displayNone">
<div class="formConfigInput">
<?php echo template::hidden('formConfigPosition[]', [
@ -12,11 +89,11 @@
</div>
<div class="col5">
<?php echo template::text('formConfigName[]', [
'placeholder' => 'Intitulé'
'placeholder' => $text[0]
]); ?>
</div>
<div class="col4">
<?php echo template::select('formConfigType[]', $module::$types, [
<?php echo template::select('formConfigType[]', $types, [
'class' => 'formConfigType'
]); ?>
</div>
@ -34,17 +111,17 @@
</div>
</div>
<div class="formConfigMoreLabel displayNone">
<?php echo template::label('formConfigLabel', 'Aucune option pour une étiquette', [
<?php echo template::label('formConfigLabel', $text[1], [
'class' => 'displayNone formConfigLabelWrapper'
]); ?>
</div>
<div class="formConfigMore displayNone">
<?php echo template::text('formConfigValues[]', [
'placeholder' => 'Liste des valeurs séparées par des virgules (valeur1,valeur2,...)',
'placeholder' => $text[2],
'class' => 'formConfigValues',
'classWrapper' => 'displayNone formConfigValuesWrapper'
]); ?>
<?php echo template::checkbox('formConfigRequired[]', true, 'Champ obligatoire'); ?>
<?php echo template::checkbox('formConfigRequired[]', true, $text[3]); ?>
</div>
</div>
</div>
@ -55,40 +132,42 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
'ico' => 'left',
'value' => 'Retour'
'value' => $text[4]
]); ?>
</div>
<div class="col3 offset5">
<?php echo template::button('formConfigData', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/data',
'value' => 'Gérer les données'
'value' => $text[5]
]); ?>
</div>
<div class="col2">
<?php echo template::submit('formConfigSubmit'); ?>
<?php echo template::submit('formConfigSubmit',[
'value' => $text[30]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Configuration</h4>
<h4><?php echo $text[6]; ?></h4>
<?php echo template::text('formConfigButton', [
'help' => 'Laissez vide afin de conserver le texte par défaut.',
'label' => 'Texte du bouton de soumission',
'help' => $text[7],
'label' => $text[8],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'button'])
]); ?>
<?php echo template::checkbox('formConfigMailOptionsToggle', true, 'Envoyer par mail les données saisies :', [
<?php echo template::checkbox('formConfigMailOptionsToggle', true, $text[9], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'group']) ||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'user'])) ||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'mail'])),
'help' => 'Sélectionnez au moins un groupe, un utilisateur ou saississez un email. Votre serveur doit autoriser les envois de mail.'
'help' => $text[10]
]); ?>
<div id="formConfigMailOptions" class="displayNone">
<div class="row">
<div class="col11 offset1">
<?php echo template::text('formConfigSubject', [
'help' => 'Laissez vide afin de conserver le texte par défaut.',
'label' => 'Sujet du mail',
'help' => $text[11],
'label' => $text[12],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'subject'])
]); ?>
</div>
@ -100,77 +179,77 @@
<div class="row">
<div class="col3 offset1">
<?php echo template::select('formConfigGroup', $groupMembers, [
'label' => 'Aux groupes à partir de',
'label' => $text[13],
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'group']),
'help' => 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs'
'help' => $text[14]
]); ?>
</div>
<div class="col3">
<?php echo template::select('formConfigUser', $module::$listUsers, [
'label' => 'A un membre',
'label' => $text[15],
'selected' => array_search($this->getData(['module', $this->getUrl(0), 'config', 'user']),$module::$listUsers)
]); ?>
</div>
<div class="col4">
<?php echo template::text('formConfigMail', [
'label' => 'A une adresse email',
'label' => $text[16],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'mail']),
'help' => 'Un email ou une liste de diffusion'
'help' => $text[17]
]); ?>
</div>
</div>
<div class="row">
<div class="col6 offset1">
<?php echo template::checkbox('formConfigMailReplyTo', true, 'Répondre à l\'expéditeur depuis le mail de notification', [
<?php echo template::checkbox('formConfigMailReplyTo', true, $text[18], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'replyto']),
'help' => 'Cette option permet de réponse drectement à l\'expéditeur du message si celui-ci a indiqué un email valide.'
'help' => $text[19]
]); ?>
</div>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('formConfigSignature', $module::$signature, [
'label' => 'Sélectionner le type de signature',
<?php echo template::select('formConfigSignature', $signature, [
'label' => $text[20],
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'signature'])
]); ?>
</div>
<div class="col4">
<?php echo template::file('formConfigLogo', [
'help' => 'Sélectionnez le logo du site',
'label' => 'Logo',
'help' => $text[21],
'label' => $text[22],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'logoUrl'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('formConfigLogoWidth', $module::$logoWidth, [
'label' => 'Sélectionner la largeur du logo',
'label' => $text[23],
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'logoWidth'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('formConfigPageIdToggle', true, 'Redirection après soumission du formulaire', [
<?php echo template::checkbox('formConfigPageIdToggle', true, $text[24], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'pageId'])
]); ?>
</div>
<div class="col5">
<?php echo template::select('formConfigPageId', $module::$pages, [
'classWrapper' => 'displayNone',
'label' => 'Sélectionner une page du site :',
'label' => $text[25],
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageId'])
]); ?>
</div>
</div>
<?php echo template::checkbox('formConfigCaptcha', true, 'Valider un captcha afin de soumettre le formulaire.', [
<?php echo template::checkbox('formConfigCaptcha', true, $text[26], [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'captcha'])
]); ?>
</div>
<div class="block">
<h4>Liste des champs</h4>
<h4><?php echo $text[27]; ?></h4>
<div id="formConfigNoInput">
<?php echo template::speech('Le formulaire ne contient aucun champ.'); ?>
<?php echo template::speech($text[28]); ?>
</div>
<div id="formConfigInputs"></div>
<div class="row">
@ -184,6 +263,6 @@
</div>
</div>
<?php echo template::formClose(); ?>
<div class="moduleVersion">Version
<div class="moduleVersion"><?php echo $text[29]; ?>
<?php echo $module::VERSION; ?>
</div>

View File

@ -19,7 +19,14 @@
*/
$(".formDataDelete").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer cette donnée ?", function() {
text="";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Êtes-vous sûr de vouloir supprimer cette donnée ?";' ;
}
else{
echo 'text = "Are you sure you want to delete this data ?";' ;
} ?>
return core.confirm(text, function() {
$(location).attr("href", _this.attr("href"));
});
});
@ -29,7 +36,15 @@ $(".formDataDelete").on("click", function() {
*/
$(".formDataDeleteAll").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer toutes les données ?", function() {
var text="";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Êtes-vous sûr de vouloir supprimer toutes les données ?";' ;
}
else{
echo 'text = "Are you sure you want to delete all the data ?";' ;
} ?>
return core.confirm(text, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -1,10 +1,33 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Tout effacer';
$text[2] = 'Export CSV';
$text[3] = 'Données';
$text[4] = 'Aucune donnée';
$text[5] = 'Version n°';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Delete all';
$text[2] = 'CSV export';
$text[3] = 'Data';
$text[4] = 'No data';
$text[5] = 'Version No';
break;
}
?>
<div class="row">
<div class="col2">
<?php echo template::button('formDataBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2 offset6">
@ -12,23 +35,23 @@
'class' => 'formDataDeleteAll buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/deleteall' . '/' . $_SESSION['csrf'],
'ico' => 'cancel',
'value' => 'Tout effacer'
'value' => $text[1]
]); ?>
</div>
<div class="col2">
<?php echo template::button('formDataBack', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/export2csv' . '/' . $_SESSION['csrf'],
'ico' => 'download',
'value' => 'Export CSV'
'value' => $text[2]
]); ?>
</div>
</div>
<?php if($module::$data): ?>
<?php echo template::table([11, 1], $module::$data, ['Données', '']); ?>
<?php echo template::table([11, 1], $module::$data, [$text[3], '']); ?>
<?php echo $module::$pages; ?>
<?php else: ?>
<?php echo template::speech('Aucune donnée'); ?>
<?php echo template::speech($text[4]); ?>
<?php endif; ?>
<div class="moduleVersion">Version
<div class="moduleVersion"><?php echo $text[5]; ?>
<?php echo $module::VERSION; ?>
</div>

View File

@ -1,3 +1,18 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Envoyer';
$text[1] = 'Le formulaire ne contient aucun champ.';
break;
case 'en' :
$text[0] = 'Send';
$text[1] = 'The form contains no fields';
break;
}
?>
<?php if($this->getData(['module', $this->getUrl(0), 'input'])): ?>
<?php echo template::formOpen('formForm'); ?>
<?php foreach($this->getData(['module', $this->getUrl(0), 'input']) as $index => $input): ?>
@ -56,12 +71,12 @@
<div class="row">
<div class="col2 offset10">
<?php echo template::submit('formSubmit', [
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'button']) ? $this->getData(['module', $this->getUrl(0), 'config', 'button']) : 'Envoyer',
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'button']) ? $this->getData(['module', $this->getUrl(0), 'config', 'button']) : $text[0],
'ico' => ''
]); ?>
</div>
</div>
<?php echo template::formClose(); ?>
<?php else: ?>
<?php echo template::speech('Le formulaire ne contient aucun champ.'); ?>
<?php echo template::speech($text[1]); ?>
<?php endif; ?>

View File

@ -0,0 +1,79 @@
.galleryRow {
--thumbAlign: center;
}
.colPicture {
--thumbWidth: 18em;
--thumbMargin: .5em;
}
.galleryPicture,
.galleryGalleryPicture {
--thumbHeight: 15em;
--thumbBorder: .1em;
--thumbBorderColor: rgba(221, 221, 221, 1);
--thumbRadius: .3em;
--thumbShadows: 1px 1px 10px;
--thumbShadowsColor: rgba(125, 125, 125, 1);
}
.galleryName,
.galleryGalleryName {
--legendHeight: .375em;
--legendAlign: center;
--legendTextColor: rgba(255, 255, 255, 1);
--legendBgColor: rgba(0, 0, 0, .6);
}
.galleryPicture:hover,
.galleryGalleryPicture:hover {
--thumbOpacity: .7;
}
.galleryPicture,
.galleryGalleryPicture {
display: block;
border: var(--thumbBorder) solid var(--thumbBorderColor);
height: var(--thumbHeight);
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: relative;
-webkit-transition: opacity .3s ease-out;
transition: opacity .3s ease-out;
border-radius: var(--thumbRadius);
box-shadow: var(--thumbShadows) var(--thumbShadowsColor);
-webkit-box-shadow: var(--thumbShadows) var(--thumbShadowsColor);
-moz-box-shadow: var(--thumbShadows) var(--thumbShadowsColor);
}
.galleryPicture:hover,
.galleryGalleryPicture:hover {
opacity: var(--thumbOpacity);
}
.galleryName,
.galleryGalleryName {
position: absolute;
left: 0;
right: 0;
bottom: 0;
border-radius: 0 0 calc(var(--thumbRadius)/2) calc(var(--thumbRadius)/2);
padding: var(--legendHeight);
background: var(--legendBgColor);
color: var(--legendTextColor);
text-align: var(--legendAlign);
}
.galleryRow {
display: flex;
flex-wrap: wrap;
justify-content: var(--thumbAlign);
}
.colPicture {
width : var(--thumbWidth);
max-width: 50%;
padding: var(--thumbMargin);
}
@media (max-width: 432px) {
.colPicture {
width: 90%;
max-width: 90%;
margin: 0.5em;
}
}

View File

@ -43,6 +43,10 @@ class news extends common {
false => 'Brouillon',
true => 'Publié'
];
public static $states_en = [
false => 'Draft',
true => 'Published'
];
public static $users = [];
@ -61,6 +65,12 @@ class news extends common {
4 => '3 colonnes',
3 => '4 colonnes'
];
public static $columns_en = [
12 => '1 column',
6 => '2 columns',
4 => '3 columns',
3 => '4 columns'
];
public static $nbrCol = 1;
public static $height = [
@ -69,7 +79,15 @@ class news extends common {
800 => '800 caractères',
600 => '600 caractères',
400 => '400 caractères',
200 => '200 caractères',
200 => '200 caractères'
];
public static $height_en = [
-1 => 'Complete article',
1000 => '1000 characters',
800 => '800 characters',
600 => '600 characters',
400 => '400 characters',
200 => '200 characters'
];
public static $borderWidth = [
@ -77,9 +95,15 @@ class news extends common {
'0.1em' => 'Très fine',
'0.15em' => 'Fine',
'0.2em' => 'Très petite',
'0.25em' => 'Petite',
'0.25em' => 'Petite'
];
public static $borderWidth_en = [
0 => 'None',
'0.1em' => 'Very fine',
'0.15em' => 'Fine',
'0.2em' => 'Very small',
'0.25em' => 'Small'
];
public static $borderStyle =[
'none' => 'Aucune',
'solid' => 'Tiret',
@ -88,7 +112,14 @@ class news extends common {
'ridge' => 'Relief 1',
'groove'=> 'Relief 2'
];
public static $borderStyle_en =[
'none' => 'None',
'solid' => 'Dash',
'inset' => '3D recessed',
'outset' => '3D raised',
'ridge' => 'Relief 1',
'groove' => 'Relief 2'
];
// Signature de l'article
public static $articleSignature = '';
@ -145,6 +176,19 @@ class news extends common {
* Ajout d'un article
*/
public function add() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Nouvelle news créée';
$text[1] = 'Nouvelle news';
break;
case 'en' :
$text[0] = 'New news created';
$text[1] = 'New news';
break;
}
// Soumission du formulaire
if($this->isPost()) {
// Crée la news
@ -162,7 +206,7 @@ class news extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
'notification' => 'Nouvelle news créée',
'notification' => $text[0],
'state' => true
]);
}
@ -173,9 +217,17 @@ class news extends common {
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']);
}
unset($userFirstname);
// Passage de la langue d'administration à Tinymce
$lang_admin = 'fr_FR';
if( $this->getData(['config', 'i18n', 'langAdmin']) ==='en') $lang_admin = 'en_GB';
?>
<script>
var lang_admin = "<?php echo $lang_admin ?>";
</script>
<?php
// Valeurs en sortie
$this->addOutput([
'title' => 'Nouvelle news',
'title' => $text[1],
'vendor' => [
'flatpickr',
'tinymce'
@ -188,7 +240,23 @@ class news extends common {
* Configuration
*/
public function config() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Modifications enregistrées';
$text[1] = 'Permanent';
$text[2] = 'Configuration du module';
$text[3] = ' à ';
break;
case 'en' :
$text[0] = 'Changes saved';
$text[1] = 'Permanent';
$text[2] = 'Module configuration';
$text[3] = ' at ';
break;
}
// Mise à jour des données de module
$this->update();
@ -232,7 +300,7 @@ class news extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
'notification' => 'Modifications enregistrées',
'notification' => $text[0],
'state' => true
]);
} else {
@ -243,12 +311,14 @@ class news extends common {
// Liste des pages
self::$pages = $pagination['pages'];
// News en fonction de la pagination
setlocale(LC_TIME, 'fr_FR');
if( $this->getData(['config', 'i18n', 'langAdmin']) === 'en') setlocale(LC_TIME, 'en_GB');
for($i = $pagination['first']; $i < $pagination['last']; $i++) {
// Met en forme le tableau
$dateOn = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true)
? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))
: utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])));
$dateOn .= ' à ';
$dateOn .= $text[3];
$dateOn .= mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true)
? strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))
: utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])));
@ -256,18 +326,20 @@ class news extends common {
$dateOff = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true)
? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))
: utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])));
$dateOff .= ' à ';
$dateOff .= $text[3];
$dateOff .= mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true)
? strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))
: utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])));
} else {
$dateOff = 'Permanent';
$dateOff = $text[1];
}
$states = self::$states;
if( $this->getData(['config', 'i18n', 'langAdmin']) === 'en') $states = self::$states_en;
self::$news[] = [
$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'title']),
$dateOn,
$dateOff,
self::$states[$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'state'])],
$states[$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'state'])],
template::button('newsConfigEdit' . $newsIds[$i], [
'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsIds[$i]. '/' . $_SESSION['csrf'],
'value' => template::ico('pencil')
@ -281,7 +353,7 @@ class news extends common {
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration du module',
'title' => $text[2],
'view' => 'config',
'vendor' => [
'tinycolorpicker'
@ -294,6 +366,19 @@ class news extends common {
* Suppression
*/
public function delete() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Action non autorisée';
$text[1] = 'News supprimée';
break;
case 'en' :
$text[0] = 'Unauthorised action';
$text[1] = 'News deleted';
break;
}
// La news n'existe pas
if($this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2)]) === null) {
// Valeurs en sortie
@ -306,7 +391,7 @@ class news extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
'notification' => 'Action non autorisée'
'notification' => $text[0]
]);
}
// Suppression
@ -315,7 +400,7 @@ class news extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
'notification' => 'News supprimée',
'notification' => $text[1],
'state' => true
]);
}
@ -325,12 +410,25 @@ class news extends common {
* Édition
*/
public function edit() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Action non autorisée';
$text[1] = 'Modifications enregistrées';
break;
case 'en' :
$text[0] = 'Unauthorised action';
$text[1] = 'Changes saved';
break;
}
// Jeton incorrect
if ($this->getUrl(3) !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
'notification' => 'Action non autorisée'
'notification' => $text[0]
]);
}
// La news n'existe pas
@ -365,7 +463,7 @@ class news extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
'notification' => 'Modifications enregistrées',
'notification' => $text[1],
'state' => true
]);
}
@ -376,6 +474,14 @@ class news extends common {
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']);
}
unset($userFirstname);
// Passage de la langue d'administration à Tinymce
$lang_admin = 'fr_FR';
if( $this->getData(['config', 'i18n', 'langAdmin']) ==='en') $lang_admin = 'en_GB';
?>
<script>
var lang_admin = "<?php echo $lang_admin ?>";
</script>
<?php
// Valeurs en sortie
$this->addOutput([
'title' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'title']),
@ -506,31 +612,8 @@ class news extends common {
$this->init();
}
// Mise à jour 3.2
if (version_compare($versionData, '3.1', '<') ) {
$this->setData(['module',$this->getUrl(0),'theme', 'itemsBlur', '0%' ]);
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.2' ]);
}
// Mise à jour 3.3
if (version_compare($versionData, '3.3', '<') ) {
if (is_dir(self::DATADIRECTORY . 'pages/')) {
// Déplacer les données du dossier Pages
$this->copyDir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0), self::DATADIRECTORY . $this->getUrl(0));
$this->removeDir(self::DATADIRECTORY . 'pages/' );
$style = $this->getData(['module', $this->getUrl(0), 'theme', 'style']);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', str_replace('pages/', '', $style)]);
}
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.3' ]);
}
// Mise à jour 3.4
if (version_compare($versionData, '3.4', '<') ) {
// Effacer le style précédent
unlink(self::DATADIRECTORY . $this->getUrl(0) . '/theme.css');
$this->deleteData(['module', $this->getUrl(0), 'theme' ]);
// Le générer
$this->init();
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.4' ]);
}

View File

@ -1,3 +1,36 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Enregistrer en brouillon';
$text[2] = 'Publier';
$text[3] = 'Titre';
$text[4] = 'Auteur';
$text[5] = 'Informations générales';
$text[6] = 'Options de publication';
$text[7] = 'La news est consultable à partir du moment ou la date de publication est passée.';
$text[8] = 'Date de publication';
$text[9] = 'La news est consultable Jusqu\'à cette date si elle est spécifiée. Pour annuler la date de dépublication, sélectionnez une date antérieure à la publication.';
$text[10] = 'Date de dépublication';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Save as draft';
$text[2] = 'Publish';
$text[3] = 'Title';
$text[4] = 'Author';
$text[5] = 'General information';
$text[6] = 'Publication options';
$text[7] = 'The news can be consulted as soon as the publication date has passed';
$text[8] = 'Publication date';
$text[9] = 'The news is viewable until this date if specified. To cancel the unpublishing date, select a date before publication';
$text[10] = 'Unpublish date';
break;
}
?>
<?php echo template::formOpen('newsAddForm'); ?>
<div class="row">
<div class="col2">
@ -5,13 +38,13 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col3 offset5">
<?php echo template::button('newsAddDraft', [
'uniqueSubmission' => true,
'value' => 'Enregistrer en brouillon'
'value' => $text[1]
]); ?>
<?php echo template::hidden('newsAddState', [
'value' => true
@ -19,7 +52,7 @@
</div>
<div class="col2">
<?php echo template::submit('newsAddPublish', [
'value' => 'Publier',
'value' => $text[2],
'uniqueSubmission' => true
]); ?>
</div>
@ -27,9 +60,9 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Informations générales</h4>
<h4><?php echo $text[5]; ?></h4>
<?php echo template::text('newsAddTitle', [
'label' => 'Titre'
'label' => $text[3]
]); ?>
</div>
</div>
@ -40,25 +73,25 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Options de publication</h4>
<h4><?php echo $text[6]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::select('newsAddUserId', $module::$users, [
'label' => 'Auteur',
'label' => $text[4],
'selected' => $this->getUser('id')
]); ?>
</div>
<div class="col4">
<?php echo template::date('newsAddPublishedOn', [
'help' => 'La news est consultable à partir du moment ou la date de publication est passée.',
'label' => 'Date de publication',
'help' => $text[7],
'label' => $text[8],
'value' => time()
]); ?>
</div>
<div class="col4">
<?php echo template::date('newsAddPublishedOff', [
'help' => 'La news est consultable Jusqu\'à cette date si elle est spécifiée. Pour annuler la date de dépublication, sélectionnez une date antérieure à la publication.',
'label' => 'Date de dépublication',
'help' => $text[9],
'label' => $text[10],
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'publishedOff'])
]); ?>
</div>

View File

@ -19,7 +19,14 @@
*/
$(".newsConfigDelete").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer cette news ?", function() {
var text="";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "Êtes-vous sûr de vouloir supprimer cette news ?";' ;
}
else{
echo 'text = "Are you sure you want to delete this news ?";' ;
} ?>
return core.confirm(text, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -1,3 +1,66 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'News';
$text[2] = 'Enregistrer';
$text[3] = 'Paramètres du module';
$text[4] = 'Lien du flux RSS';
$text[5] = 'Flux limité aux articles de la première page.';
$text[6] = 'Etiquette RSS';
$text[7] = 'Nombre de colonnes';
$text[8] = 'Articles par page';
$text[9] = 'Abrégé de l\'article';
$text[10] = 'Thème du module';
$text[11] = 'Bordure';
$text[12] = 'Epaisseur';
$text[13] = 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.';
$text[14] = 'Couleur de la bordure';
$text[15] = 'Couleur du fond';
$text[16] = 'Titre';
$text[17] = 'Publication';
$text[18] = 'Dépublication';
$text[19] = 'Etat';
$text[20] = 'Aucune news.';
$text[21] = 'Version n°';
$columns = $module::$columns;
$height = $module::$height;
$borderStyle = $module::$borderStyle;
$borderWidth = $module::$borderWidth;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'News';
$text[2] = 'Submit';
$text[3] = 'Module parameters';
$text[4] = 'RSS feed link';
$text[5] = 'Feed limited to articles on the first page.';
$text[6] = 'RSS tag';
$text[7] = 'Number of columns';
$text[8] = 'Articles per page';
$text[9] = 'Article abstract';
$text[10] = 'Module theme';
$text[11] = 'Bordure';
$text[12] = 'Thickness';
$text[13] = 'Colour visible in the absence of an image. The horizontal slider sets the level of transparency';
$text[14] = 'Border colour';
$text[15] = 'Background colour';
$text[16] = 'Title';
$text[17] = 'Publication';
$text[18] = 'Depublication';
$text[19] = 'State';
$text[20] = 'No news';
$text[21] = 'Version no.';
$columns = $module::$columns_en;
$height = $module::$height_en;
$borderStyle = $module::$borderStyle_en;
$borderWidth = $module::$borderWidth_en;
break;
}
?>
<?php echo template::formOpen('newsConfig'); ?>
<div class="row">
<div class="col2">
@ -5,54 +68,56 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),'posts',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::button('newsConfigAdd', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/add',
'ico' => 'plus',
'value' => 'News'
'value' => $text[1]
]); ?>
</div>
<div class="col2">
<?php echo template::submit('newsConfigSubmit'); ?>
<?php echo template::submit('newsConfigSubmit',[
'value' => $text[2]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres du module</h4>
<h4><?php echo $text[3]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::checkbox('newsConfigShowFeeds', true, 'Lien du flux RSS', [
<?php echo template::checkbox('newsConfigShowFeeds', true, $text[4], [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']),
'help' => 'Flux limité aux articles de la première page.'
'help' => $text[5]
]); ?>
</div>
<div class="col6">
<?php echo template::text('newsConfigFeedslabel', [
'label' => 'Etiquette RSS',
'label' => $text[6],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel'])
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('newsConfigItemsperCol', $module::$columns, [
'label' => 'Nombre de colonnes',
<?php echo template::select('newsConfigItemsperCol', $columns, [
'label' => $text[7],
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('newsConfigItemsperPage', $module::$itemsList, [
'label' => 'Articles par page',
'label' => $text[8],
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('newsConfigHeight', $module::$height, [
'label' => 'Abrégé de l\'article',
<?php echo template::select('newsConfigHeight', $height, [
'label' => $text[9],
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'height'])
]); ?>
</div>
@ -63,33 +128,33 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Thème du module</h4>
<h4><?php echo $text[10]; ?></h4>
<div class="row">
<div class="col3">
<?php echo template::select('newsThemeBorderStyle', $module::$borderStyle, [
'label' => 'Bordure',
<?php echo template::select('newsThemeBorderStyle', $borderStyle, [
'label' => $text[11],
'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderStyle'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('newsThemeBorderWidth', $module::$borderWidth, [
'label' => 'Epaisseur',
<?php echo template::select('newsThemeBorderWidth', $borderWidth, [
'label' => $text[12],
'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderWidth'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('newsThemeBorderColor', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Couleur de la bordure',
'help' => $text[13],
'label' => $text[14],
'value' => $this->getData(['module', $this->getUrl(0),'theme', 'borderColor'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('newsThemeBackgroundColor', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
'label' => 'Couleur du fond',
'help' => $text[13],
'label' => $text[15],
'value' => $this->getData(['module', $this->getUrl(0),'theme', 'backgroundColor'])
]); ?>
</div>
@ -98,12 +163,12 @@
</div>
</div>
<?php if($module::$news): ?>
<?php echo template::table([4, 2, 2, 2, 1, 1], $module::$news, ['Titre', 'Publication', 'Dépublication', 'État', '', '']); ?>
<?php echo template::table([4, 2, 2, 2, 1, 1], $module::$news, [$text[16], $text[17], $text[18], $text[19], '', '']); ?>
<?php echo $module::$pages; ?>
<?php else: ?>
<?php echo template::speech('Aucune news.'); ?>
<?php echo template::speech($text[20]); ?>
<?php endif; ?>
<?php echo template::formClose(); ?>
<div class="moduleVersion">Version
<div class="moduleVersion"><?php echo $text[21]; ?>
<?php echo $module::VERSION; ?>
</div>

View File

@ -1,3 +1,36 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Enregistrer en brouillon';
$text[2] = 'Publier';
$text[3] = 'Informations générales';
$text[4] = 'Titre';
$text[5] = 'Options de publication';
$text[6] = 'Auteur';
$text[7] = 'La news est consultable à partir du moment ou la date de publication est passée.';
$text[8] = 'Date de publication';
$text[9] = 'La news est consultable Jusqu\'à cette date si elle est spécifiée. Pour annuler la date de dépublication, sélectionnez une date antérieure à la publication.';
$text[10] = 'Date de dépublication';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Save as draft';
$text[2] = 'Publish';
$text[3] = 'General information';
$text[4] = 'Title';
$text[5] = 'Publication options';
$text[6] = 'Author';
$text[7] = 'The news can be consulted as soon as the publication date has passed';
$text[8] = 'Publication date';
$text[9] = 'The news is viewable until this date if specified. To cancel the unpublishing date, select a date before publication';
$text[10] = 'Unpublish date';
break;
}
?>
<?php echo template::formOpen('newsEditForm'); ?>
<div class="row">
<div class="col2">
@ -5,13 +38,13 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col3 offset5">
<?php echo template::button('newsEditDraft', [
'uniqueSubmission' => true,
'value' => 'Enregistrer en brouillon'
'value' => $text[1]
]); ?>
<?php echo template::hidden('newsEditState', [
'value' => true
@ -19,7 +52,7 @@
</div>
<div class="col2">
<?php echo template::submit('newsEditSubmit', [
'value' => 'Publier',
'value' => $text[2],
'uniqueSubmission' => true
]); ?>
</div>
@ -27,9 +60,9 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Informations générales</h4>
<h4><?php echo $text[3]; ?></h4>
<?php echo template::text('newsEditTitle', [
'label' => 'Titre',
'label' => $text[4],
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'title'])
]); ?>
</div>
@ -42,25 +75,25 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Options de publication</h4>
<h4><?php echo $text[5]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::select('newsEditUserId', $module::$users, [
'label' => 'Auteur',
'label' => $text[6],
'selected' => $this->getUser('id')
]); ?>
</div>
<div class="col4">
<?php echo template::date('newsEditPublishedOn', [
'help' => 'La news est consultable à partir du moment ou la date de publication est passée.',
'label' => 'Date de publication',
'help' => $text[7],
'label' => $text[8],
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'publishedOn'])
]); ?>
</div>
<div class="col4">
<?php echo template::date('newsEditPublishedOff', [
'help' => 'La news est consultable Jusqu\'à cette date si elle est spécifiée. Pour annuler la date de dépublication, sélectionnez une date antérieure à la publication.',
'label' => 'Date de dépublication',
'help' => $text[9],
'label' => $text[10],
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'publishedOff'])
]); ?>
</div>

View File

@ -1,3 +1,20 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'lire la suite';
$text[1] = 'Aucune news.';
$text[2] = ' Editer';
break;
case 'en' :
$text[0] = 'read more';
$text[1] = 'No news';
$text[2] = ' Edit';
break;
}
?>
<?php if($module::$news): ?>
<div class="row">
<?php foreach($module::$news as $newsId => $news): ?>
@ -10,7 +27,7 @@
<?php echo $news['content']; ?>
<?php if ( $this->getData(['module', $this->getUrl(0), 'config', 'height']) !== -1
&& strlen($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'content'])) >= $this->getData(['module', $this->getUrl(0), 'config', 'height'])):?>
<?php echo ' ... <a href="'. helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '"><span class="newsSuite">lire la suite</span></a>'; ?>
<?php echo ' ... <a href="'. helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '"><span class="newsSuite">'.$text[0].'</span></a>'; ?>
<?php endif; ?>
<div class="newsSignature">
<i class="far fa-calendar-alt"></i>
@ -28,7 +45,7 @@
)
): ?>
<a href ="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsId . '/' . $_SESSION['csrf'];?>">
<?php echo template::ico('pencil');?> Editer
<?php echo template::ico('pencil'); echo $text[2]; ?>
</a>
<?php endif; ?>
</div>
@ -49,5 +66,5 @@
</div>
<?php endif; ?>
<?php else: ?>
<?php echo template::speech('Aucune news.'); ?>
<?php echo template::speech($text[1]); ?>
<?php endif; ?>

View File

@ -34,19 +34,32 @@ class redirection extends common {
* Configuration
*/
public function config() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Modifications enregistrées';
$text[1] = 'Configuration du module';
break;
case 'en' :
$text[0] = 'Registered changes';
$text[1] = 'Module configuration';
break;
}
// Soumission du formulaire
if($this->isPost()) {
$this->setData(['module', $this->getUrl(0), 'url', $this->getInput('redirectionConfigUrl', helper::FILTER_URL, true)]);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
'notification' => 'Modifications enregistrées',
'notification' => $text[0],
'state' => true
]);
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration du module',
'title' => $text[1],
'view' => 'config'
]);
}

View File

@ -1,3 +1,30 @@
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Enregistrer';
$text[2] = 'Lien de redirection';
$text[3] = 'Le lien de redirection peut contenir une URL standard, ou pointer vers l\'ancre d\'une page du site <em>(/page#ancre)</em> ; <em>(/?page#ancre)</em>';
$text[4] = 'Redirection';
$text[5] = 'Statistiques';
$text[6] = 'Nombre de redirections';
$text[7] = 'Version n°';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'OK';
$text[2] = 'Redirection link';
$text[3] = 'The redirect link can contain a standard URL, or point to the anchor of a page on the site <em>(/page#anchor)</em> ; <em>(/?page#anchor)</em>';
$text[4] = 'Redirection';
$text[5] = 'Statistics';
$text[6] = 'Number of redirections';
$text[7] = 'Version no.';
break;
}
?>
<?php echo template::formOpen('redirectionConfig'); ?>
<div class="row">
<div class="col2">
@ -5,37 +32,38 @@
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('redirectionConfigSubmit'); ?>
<?php echo template::submit('redirectionConfigSubmit', [
'value' => $text[1]
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<div class="block">
<h4>Redirection</h4>
<h4><?php echo $text[4]; ?></h4>
<?php echo template::text('redirectionConfigUrl', [
'label' => 'Lien de redirection',
'label' => $text[2],
'placeholder' => 'http://',
'value' => $this->getData(['module', $this->getUrl(0), 'url']),
'help' => 'Le lien de redirection peut contenir une URL standard, ou pointer vers l\'ancre d\'une page du site <em>(/page#ancre)</em> ; <em>(/?page#ancre)</em>'
'help' => $text[3]
]); ?>
</div>
</div>
<div class="col6">
<div class="block">
<h4>Statistiques</h4>
<h4><?php echo $text[5]; ?></h4>
<?php echo template::text('redirectionConfigCount', [
'disabled' => true,
'label' => 'Nombre de redirection',
'label' => $text[6],
'value' => helper::filter($this->getData(['module', $this->getUrl(0), 'count']), helper::FILTER_INT)
]); ?>
</div>
</div>
</div>
<?php echo template::formClose(); ?>
<div class="moduleVersion">Version
<?php echo $module::VERSION; ?>
<div class="moduleVersion"><?php echo $text[7].$module::VERSION; ?>
</div>

View File

@ -17,8 +17,15 @@
if (document.referrer.indexOf("edit") === -1)
{
core.confirm(
"OUI : éditer la page | NON : tester la redirection.",
var text="";
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
echo 'text = "OUI : éditer la page | NON : tester la redirection.";' ;
}
else{
echo 'text = "YES: edit the page | NO: test the redirection.";' ;
} ?>
core.confirm(
text,
function() {
$(location).attr("href", "<?php echo helper::baseUrl(); ?>page/edit/<?php echo $this->getUrl(0); ?>");
},

View File

@ -5,7 +5,11 @@ class init extends search {
'resultHideContent' => false,
'placeHolder' => 'Un ou plusieurs mots-clés séparés par un espace ou par +',
'submitText' => 'Rechercher',
'versionData' => '2.2'
'versionData' => '2.2',
'nearWordText' => 'Mots approchants',
'successTitle' => 'Résultat de votre recherche',
'failureTitle' => 'Aucun résultat',
'commentFailureTitle' => 'Avez-vous pensé aux accents'
];
public static $defaultTheme = [
'keywordColor' => 'rgba(229, 229, 1, 1)'

View File

@ -38,10 +38,10 @@ class search extends common {
public static $motclef = '';
public static $motentier = true;
public static $previewLength = [
100 => '100 caractères',
200 => '200 caractères',
300 => '300 caractères',
400 => '400 caractères',
100 => '100',
200 => '200',
300 => '300',
400 => '400',
];
@ -110,6 +110,21 @@ class search extends common {
// Configuration vide
public function config() {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Modifications enregistrées';
$text[1] = 'Modifications non enregistrées';
$text[2] = 'Configuration du module';
break;
case 'en' :
$text[0] = 'Registered changes';
$text[1] = 'Unregistered changes';
$text[2] = 'Module configuration';
break;
}
// Mise à jour des données de module
$this->update();
@ -128,7 +143,11 @@ class search extends common {
'placeHolder' => $this->getInput('searchPlaceHolder'),
'resultHideContent' => $this->getInput('searchResultHideContent',helper::FILTER_BOOLEAN),
'previewLength' => $this->getInput('searchPreviewLength',helper::FILTER_INT),
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData'])
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']),
'nearWordText' => $this->getInput('searchNearWordText'),
'successTitle' => $this->getInput('searchSuccessTitle'),
'failureTitle' => $this->getInput('searchFailureTitle'),
'commentFailureTitle'=> $this->getInput('searchCommentFailureTitle')
]]);
$this->setData(['module', $this->getUrl(0), 'theme',[
'keywordColor' => $this->getInput('searchKeywordColor'),
@ -139,14 +158,14 @@ class search extends common {
// Valeurs en sortie, affichage du formulaire
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
'notification' => $success !== FALSE ? 'Modifications enregistrées' : 'Modifications non enregistrées !',
'notification' => $success !== FALSE ? $text[0] : $text[1],
'state' => $success !== FALSE
]);
}
// Valeurs en sortie, affichage du formulaire
$this->addOutput([
'title' => 'Configuration du module',
'title' => $text[2],
'view' => 'config',
'vendor' => [
'tinycolorpicker'
@ -293,11 +312,11 @@ class search extends common {
// Message de synthèse de la recherche
if (count($result) === 0) {
self::$resultTitle = 'Aucun résultat';
self::$resultError = 'Avez-vous pens&eacute; aux accents ?';
self::$resultTitle = $this->getData(['module', $this->getUrl(0), 'config', 'failureTitle']);
self::$resultError = $this->getData(['module', $this->getUrl(0), 'config', 'commentFailureTitle']);
} else {
self::$resultError = '';
self::$resultTitle = ' Résultat de votre recherche';
self::$resultTitle = $this->getData(['module', $this->getUrl(0), 'config', 'successTitle']);
rsort($result);
foreach ($result as $key => $value) {
$r [] = $value['preview'];
@ -327,8 +346,18 @@ class search extends common {
// Fonction de recherche des occurrences dans $contenu
// Renvoie le résultat sous forme de chaîne
private function occurrence($url, $titre, $contenu, $motclef, $motentier)
{
private function occurrence($url, $titre, $contenu, $motclef, $motentier) {
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = ' correspondance';
break;
case 'en' :
$text[0] = ' matche';
break;
}
// Nettoyage de $contenu : on enlève tout ce qui est inclus entre < et >
$contenu = preg_replace ('/<[^>]*>/', ' ', $contenu);
// Accentuation
@ -364,7 +393,7 @@ class search extends common {
$t = preg_replace($keywords, '<span class= "keywordColor">\1</span>',$t);
// Sauver résultat
$resultat .= '<p class="searchResult">'.$t.'...</p>';
$resultat .= '<p class="searchTitle">' . count($matches[0]) . (count($matches[0]) === 1 ? ' correspondance<p>' : ' correspondances<p>');
$resultat .= '<p class="searchTitle">' . count($matches[0]) . (count($matches[0]) === 1 ? $text[0].'<p>' : $text[0].'s<p>');
//}
return ([
'matches' => count($matches[0]),

View File

@ -1,44 +1,119 @@
<?php echo template::formOpen('searchConfig'); ?>
<?php echo template::formOpen('searchConfig');
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Enregistrer';
$text[2] = 'Texte du bouton';
$text[3] = 'Dimension de l\'aperçu en caractères';
$text[4] = 'Aide dans la zone de saisie';
$text[5] = 'Masquer le contenu de la page dans les résultats';
$text[6] = 'Paramètres du module';
$text[7] = 'Thème';
$text[8] = 'Les paramètres du thème sont communs aux modules du même type.';
$text[9] = 'Le curseur horizontal règle le niveau de transparence, le placer tout à la gauche pour un surlignement invisible.';
$text[10] = 'Surlignement';
$text[11] = 'Version n°';
$text[12] = 'Texte pour l\'option mots approchants';
$text[13] = 'Titre des résultats en cas de succès';
$text[14] = 'Titre des résultats en cas d\'échec';
$text[15] = 'Commentaire en cas d\'échec';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Submit';
$text[2] = 'Button text';
$text[3] = 'Size of the overview in characters';
$text[4] = 'Help in the input field';
$text[5] = 'Hide page content in results';
$text[6] = 'Module parameters';
$text[7] = 'Theme';
$text[8] = 'The theme parameters are common to modules of the same type.';
$text[9] = 'The horizontal slider adjusts the level of transparency, placing it to the far left for invisible highlighting.';
$text[10] = 'Highlighting';
$text[11] = 'Version no.';
$text[12] = 'Text for the \'closes words\' option';
$text[13] = 'Title of results in case of success';
$text[14] = 'Title of results in case of failure';
$text[15] = 'Comment on failure';
break;
}
?>
<div class="row">
<div class="col2">
<?php echo template::button('searchConfigBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
'ico' => 'left',
'value' => 'Retour'
'value' => $text[0]
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('searchConfigSubmit'); ?>
<?php echo template::submit('searchConfigSubmit', [
'value'=> $text[1]
]); ?>
</div>
</div>
<div class='row'>
<div class="col12">
<div class="block">
<h4>Paramètres du module</h4>
<h4><?php echo $text[6]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::text('searchSubmitText', [
'label' => 'Texte du bouton',
'label' => $text[2],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'submitText'])
]); ?>
</div>
<div class="col6">
<?php echo template::select('searchPreviewLength', $module::$previewLength, [
'label' => 'Dimension de l\'aperçu',
'label' => $text[3],
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'previewLength'])
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="col6">
<?php echo template::text('searchPlaceHolder', [
'label' => 'Aide dans la zone de saisie',
'label' => $text[4],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('searchResultHideContent', true, 'Masquer le contenu de la page dans les résultats', [
<div class="col6">
<?php echo template::text('searchNearWordText', [
'label' => $text[12],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'nearWordText'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::text('searchSuccessTitle', [
'label' => $text[13],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'successTitle'])
]); ?>
</div>
<div class="col6">
<?php echo template::text('searchFailureTitle', [
'label' => $text[14],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'failureTitle'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::text('searchCommentFailureTitle', [
'label' => $text[15],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'commentFailureTitle'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('searchResultHideContent', true, $text[5], [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'resultHideContent']),
]); ?>
</div>
@ -49,16 +124,16 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Thème
<?php echo template::help('Les paramètres du thème sont communs aux modules du même type.');
<h4><?php echo $text[7]; ?>
<?php echo template::help( $text[8] );
?>
</h4>
<div class="row">
<div class="col4">
<?php echo template::text('searchKeywordColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence, le placer tout à la gauche pour un surlignement invisible.',
'label' => 'Surlignement',
'help' => $text[9],
'label' => $text[10],
'value' => $this->getData(['module', $this->getUrl(0), 'theme', 'keywordColor'])
]); ?>
</div>
@ -67,6 +142,6 @@
</div>
</div>
<?php echo template::formClose(); ?>
<div class="moduleVersion">Version
<div class="moduleVersion"><?php echo $text[11]; ?>
<?php echo $module::VERSION; ?>
</div>

View File

@ -1,10 +1,24 @@
<?php echo template::formOpen('searchForm'); ?>
<?php echo template::formOpen('searchForm');
// Lexique
$text = [];
$val ='fr';
if( $this->getData(['config', 'i18n', 'langBase']) !== 'fr') $val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Un ou plusieurs mots clef séparés par un espace';
break;
case 'en' :
$text[0] = 'One or more keywords separated by a space';
break;
}
?>
<div class="row">
<div class="col10 offset1">
<div class="row">
<div class="col9 verticalAlignMiddle">
<?php echo template::text('searchMotphraseclef', [
'placeholder' => $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder']) ? $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder']):'Un ou plusieurs mots clef séparés par un espace',
'placeholder' => $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder']) ? $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder']):$text[0],
'value' => $module::$motclef
]); ?>
</div>
@ -18,7 +32,7 @@
</div>
<div class="row">
<div class="col12">
<?php echo template::checkbox('searchMotentier', true, 'Mots approchants', [
<?php echo template::checkbox('searchMotentier', true, $this->getData(['module', $this->getUrl(0), 'config', 'nearWordText']), [
'checked' => $module::$motentier,
]); ?>
</div>