diff --git a/CHANGES.md b/CHANGES.md index a79180e..dc1cd88 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 : diff --git a/README.md b/README.md index 630633a..a98e632 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/core/class/template.class.php b/core/class/template.class.php index a7b5f32..e129e57 100644 --- a/core/class/template.class.php +++ b/core/class/template.class.php @@ -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 = '
'; // Label $html .= self::label($attributes['id'], - ' ' . $operator . '  en chiffres ?', [ + ' ' . $operator . '  = ', [ 'help' => $attributes['help'] ]); diff --git a/core/core.js.php b/core/core.js.php index 6817fb7..42aca60 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -65,6 +65,14 @@ core.colorVariants = function(rgba) { * Crée un message de confirmation */ core.confirm = function(text, yesCallback, noCallback) { + var textnon = ""; + var textoui = ""; + getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){ + echo 'textnon = "Non"; textoui = "Oui";' ; + } + else{ + echo 'textnon = "No"; textoui = "Yes";' ; + } ?> var lightbox = lity(function($) { return $("
") .addClass("lightbox") @@ -75,7 +83,7 @@ core.confirm = function(text, yesCallback, noCallback) { .append( $("") .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) { }), $("") .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 = ""; + 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 = ""; + 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 = ""; + 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")); }); }); diff --git a/core/core.php b/core/core.php index 840cb98..1106b89 100644 --- a/core/core.php +++ b/core/core.php @@ -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

| '; + $notification = $text[1].'

| '; 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
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
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 .= '

  • '; - $leftItems .= '
  • ' . template::ico('plus') . '
  • '; + $leftItems .= '
  • '; 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 .= '
  • ' . template::ico('pencil') . '
  • '; + $leftItems .= '
  • ' . template::ico('pencil') . '
  • '; if ($this->getData(['page', $this->getUrl(0),'moduleId'])) { - $leftItems .= '
  • ' . template::ico('gear') . '
  • '; + $leftItems .= '
  • ' . template::ico('gear') . '
  • '; } - $leftItems .= '
  • ' . template::ico('clone') . '
  • '; - $leftItems .= '
  • ' . template::ico('trash') . '
  • '; + $leftItems .= '
  • ' . template::ico('clone') . '
  • '; + $leftItems .= '
  • ' . template::ico('trash') . '
  • '; } } // Items de droite $rightItems = ''; if($this->getUser('group') >= self::GROUP_MODERATOR) { - $rightItems .= '
  • ' . template::ico('folder') . '
  • '; + $rightItems .= '
  • ' . template::ico('folder') . '
  • '; } if($this->getUser('group') >= self::GROUP_ADMIN) { - $rightItems .= '
  • ' . template::ico('brush') . '
  • '; - $rightItems .= '
  • ' . template::ico('puzzle') . '
  • '; + $rightItems .= '
  • ' . template::ico('brush') . '
  • '; + $rightItems .= '
  • ' . template::ico('puzzle') . '
  • '; if ($this->getData(['config', 'i18n', 'enable']) === true) { - $rightItems .= '
  • ' . template::ico('flag') . '
  • '; + $rightItems .= '
  • ' . template::ico('flag') . '
  • '; } - $rightItems .= '
  • ' . template::ico('cog-alt') . '
  • '; - $rightItems .= '
  • ' . template::ico('users') . '
  • '; + $rightItems .= '
  • ' . template::ico('cog-alt') . '
  • '; + $rightItems .= '
  • ' . template::ico('users') . '
  • '; // 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 .= '
  • ' . template::ico('update colorRed') . '
  • '; + $rightItems .= '
  • ' . template::ico('update colorRed') . '
  • '; } } if($this->getUser('group') >= self::GROUP_MODERATOR) { - $rightItems .= '
  • ' . template::ico('user', 'right') . '' . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '
  • '; + $rightItems .= '
  • ' . template::ico('user', 'right') . '' . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '
  • '; } - $rightItems .= '
  • ' . template::ico('logout') . '
  • '; + $rightItems .= '
  • ' . template::ico('logout') . '
  • '; // Barre de membre echo '
      ' . $leftItems . '
      ' . $rightItems . '
    '; } @@ -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 ) ) { diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 3631cf6..b864603 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -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]); } - ?> diff --git a/core/module/addon/addon.php b/core/module/addon/addon.php index dec11de..4a024ba 100644 --- a/core/module/addon/addon.php +++ b/core/module/addon/addon.php @@ -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' ]); } diff --git a/core/module/addon/view/import/import.php b/core/module/addon/view/import/import.php index 7cc41da..518a623 100644 --- a/core/module/addon/view/import/import.php +++ b/core/module/addon/view/import/import.php @@ -1,3 +1,22 @@ +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; +} +?>
    @@ -5,23 +24,23 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'addon', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    'Appliquer' + 'value' => $text[1] ]); ?>
    -

    Installer des données de module

    +

    'Archive ZIP :', + 'label' => $text[2], 'type' => 2 ]); ?>
    diff --git a/core/module/addon/view/index/index.js.php b/core/module/addon/view/index/index.js.php index c88ba6c..5504add 100644 --- a/core/module/addon/view/index/index.js.php +++ b/core/module/addon/view/index/index.js.php @@ -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 = ""; + 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")); }); }); \ No newline at end of file diff --git a/core/module/addon/view/index/index.php b/core/module/addon/view/index/index.php index 5dca4cc..f85f43f 100644 --- a/core/module/addon/view/index/index.php +++ b/core/module/addon/view/index/index.php @@ -1,10 +1,43 @@ +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; +} +?>
    'buttonGrey', 'href' => helper::baseUrl(), 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -12,20 +45,20 @@ 'href' => 'https://doc.deltacms.fr/gestion-des-modules', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    helper::baseUrl() . 'addon/upload', - 'value' => 'Installer un module' + 'value' => $text[2] ]); ?>
    - + - + diff --git a/core/module/addon/view/upload/upload.php b/core/module/addon/view/upload/upload.php index 1f417b5..5504516 100644 --- a/core/module/addon/view/upload/upload.php +++ b/core/module/addon/view/upload/upload.php @@ -1,3 +1,28 @@ +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; +} +?>
    @@ -5,7 +30,7 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'addon', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -14,7 +39,7 @@ 'target' => '_blank', 'class' => 'buttonHelp', 'ico' => 'help', - 'value' => 'Aide' + 'value' => $text[1] ]); ?>
    'Valider', + 'value' => $text[2], 'ico' => 'check' ]); ?>
    @@ -35,20 +60,20 @@
    -

    Installer ou mettre à jour un module téléchargé

    +

    'Archive ZIP :', + 'label' => $text[3], 'type' => 2 ]); ?>
    - 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], ]); ?>
    diff --git a/core/module/config/config.php b/core/module/config/config.php index 2ad8433..0e81dd9 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -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 ]); } diff --git a/core/module/config/view/backup/backup.js.php b/core/module/config/view/backup/backup.js.php index c78b78e..76b6526 100644 --- a/core/module/config/view/backup/backup.js.php +++ b/core/module/config/view/backup/backup.js.php @@ -15,6 +15,19 @@ */ $( document).ready(function() { + var text1 = ""; + var text2 = ""; + var text3 = ""; + 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(); diff --git a/core/module/config/view/backup/backup.php b/core/module/config/view/backup/backup.php index 070ab2c..0da4e42 100644 --- a/core/module/config/view/backup/backup.php +++ b/core/module/config/view/backup/backup.php @@ -1,3 +1,30 @@ +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; +} +?>
    @@ -5,12 +32,12 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'config', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    'Sauvegarder', + 'value' => $text[1], 'uniqueSubmission' => true ]); ?>
    @@ -18,16 +45,16 @@
    -

    Paramètres de la sauvegarde

    +

    - true, - 'help' => 'Si le contenu du gestionnaire de fichiers est très volumineux, mieux vaut une copie par FTP.' + 'help' => $text[3] ]); ?>
    - L'archive est générée dans le dossier Backup du gestionnaire de fichiers. +
    diff --git a/core/module/config/view/bodyheadscript/bodyheadscript.php b/core/module/config/view/bodyheadscript/bodyheadscript.php index 6bbdc08..1bf7607 100644 --- a/core/module/config/view/bodyheadscript/bodyheadscript.php +++ b/core/module/config/view/bodyheadscript/bodyheadscript.php @@ -1,8 +1,25 @@ +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; +} +?>
    -

    Scripts externes +

    @@ -13,14 +30,14 @@
    helper::baseUrl() . 'config/script/head', - 'value' => 'Script dans head', + 'value' => $text[1], 'ico' => 'pencil' ]); ?>
    helper::baseUrl() . 'config/script/body', - 'value' => 'Script dans body', + 'value' => $text[2], 'ico' => 'pencil' ]); ?>
    diff --git a/core/module/config/view/connect/connect.php b/core/module/config/view/connect/connect.php index e540921..3680ce6 100644 --- a/core/module/config/view/connect/connect.php +++ b/core/module/config/view/connect/connect.php @@ -1,8 +1,67 @@ +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; +} +?>
    -

    Sécurité de la connexion +

    @@ -11,52 +70,50 @@

    - $this->getData(['config', 'connect','captcha']) ]); ?>
    - $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] ]); ?>
    - 'Type de captcha', + $text[4], 'selected' => $this->getData(['config', 'connect', 'captchaType']) ]); ?>
    - $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] ]); ?>
    - 'Connexions successives', + $text[7], 'selected' => $this->getData(['config', 'connect', 'attempt']) ]); ?>
    - 'Blocage après échecs', + $text[8], 'selected' => $this->getData(['config', 'connect', 'timeout']) ]); ?>
    - helper::baseUrl() . 'config/blacklistDownload', - 'value' => 'Télécharger la liste', + 'value' => $text[11], 'ico' => 'download' ]); ?>
    @@ -64,7 +121,7 @@ 'buttonRed', 'href' => helper::baseUrl() . 'config/blacklistReset', - 'value' => 'Réinitialiser la liste', + 'value' => $text[12], 'ico' => 'cancel' ]); ?>
    @@ -75,7 +132,7 @@
    -

    Journalisation +

    @@ -84,21 +141,21 @@

    - $this->getData(['config', 'connect', 'log']) ]); ?>
    - 'Anonymat des adresses IP', + $text[15], 'selected' => $this->getData(['config', 'connect', 'anonymousIp']), - 'help' => 'La réglementation française impose un anonymat de niveau 2' + 'help' => $text[16] ]); ?>
    helper::baseUrl() . 'config/logDownload', - 'value' => 'Télécharger le journal', + 'value' => $text[17], 'ico' => 'download' ]); ?>
    @@ -106,7 +163,7 @@ 'buttonRed', 'href' => helper::baseUrl() . 'config/logReset', - 'value' => 'Réinitialiser le journal', + 'value' => $text[18], 'ico' => 'cancel' ]); ?>
    diff --git a/core/module/config/view/index/index.php b/core/module/config/view/index/index.php index 045c331..e106165 100644 --- a/core/module/config/view/index/index.php +++ b/core/module/config/view/index/index.php @@ -1,3 +1,32 @@ +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; +} +?>
    @@ -5,7 +34,7 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl(false), 'ico' => 'home', - 'value' => 'Accueil' + 'value' => $text[0] ]); ?>
    @@ -14,11 +43,13 @@ 'href' => 'https://doc.deltacms.fr/configuration-du-site', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide' + 'value' => $text[1] ]); ?>
    - + $text[3] + ]); ?>
    @@ -26,32 +57,32 @@
    'Configuration' + 'value' => $text[2] ]); ?>
    'Localisation' + 'value' => $text[4] ]); ?>
    'Référencement' + 'value' => $text[5] ]); ?>
    'Connexion' + 'value' => $text[6] ]); ?>
    'Réseau' + 'value' => $text[7] ]); ?>
    'Scripts' + 'value' => $text[8] ]); ?>
    diff --git a/core/module/config/view/locale/locale.php b/core/module/config/view/locale/locale.php index 93328ba..5f2ed82 100644 --- a/core/module/config/view/locale/locale.php +++ b/core/module/config/view/locale/locale.php @@ -1,13 +1,111 @@ +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; +} +?> +getInput('DELTA_I18N_SITE') === 'base') $flag = $this->getData(['config', 'i18n', 'langBase']); ?>
    -

    Langues étrangères

    +

    - $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] ]); ?>
    @@ -17,7 +115,7 @@
    -

    Identité du site +

    @@ -27,14 +125,14 @@
    '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] ]); ?>
    'DeltaCMS Version', + 'label' => $text[6], 'value' => common::DELTA_VERSION, 'readonly' => true ]); ?> @@ -43,9 +141,9 @@
    '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] ]); ?>
    @@ -55,7 +153,7 @@
    -

    Assignation des pages spéciales +

    @@ -65,47 +163,47 @@
    'Accueil du site', + 'label' => $text[10], 'selected' =>$this->getData(['locale', 'homePageId']), - 'help' => 'La première page que vos visiteurs verront.' + 'help' => $text[11] ]); ?>
    - 'Page par défaut'],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [ - 'label' => 'Accès interdit, erreur 403', + $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] ]); ?>
    - 'Page par défaut'],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [ - 'label' => 'Page inexistante, erreur 404', + $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] ]); ?>
    - 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ - 'label' => 'Mentions légales', + $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] ]); ?>
    - 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ - 'label' => 'Recherche dans le site', + $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] ]); ?>
    '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] ]); ?>
    @@ -115,7 +213,7 @@
    -

    Etiquettes des pages spéciales +

    @@ -125,15 +223,15 @@
    'Mentions légales', - 'placeholder' => 'Mentions légales', + 'label' => $text[15], + 'placeholder' => $text[15], 'value' => $this->getData(['locale', 'legalPageLabel']) ]); ?>
    'Rechercher', - 'placeholder' => 'Rechercher', + 'label' => $text[23], + 'placeholder' => $text[23], 'value' => $this->getData(['locale', 'searchPageLabel']) ]); ?>
    @@ -141,16 +239,16 @@
    'Plan du site', - 'placeholder' => 'Plan du site', + 'label' => $text[24], + 'placeholder' => $text[24], 'value' => $this->getData(['locale', 'sitemapPageLabel']), ]); ?>
    'Cookies', + 'label' => $text[25], 'value' => $this->getData(['locale', 'cookies', 'cookiesFooterText']), - 'placeHolder' => 'Cookies' + 'placeHolder' => $text[25] ]); ?>
    @@ -160,7 +258,7 @@
    -

    Message d'acceptation des Cookies +

    @@ -170,45 +268,45 @@
    '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] ]); ?>
    '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] ]); ?>
    '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] ]); ?>
    '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']) ]); ?>
    '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']) ]); ?>
    @@ -216,9 +314,9 @@
    'Bouton de validation', + 'label' => $text[40], 'value' => $this->getData(['locale', 'cookies', 'cookiesButtonText']), - 'placeHolder' => 'J\'ai compris' + 'placeHolder' => $text[41] ]); ?>
    diff --git a/core/module/config/view/network/network.php b/core/module/config/view/network/network.php index 52836c2..1231d4d 100644 --- a/core/module/config/view/network/network.php +++ b/core/module/config/view/network/network.php @@ -1,8 +1,49 @@ +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; +} +?>
    -

    Paramètres +

    @@ -12,20 +53,20 @@
    'Type de proxy', + 'label' => $text[1], 'selected' => $this->getData(['config', 'proxyType']) ]); ?>
    'Adresse du proxy', + 'label' => $text[2], 'placeholder' => 'cache.proxy.fr', 'value' => $this->getData(['config', 'proxyUrl']) ]); ?>
    'Port du proxy', + 'label' => $text[3], 'placeholder' => '6060', 'value' => $this->getData(['config', 'proxyPort']) ]); ?> @@ -37,7 +78,7 @@
    -

    SMTP +

    @@ -46,9 +87,9 @@

    - $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] ]); ?>
    @@ -56,21 +97,21 @@
    'Adresse SMTP', + 'label' => $text[7], 'placeholder' => 'smtp.fr', 'value' => $this->getData(['config', 'smtp','host']) ]); ?>
    'Port SMTP', + 'label' => $text[8], 'placeholder' => '589', 'value' => $this->getData(['config', 'smtp','port']) ]); ?>
    - 'Authentification', + $text[9], 'selected' => $this->getData(['config', 'smtp','auth']) ]); ?>
    @@ -79,20 +120,20 @@
    'Nom utilisateur', + 'label' => $text[10], 'value' => $this->getData(['config', 'smtp','username' ]) ]); ?>
    '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'])) : '' ]); ?>
    - 'Sécurité', + $text[12], 'selected' => $this->getData(['config', 'smtp','secure']) ]); ?>
    diff --git a/core/module/config/view/restore/restore.php b/core/module/config/view/restore/restore.php index 22a63cc..c1b907f 100644 --- a/core/module/config/view/restore/restore.php +++ b/core/module/config/view/restore/restore.php @@ -1,3 +1,40 @@ +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; +} +?>
    @@ -5,12 +42,12 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'config', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    'Restaurer', + 'value' => $text[1], 'uniqueSubmission' => true, ]); ?>
    @@ -18,18 +55,18 @@
    -

    Archive à restaurer

    +

    '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] ]); ?>
    - true ]); ?>
    @@ -41,12 +78,12 @@
    -

    Conversion après la restauration

    +

    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] ]); ?>
    'Dossier du site actuel', + 'label' => $text[11], 'value' => helper::baseUrl(false,false), 'readonly' => true ]); ?> @@ -73,7 +110,7 @@ helper::baseUrl() . 'config/updateBaseUrl', 'class' => $buttonClass, - 'value' => 'convertir' + 'value' => $text[12] ]); ?>
    diff --git a/core/module/config/view/script/script.php b/core/module/config/view/script/script.php index ea1ad0b..059f478 100644 --- a/core/module/config/view/script/script.php +++ b/core/module/config/view/script/script.php @@ -1,3 +1,18 @@ +getData(['config', 'i18n', 'langAdmin']); +switch ($val) { + case 'fr' : + $text[0] = 'Retour'; + $text[1] = 'Valider'; + break; + case 'en' : + $text[0] = 'Return'; + $text[1] = 'Validate'; + break; +} +?>
    @@ -5,12 +20,12 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'config', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    'Valider', + 'value' => $text[1], 'ico' => 'check' ]); ?>
    diff --git a/core/module/config/view/setup/setup.php b/core/module/config/view/setup/setup.php index 92905d6..c4a2469 100644 --- a/core/module/config/view/setup/setup.php +++ b/core/module/config/view/setup/setup.php @@ -1,8 +1,67 @@ +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.
    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.

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

    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; +} +?>

    - $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] ]); ?>
    - 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] ]); ?>
    @@ -54,7 +113,7 @@
    -

    Mise à jour automatisée +

    @@ -64,16 +123,16 @@
    - $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 ]); ?>
    - $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 ]); ?>
    @@ -81,7 +140,7 @@ 'download-cloud', 'href' => helper::baseUrl() . 'install/update', - 'value' => 'Réinstaller', + 'value' => $text[17], 'class' => 'buttonRed', 'disabled' => !$updateError ]); ?> @@ -93,7 +152,7 @@
    -

    Maintenance +

    @@ -102,13 +161,13 @@

    - $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.

    Les fichiers du site ne sont pas sauvegardés automatiquement. Activation recommandée.' + 'help' => $text[19] ]); ?>

    - $this->getData(['config', 'maintenance']) ]); ?>
    @@ -117,21 +176,21 @@
    helper::baseUrl() . 'config/backup', - 'value' => 'Sauvegarder', + 'value' => $text[21], 'ico' => 'download-cloud' ]); ?>
    helper::baseUrl() . 'config/restore', - 'value' => 'Restaurer', + 'value' => $text[22], 'ico' => 'upload-cloud' ]); ?>
    helper::baseUrl() . 'config/copyBackups', - 'value' => 'Copie sauvegardes auto', + 'value' => $text[23], 'ico' => 'download-cloud' ]); ?>
    diff --git a/core/module/config/view/social/social.php b/core/module/config/view/social/social.php index 94728aa..e760cb1 100644 --- a/core/module/config/view/social/social.php +++ b/core/module/config/view/social/social.php @@ -1,8 +1,51 @@ +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] = '

    Image screenshot.jpg absente

    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.

    '; + $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] = '

    Image screenshot.jpg absent

    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.

    '; + $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; +} +?>
    -

    Paramètres +

    @@ -13,7 +56,7 @@
    - helper::baseUrl() . 'config/configOpenGraph', 'value' => $texte @@ -25,13 +68,13 @@
    helper::baseUrl() . 'config/generateFiles', - 'value' => 'Générer sitemap.xml et robots.txt' + 'value' => $text[3] ]); ?>
    - $this->getData(['config', 'seo','robots']) ]); ?>
    @@ -41,13 +84,13 @@
    - +
    -

    Image screenshot.jpg absente

    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.

    +
    @@ -59,7 +102,7 @@
    -

    Réseaux sociaux +

    @@ -69,28 +112,28 @@
    'Saisissez votre ID : https://www.facebook.com/[ID].', + 'help' => $text[8], 'label' => 'Facebook', 'value' => $this->getData(['config', 'social', 'facebookId']) ]); ?>
    'Saisissez votre ID : https://www.instagram.com/[ID].', + 'help' => $text[9], 'label' => 'Instagram', 'value' => $this->getData(['config', 'social', 'instagramId']) ]); ?>
    'ID de la chaîne : https://www.youtube.com/channel/[ID].', + 'help' => $text[10], 'label' => 'Chaîne Youtube', 'value' => $this->getData(['config', 'social', 'youtubeId']) ]); ?>
    '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 @@
    'Saisissez votre ID : https://twitter.com/[ID].', + 'help' => $text[12], 'label' => 'Twitter', 'value' => $this->getData(['config', 'social', 'twitterId']) ]); ?>
    'Saisissez votre ID : https://pinterest.com/[ID].', + 'help' => $text[13], 'label' => 'Pinterest', 'value' => $this->getData(['config', 'social', 'pinterestId']) ]); ?>
    'Saisissez votre ID Linkedin : https://fr.linkedin.com/in/[ID].', + 'help' => $text[14], 'label' => 'Linkedin', 'value' => $this->getData(['config', 'social', 'linkedinId']) ]); ?>
    'Saisissez votre ID Github : https://github.com/[ID].', + 'help' => $text[15], 'label' => 'Github', 'value' => $this->getData(['config', 'social', 'githubId']) ]); ?> diff --git a/core/module/install/install.php b/core/module/install/install.php index ded2c2a..ab567e3 100644 --- a/core/module/install/install.php +++ b/core/module/install/install.php @@ -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' . ' ' . $userFirstname . ' ' . $userLastname . ',

    ' . - 'Voici les détails de votre installation.

    ' . - 'URL du site :
    ' . helper::baseUrl(false) . '
    ' . - 'Identifiant du compte : ' . $this->getInput('installId') . '
    ', + $text[0], + $text[1] . ' ' . $userFirstname . ' ' . $userLastname . ',

    ' . + $text[2].'

    ' . + ''.$text[3].' : ' . helper::baseUrl(false) . '
    ' . + ''.$text[4].' : ' . $this->getInput('installId') . '
    ', 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' ]); } diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index b897ab7..a39f5f9 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -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' => '

    Bienvenue sur votre nouveau site DeltaCMS !

    -

    Un email contenant le récapitulatif de votre installation vient de vous être envoyé.

    -

    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 !

    ' + 'content' => '

    Deltacms

    +
    +

    Bienvenue sur votre nouveau site DeltaCMS !

    +

    Un email contenant le récapitulatif de votre installation vient de vous être envoyé.

     

    +

    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 !

    +
    +

    Welcome to your new DeltaCMS website !

    + An email containing the summary of your installation has just been sent to you.

     

    +

    Log in now to your member area to create a site that suits you !

    You will be able to customize the theme, create pages, add users and much more !

    +
    ' ], 'enfant' => [ 'content' => '

    Vous pouvez assigner des parents à vos pages afin de mieux organiser votre menu !

    diff --git a/core/module/install/view/index/index.js.php b/core/module/install/view/index/index.js.php index c96e6b0..fce0d3c 100644 --- a/core/module/install/view/index/index.js.php +++ b/core/module/install/view/index/index.js.php @@ -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); } -}); \ No newline at end of file +}); + +/* + * 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"); diff --git a/core/module/install/view/index/index.php b/core/module/install/view/index/index.php index 2fc1721..50dac6b 100644 --- a/core/module/install/view/index/index.php +++ b/core/module/install/view/index/index.php @@ -1,60 +1,100 @@ -

    Renseignez les champs ci-dessous pour finaliser l'installation.

    +
    +
    +

    +
    +
    + 'English','fr'=>'Français'], [ + 'label' => '', + 'selected' => 'fr' + ]); ?> +
    +
    - 'off', - 'label' => 'Identifiant' - ]); ?>
    +
    Identifiant
    Identifier
    + 'off', + 'label' => '' + ]); ?> +
    +
    +
    +
    +
    Mot de passe
    Password
    'off', - 'label' => 'Mot de passe' + 'label' => '' ]); ?>
    +
    Confirmation
    Confirmation
    'off', - 'label' => 'Confirmation' + 'label' => '' ]); ?>
    +
    Adresse mail
    Email address
    'off', - 'label' => 'Adresse mail' + 'label' => '' ]); ?>
    +
    Prénom
    Vorname
    'off', - 'label' => 'Prénom' + 'label' => '' ]); ?>
    +
    Nom
    Name
    'off', - 'label' => 'Nom' + 'label' => '' ]); ?>
    +
    Thème
    Theme
    'Thème' + 'label' => '' ]); ?>
    -
    - + false ]); ?>
    +
    +
    Sans exemple de site
    Without an example site
    +
    +
    +
    +
    Langue d'administration
    Administration language
    + 'Français (fr)','en'=>'Anglais (en)'], [ + 'label' => '', + 'selected' => $this->getData(['config', 'i18n' , 'langAdmin']) + ]); ?> +
    +
    +
    Langue originale du site
    Original language of the site
    + '', + 'selected' => $this->getData(['config', 'i18n' , 'langBase']) + ]); ?> +
    +
    'Installer' + 'value' => 'OK' ]); ?>
    diff --git a/core/module/install/view/update/update.php b/core/module/install/view/update/update.php index 53ababf..f98cdb1 100644 --- a/core/module/install/view/update/update.php +++ b/core/module/install/view/update/update.php @@ -1,26 +1,58 @@ -

    Mise à jour de Deltacms vers Deltacms .

    -

    Afin d'assurer le bon fonctionnement de Deltacms, veuillez ne pas fermer cette page avant la fin de l'opération.

    +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; +} + +?> +

    .

    +

    - 1/4 : Préparation... - 2/4 : Téléchargement... - 3/4 : Installation... - 4/4 : Configuration... + + + +
    - Une erreur est survenue lors de l'étape . + .
    - Mise à jour terminée avec succès. +
    'Terminer', + 'value' => $text[9], 'href' => helper::baseUrl() . 'config', 'ico' => 'check', 'class' => 'disabled' diff --git a/core/module/maintenance/maintenance.php b/core/module/maintenance/maintenance.php index e3d5f5d..2cedcdc 100644 --- a/core/module/maintenance/maintenance.php +++ b/core/module/maintenance/maintenance.php @@ -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' ]); } diff --git a/core/module/maintenance/view/index/index.php b/core/module/maintenance/view/index/index.php index de41231..9681a52 100644 --- a/core/module/maintenance/view/index/index.php +++ b/core/module/maintenance/view/index/index.php @@ -1,8 +1,9 @@

    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.

    +

    Our site is currently undergoing maintenance. We apologise for the inconvenience and are doing our best to be back soon.

    'Connexion', + 'value' => '', 'href' => helper::baseUrl() . 'user/login', 'ico' => 'lock' ]); ?> diff --git a/core/module/page/page.php b/core/module/page/page.php index fdf4280..0892ee5 100644 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -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', '

    Contenu de votre nouvelle page.

    '); - $this->setPage($pageId, '

    Contenu de votre nouvelle page.

    ', self::$i18n); + $this->setPage($pageId, '

    '.$text[1].'

    ', 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'; + ?> + + addOutput([ 'title' => $this->getData(['page', $this->getUrl(2), 'title']), diff --git a/core/module/page/view/edit/edit.js.php b/core/module/page/view/edit/edit.js.php index 4807a72..e70d3d6 100644 --- a/core/module/page/view/edit/edit.js.php +++ b/core/module/page/view/edit/edit.js.php @@ -20,7 +20,14 @@ */ $("#pageEditDelete").on("click", function() { var _this = $(this); - return core.confirm("Confirmez-vous la suppression de cette page ?", function() { + var text = ""; + 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 = ""; + 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 = getHierarchy()); ?>; var pages = getData(['page'])); ?>; -// 9.0.07 corrige une mauvaise sélection d'une page orpheline avec enfant + var positionInitial = getData(['page',$this->getUrl(2),"position"]); ?>; -// 9.0.07 + $("#pageEditParentPageId").on("change", function() { var positionDOM = $("#pageEditPosition"); + var text1=""; + var text2=""; + var text3=""; + 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( - $("
    -

    Informations générales +

    @@ -53,15 +161,15 @@
    'Titre', + 'label' => $text[6], 'value' => $this->getData(['page', $this->getUrl(2), 'title']) ]); ?>
    '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] ]); ?>
    @@ -69,8 +177,8 @@
    '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']) ]); ?> $this->getData(['page', $this->getUrl(2), 'moduleId'])]); ?> @@ -90,22 +198,22 @@
    - 'Aspect du lien', + $text[11], 'selected' => $this->getData(['page', $this->getUrl(2), 'typeMenu']) ]); ?>
    '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']) ]); ?>
    - 'En position libre ajoutez le module en plaçant [MODULE] à l\'endroit voulu dans votre page.', - 'label' => 'Position du module', + $text[14], + 'label' => $text[15], 'selected' => $this->getData(['page', $this->getUrl(2), 'modulePosition']) ]); ?>
    @@ -125,7 +233,7 @@
    -

    Mise en page +

    @@ -137,9 +245,9 @@
    - 'Gabarits de page / Barre latérale', - 'help' => 'Pour définir la page comme barre latérale, choisissez l\'option dans la liste.', + $text[17], + 'help' => $text[18], 'selected' => $this->getData(['page', $this->getUrl(2) , 'block']) ]); ?>
    @@ -152,8 +260,8 @@ 'value' => $this->getData(['page', $this->getUrl(2), 'barLeft']) ]); ?> - 'Barre latérale gauche :', + $text[19], 'selected' => $this->getData(['page', $this->getUrl(2), 'barLeft']) ]); ?> @@ -162,15 +270,15 @@ 'value' => $this->getData(['page', $this->getUrl(2), 'barRight']) ]); ?> - 'Barre latérale droite :', + $text[20], 'selected' => $this->getData(['page', $this->getUrl(2), 'barRight']) ]); ?> - 'Contenu du menu vertical', + $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] ]); ?>
    @@ -181,7 +289,7 @@
    -

    Emplacement dans le menu +

    @@ -192,8 +300,8 @@
    'Position', - 'help' => '\'Ne pas afficher\' crée une page orpheline non accessible par le biais des menus.' + 'label' => $text[24], + 'help' => $text[25] ]); ?>
    @@ -202,8 +310,8 @@ 'value' => $this->getData(['page', $this->getUrl(2), 'parentPageId']) ]); ?> - 'Page parent', + $text[26], 'selected' => $this->getData(['page', $this->getUrl(2), 'parentPageId']) ]); ?> @@ -212,27 +320,27 @@
    - $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] ]); ?>
    - $this->getData(['page', $this->getUrl(2), 'targetBlank']) ]); ?>
    - $this->getData(['page', $this->getUrl(2), 'hideTitle']) ]); ?>
    - $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] ]); ?>
    @@ -243,7 +351,7 @@
    -

    Options d'emplacement avancées +

    @@ -253,14 +361,14 @@
    - $this->getData(['page', $this->getUrl(2), 'hideMenuChildren']) ]); ?>
    - $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] ]); ?>
    @@ -271,7 +379,7 @@
    -

    Permission et référencement +

    @@ -281,18 +389,18 @@
    - 'Groupe requis pour accéder à la page :', + $text[34], 'selected' => $this->getData(['page', $this->getUrl(2), 'group']) ]); ?>
    'Méta-titre', + 'label' => $text[35], 'value' => $this->getData(['page', $this->getUrl(2), 'metaTitle']) ]); ?> 'Méta-description', + 'label' => $text[36], //'maxlength' => '500', 'value' => $this->getData(['page', $this->getUrl(2), 'metaDescription']) ]); ?> diff --git a/core/module/sitemap/sitemap.php b/core/module/sitemap/sitemap.php index a982e30..d4a036a 100644 --- a/core/module/sitemap/sitemap.php +++ b/core/module/sitemap/sitemap.php @@ -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 = '
      '; foreach ($this->getHierarchy(null, true, null) as $parentId => $childIds) { $items .= '
    • '; @@ -108,7 +118,7 @@ class sitemap extends common // Valeurs en sortie $this->addOutput([ - 'title' => 'Plan du site', + 'title' => $text[0], 'view' => 'index' ]); } diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 1d50255..00282d7 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -42,14 +42,27 @@ class theme extends common { 'center' => 'Au centre', 'right' => 'À droite' ]; + public static $aligns_en = [ + 'left' => 'Left', + 'center' => 'Center', + 'right' => 'Right' + ]; public static $attachments = [ 'scroll' => 'Standard', 'fixed' => 'Fixe' ]; + public static $attachments_en = [ + 'scroll' => 'Standard', + 'fixed' => 'Fixed' + ]; public static $containerWides = [ 'container' => 'Limitée au site', 'none' => 'Etendue sur la page' ]; + public static $containerWides_en = [ + 'container' => 'Limited to the site', + 'none' => 'Extended to the page' + ]; public static $footerblocks = [ 1 => [ 'hide' => 'Masqué', @@ -69,11 +82,34 @@ class theme extends common { 'center' => 'Au milieu', 'right' => 'En bas' ] ]; + public static $footerblocks_en = [ + 1 => [ + 'hide' => 'Hidden', + 'center' => 'Affiché' ], + 2 => [ + 'hide' => 'Hidden', + 'left' => 'Left', + 'right' => 'Right' ], + 3 => [ + 'hide' => 'Hidden', + 'left' => 'Left', + 'center' => 'Center', + 'right' => 'Right' ], + 4 => [ + 'hide' => 'Hidden', + 'left' => 'Top', + 'center' => 'Middle', + 'right' => 'Bottom' ] + ]; public static $fontWeights = [ 'normal' => 'Maigre', 'bold' => 'Gras' ]; + public static $fontWeights_en = [ + 'normal' => 'Thin', + 'bold' => 'Bold' + ]; public static $footerHeights = [ '0px' => 'Nulles (0px)', '5px' => 'Très petites (5px)', @@ -81,11 +117,23 @@ class theme extends common { '15px' => 'Moyennes (15px)', '20px' => 'Grandes (20px)' ]; + public static $footerHeights_en = [ + '0px' => 'Nome (0px)', + '5px' => 'Very small (5px)', + '10px' => 'small (10px)', + '15px' => 'Medium (15px)', + '20px' => 'Large (20px)' + ]; public static $footerPositions = [ 'hide' => 'Caché', 'site' => 'Dans le site', 'body' => 'En dessous du site' ]; + public static $footerPositions_en = [ + 'hide' => 'Hidden', + 'site' => 'In the site', + 'body' => 'Below the site' + ]; public static $footerFontSizes = [ '.8em' => 'Très petite (80%)', '.9em' => 'Petite (90%)', @@ -94,6 +142,14 @@ class theme extends common { '1.2em' => 'Grande (120%)', '1.3em' => 'Très grande (130%)' ]; + public static $footerFontSizes_en = [ + '.8em' => 'Very small (80%)', + '.9em' => 'Small (90%)', + '1em' => 'Standard (100%)', + '1.1em' => 'Medium (110%)', + '1.2em' => 'Large (120%)', + '1.3em' => 'Very large (130%)' + ]; public static $headerFontSizes = [ '1.6em' => 'Très petite (160%)', '1.8em' => 'Petite (180%)', @@ -101,6 +157,13 @@ class theme extends common { '2.2em' => 'Grande (220%)', '2.4vmax' => 'Très grande (240%)' ]; + public static $headerFontSizes_en = [ + '1.6em' => 'Very small (160%)', + '1.8em' => 'Small (180%)', + '2em' => 'Medium (200%)', + '2.2em' => 'Large (220%)', + '2.4vmax' => 'Very large (240%)' + ]; public static $headerHeights = [ 'unset' => 'Libre', // texte dynamique cf header.js.php '100px' => 'Très petite (100px) ', @@ -109,15 +172,32 @@ class theme extends common { '300px' => 'Grande (300px)', '400px' => 'Très grande (400px)', ]; + public static $headerHeights_en = [ + 'unset' => 'Free', // texte dynamique cf header.js.php + '100px' => 'Very small (100px) ', + '150px' => 'Small (150px)', + '200px' => 'Medium (200px)', + '300px' => 'Large (300px)', + '400px' => 'Very large (400px)', + ]; public static $headerPositions = [ 'body' => 'Au dessus du site', 'site' => 'Dans le site', 'hide' => 'Cachée' ]; + public static $headerPositions_en = [ + 'body' => 'Above the site', + 'site' => 'In the site', + 'hide' => 'Hidden' + ]; public static $headerFeatures = [ 'wallpaper' => 'Couleur unie ou papier-peint', 'feature' => 'Contenu personnalisé' ]; + public static $headerFeatures_en = [ + 'wallpaper' => 'Solid colour or wallpaper', + 'feature' => 'Custom content' + ]; public static $imagePositions = [ 'top left' => 'En haut à gauche', 'top center' => 'En haut au centre', @@ -129,6 +209,17 @@ class theme extends common { 'bottom center' => 'En bas au centre', 'bottom right' => 'En bas à droite' ]; + public static $imagePositions_en = [ + 'top left' => 'Top left', + 'top center' => 'Top center', + 'top right' => 'Top right', + 'center left' => 'Middle left', + 'center center' => 'Middle center', + 'center right' => 'Middle right', + 'bottom left' => 'Bottom left', + 'bottom center' => 'Bottom center', + 'bottom right' => 'Bottom right' + ]; public static $menuFontSizes = [ '.8em' => 'Très petite (80%)', '.9em' => 'Petite (90%)', @@ -137,6 +228,14 @@ class theme extends common { '1.2em' => 'Grande (120%)', '1.3em' => 'Très grande (130%)' ]; + public static $menuFontSizes_en = [ + '.8em' => 'Very small (80%)', + '.9em' => 'Small (90%)', + '1em' => 'Standard (100%)', + '1.1em' => 'Medium (110%)', + '1.2em' => 'Large (120%)', + '1.3em' => 'Very large (130%)' + ]; public static $menuHeights = [ '5px 10px' => 'Très petite', '10px' => 'Petite', @@ -144,12 +243,25 @@ class theme extends common { '20px 15px' => 'Grande', '25px 15px' => 'Très grande' ]; + public static $menuHeights_en = [ + '5px 10px' => 'Very small', + '10px' => 'Small', + '15px 10px' => 'Medium', + '20px 15px' => 'Large', + '25px 15px' => 'Very large' + ]; public static $menuPositionsSite = [ 'top' => 'En-dehors du site', 'site-first' => 'Avant la bannière', 'site-second' => 'Après la bannière', 'hide' => 'Caché' ]; + public static $menuPositionsSite_en = [ + 'top' => 'Outside the site', + 'site-first' => 'Before the banner', + 'site-second' => 'After the banner', + 'hide' => 'Hidden' + ]; public static $menuPositionsBody = [ 'top' => 'En-dehors du site', 'body-first' => 'Avant la bannière', @@ -157,6 +269,13 @@ class theme extends common { 'site' => 'Dans le site', 'hide' => 'Caché' ]; + public static $menuPositionsBody_en = [ + 'top' => 'Outside the site', + 'body-first' => 'Before the banner', + 'body-second' => 'After the banner', + 'site' => 'In the site', + 'hide' => 'Hidden' + ]; public static $menuRadius = [ '0px' => 'Aucun', '3px 3px 0px 0px' => 'Très léger', @@ -165,6 +284,14 @@ class theme extends common { '12px 12px 0px 0px' => 'Important', '15px 15px 0px 0px' => 'Très important' ]; + public static $menuRadius_en = [ + '0px' => 'None', + '3px 3px 0px 0px' => 'Very light', + '6px 6px 0px 0px' => 'Light', + '9px 9px 0px 0px' => 'Medium', + '12px 12px 0px 0px' => 'Important', + '15px 15px 0px 0px' => 'Very important' + ]; public static $radius = [ '0px' => 'Aucun', '5px' => 'Très léger', @@ -173,12 +300,26 @@ class theme extends common { '25px' => 'Important', '50px' => 'Très important' ]; + public static $radius_en = [ + '0px' => 'None', + '5px' => 'Very light', + '10px' => 'Light', + '15px' => 'Medium', + '25px' => 'Important', + '50px' => 'Very important' + ]; public static $repeats = [ 'no-repeat' => 'Ne pas répéter', 'repeat-x' => 'Sur l\'axe horizontal', 'repeat-y' => 'Sur l\'axe vertical', 'repeat' => 'Sur les deux axes' ]; + public static $repeats_en = [ + 'no-repeat' => 'Do not repeat', + 'repeat-x' => 'On the horizontal axis', + 'repeat-y' => 'On the vertical axis', + 'repeat' => 'On both axes' + ]; public static $shadows = [ '0px 0px 0px' => 'Aucune', '1px 1px 5px' => 'Très légère', @@ -187,13 +328,29 @@ class theme extends common { '1px 1px 25px' => 'Importante', '1px 1px 50px' => 'Très importante' ]; + public static $shadows_en = [ + '0px 0px 0px' => 'None', + '1px 1px 5px' => 'Very light', + '1px 1px 10px' => 'Light', + '1px 1px 15px' => 'Medium', + '1px 1px 25px' => 'Importante', + '1px 1px 50px' => 'Very importante' + ]; public static $blockShadows = [ '0px 0px 0px' => 'Aucune', '1px 1px 2px' => 'Très légère', '2px 2px 4px' => 'Légère', '3px 3px 6px' => 'Moyenne', - '5px 5px 10px' => 'Importante', - '10px 10px 20px' => 'Très importante' + '5px 5px 10px' => 'Important', + '10px 10px 20px' => 'Très important' + ]; + public static $blockShadows_en = [ + '0px 0px 0px' => 'None', + '1px 1px 2px' => 'Very light', + '2px 2px 4px' => 'Light', + '3px 3px 6px' => 'Medium', + '5px 5px 10px' => 'Important', + '10px 10px 20px' => 'Very important' ]; public static $siteFontSizes = [ '12px' => '12 pixels', @@ -210,35 +367,70 @@ class theme extends common { 'cover' => 'Responsive (cover)', 'contain' => 'Responsive (contain)' ]; + public static $bodySizes_en = [ + 'auto' => 'Automatic', + '100% 100%' => 'Stretched image (100% 100%)', + 'cover' => 'Responsive (cover)', + 'contain' => 'Responsive (contain)' + ]; public static $textTransforms = [ 'none' => 'Standard', 'lowercase' => 'Minuscules', 'uppercase' => 'Majuscules', 'capitalize' => 'Majuscule à chaque mot' ]; + public static $textTransforms_en = [ + 'none' => 'Standard', + 'lowercase' => 'Lowercase', + 'uppercase' => 'Upper case', + 'capitalize' => 'Capitalize every word' + ]; public static $siteWidths = [ '750px' => 'Petite (750 pixels)', '960px' => 'Moyenne (960 pixels)', '1170px' => 'Grande (1170 pixels)', '100%' => 'Fluide (100%)' ]; + public static $siteWidths_en = [ + '750px' => 'Small (750 pixels)', + '960px' => 'Medium (960 pixels)', + '1170px' => 'Large (1170 pixels)', + '100%' => 'Fluide (100%)' + ]; public static $headerWide = [ 'auto auto' => 'Automatique', '100% 100%' => 'Image étirée (100% 100%)', 'cover' => 'Responsive (cover)', 'contain' => 'Responsive (contain)' ]; + public static $headerWide_en = [ + 'auto auto' => 'Automatic', + '100% 100%' => 'Stretched image (100% 100%)', + 'cover' => 'Responsive (cover)', + 'contain' => 'Responsive (contain)' + ]; public static $footerTemplate = [ '1' => 'Une seule colonne', '2' => 'Deux colonnes : 1/2 - 1/2', '3' => 'Trois colonnes : 1/3 - 1/3 - 1/3', '4' => 'Trois lignes superposées' ]; + public static $footerTemplate_en = [ + '1' => 'One column', + '2' => 'Two columns : 1/2 - 1/2', + '3' => 'Three columns : 1/3 - 1/3 - 1/3', + '4' => 'Three rows on top of each' + ]; public static $burgerContent = [ 'none' => 'Aucun', 'title' => 'Titre du site', 'logo' => 'Logo du site' ]; + public static $burgerContent_en = [ + 'none' => 'None', + 'title' => 'Site title', + 'logo' => 'Site logo' + ]; // Fonts public static $fonts = []; @@ -250,7 +442,12 @@ class theme extends common { //'link' => 'Fichier externe avec link', //'import' => 'Fichier externe avec import' ]; - + public static $typeAddFont_en = [ + 'none' => 'None', + 'file' => 'Local file' + //'link' => 'Fichier externe avec link', + //'import' => 'Fichier externe avec import' + ]; // Variable pour construire la liste des pages du site public static $pagesList = []; @@ -258,6 +455,19 @@ class theme extends common { * Thème des écrans d'administration */ public function admin() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Modifications enregistrées'; + $text[1] = 'Administration'; + break; + case 'en' : + $text[0] = 'Saved changes'; + $text[1] = 'Administration'; + break; + } // Soumission du formulaire if($this->isPost()) { $this->setData(['admin', [ @@ -279,7 +489,7 @@ class theme extends common { ]]); // Valeurs en sortie $this->addOutput([ - 'notification' => 'Modifications enregistrées', + 'notification' => $text[0], 'redirect' => helper::baseUrl() . 'theme/admin', 'state' => true ]); @@ -287,7 +497,7 @@ class theme extends common { self::$fonts = $this->extract('./site/data/fonts.json'); // Valeurs en sortie $this->addOutput([ - 'title' => 'Administration', + 'title' => $text[1], 'view' => 'admin', 'vendor' => [ 'tinycolorpicker' @@ -299,20 +509,33 @@ class theme extends common { * Mode avancé */ public function advanced() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Modifications enregistrées'; + $text[1] = 'Éditeur CSS'; + break; + case 'en' : + $text[0] = 'Saved changes'; + $text[1] = 'CSS Editor'; + break; + } // Soumission du formulaire if($this->isPost()) { // Enregistre le CSS file_put_contents(self::DATA_DIR.'custom.css', $this->getInput('themeAdvancedCss', null)); // Valeurs en sortie $this->addOutput([ - 'notification' => 'Modifications enregistrées', + 'notification' => $text[0], 'redirect' => helper::baseUrl() . 'theme/advanced', 'state' => true ]); } // Valeurs en sortie $this->addOutput([ - 'title' => 'Éditeur CSS', + 'title' => $text[1], 'vendor' => [ 'codemirror' ], @@ -324,6 +547,17 @@ class theme extends common { * Gestion des polices / affichage principal */ public function fonts() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Gestion des polices'; + break; + case 'en' : + $text[0] = 'Font management'; + break; + } // Préparation du tableau d'affichage des polices $fontsName = helper::arrayCollumn($this->getData(['fonts']), 'name'); ksort($fontsName); @@ -349,7 +583,7 @@ class theme extends common { // Valeurs en sortie $this->addOutput([ - 'title' => 'Gestion des polices', + 'title' => $text[0], 'view' => 'fonts' ]); } @@ -358,12 +592,35 @@ class theme extends common { * Gestion des polices / édition */ public function editfonts() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Sélectionner le fichier...'; + $text[1] = 'Vous devez sélectionner un fichier'; + $text[2] = 'Modifications enregistrées'; + $text[3] = 'Pas de fichier dans le dossier '; + $text[4] = 'Dossier '; + $text[5] = 'inexistant'; + $text[6] = 'Édition d\'une police'; + break; + case 'en' : + $text[0] = 'Select file...'; + $text[1] = 'You need to select a file'; + $text[2] = 'Changes saved'; + $text[3] = 'No file in folder'; + $text[4] = 'File'; + $text[5] = 'Non-existent'; + $text[6] = 'Editing a font'; + break; + } // Retour du formulaire if($this->isPost()) { - if( $this->getInput('typeEditFont') === 'file' && $this->getInput('fileEditFont') === 'Sélectionner le fichier...'){ + if( $this->getInput('typeEditFont') === 'file' && $this->getInput('fileEditFont') === $text[0]){ // Valeurs en sortie $this->addOutput([ - 'notification' => 'Vous devez sélectionner un fichier', + 'notification' => $text[1], 'redirect' => helper::baseUrl() . 'theme/fonts', 'state' => false ]); @@ -382,7 +639,7 @@ class theme extends common { $this-> setData(['admin', 'maj', true]); // Valeurs en sortie $this->addOutput([ - 'notification' => 'Modifications enregistrées', + 'notification' => $text[2], 'redirect' => helper::baseUrl() . 'theme/fonts', 'state' => true ]); @@ -393,10 +650,10 @@ class theme extends common { if(is_dir(self::FILE_DIR.'source/fonts')) { $dir=self::FILE_DIR.'source/fonts'; $values = scandir($dir); - $values[0] = 'Sélectionner le fichier...'; + $values[0] = $text[0]; unset($values[array_search('..', $values)]); if (count($values) <= 1){ - self::$icsFiles = array(0 => 'Pas de fichier dans le dossier '.self::FILE_DIR.'source/fonts'); + self::$icsFiles = array(0 => $text[3].self::FILE_DIR.'source/fonts'); } else{ //Modifier les clefs (qui sont les valeurs de retour du formulaire avec clef = valeur @@ -404,12 +661,12 @@ class theme extends common { } } else { - self::$fontFiles = array(0 => 'Dossier '.self::FILE_DIR.'source/fonts inexistant'); + self::$fontFiles = array(0 => $text[4].self::FILE_DIR.'source/fonts '.$text[5]); } // Valeurs en sortie $this->addOutput([ - 'title' => 'Édition d\'une police', + 'title' => $text[6], 'view' => 'editFonts' ]); } @@ -418,13 +675,24 @@ class theme extends common { * Gestion des polices / suppression */ public function deleteFonts() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Police supprimée'; + break; + case 'en' : + $text[0] = 'Deleted font'; + break; + } //Suppression de la police passée en paramètre $this->deleteData(['fonts', $this->getUrl(2)]); // Force une maj de admin.css $this-> setData(['admin', 'maj', true]); // Valeurs en sortie $this->addOutput([ - 'notification' => 'Police supprimée', + 'notification' => $text[0], 'redirect' => helper::baseUrl() . 'theme/fonts', 'state' => true ]); @@ -434,12 +702,35 @@ class theme extends common { * Gestion des polices / ajout */ public function addFonts() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Sélectionner le fichier...'; + $text[1] = 'Vous devez sélectionner un fichier'; + $text[2] = 'Modifications enregistrées'; + $text[3] = 'Pas de fichier dans le dossier '; + $text[4] = 'Dossier '; + $text[5] = 'inexistant'; + $text[6] = 'Ajout d\'une police'; + break; + case 'en' : + $text[0] = 'Select file...'; + $text[1] = 'You need to select a file'; + $text[2] = 'Changes saved'; + $text[3] = 'No file in folder'; + $text[4] = 'File'; + $text[5] = 'Non-existent'; + $text[6] = 'Adding a font'; + break; + } // Retour du formulaire if($this->isPost()) { - if( $this->getInput('typeAddFont') === 'file' && $this->getInput('fileAddFont') === 'Sélectionner le fichier...'){ + if( $this->getInput('typeAddFont') === 'file' && $this->getInput('fileAddFont') === $text[0]){ // Valeurs en sortie $this->addOutput([ - 'notification' => 'Vous devez sélectionner un fichier', + 'notification' => $text[1], 'redirect' => helper::baseUrl() . 'theme/addFonts', 'state' => false ]); @@ -458,7 +749,7 @@ class theme extends common { $this-> setData(['admin', 'maj', true]); // Valeurs en sortie $this->addOutput([ - 'notification' => 'Modifications enregistrées', + 'notification' => $text[2], 'redirect' => helper::baseUrl() . 'theme/fonts', 'state' => true ]); @@ -468,10 +759,10 @@ class theme extends common { if(is_dir(self::FILE_DIR.'source/fonts')) { $dir=self::FILE_DIR.'source/fonts'; $values = scandir($dir); - $values[0] = 'Sélectionner le fichier...'; + $values[0] = $text[0]; unset($values[array_search('..', $values)]); if (count($values) <= 1){ - self::$icsFiles = array(0 => 'Pas de fichier dans le dossier '.self::FILE_DIR.'source/fonts'); + self::$icsFiles = array(0 => $text[3].self::FILE_DIR.'source/fonts'); } else{ //Modifier les clefs (qui sont les valeurs de retour du formulaire avec clef = valeur @@ -479,12 +770,12 @@ class theme extends common { } } else { - self::$fontFiles = array(0 => 'Dossier '.self::FILE_DIR.'source/fonts inexistant'); + self::$fontFiles = array(0 => $text[4].self::FILE_DIR.'source/fonts '.$text[5]); } // Valeurs en sortie $this->addOutput([ - 'title' => 'Ajout d\'une police', + 'title' => $text[6], 'view' => 'addFonts' ]); } @@ -494,6 +785,19 @@ class theme extends common { * Options de l'arrière plan */ public function body() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Modifications enregistrées'; + $text[1] = 'Personnalisation de l\'arrière plan'; + break; + case 'en' : + $text[0] = 'Changes saved'; + $text[1] = 'Customise background'; + break; + } // Soumission du formulaire if($this->isPost()) { $this->setData(['theme', 'body', [ @@ -508,14 +812,14 @@ class theme extends common { ]]); // Valeurs en sortie $this->addOutput([ - 'notification' => 'Modifications enregistrées', + 'notification' => $text[0], 'redirect' => helper::baseUrl() . 'theme', 'state' => true ]); } // Valeurs en sortie $this->addOutput([ - 'title' => 'Personnalisation de l\'arrière plan', + 'title' => $text[1], 'vendor' => [ 'tinycolorpicker' ], @@ -527,6 +831,21 @@ class theme extends common { * Options du pied de page */ public function footer() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Sélectionnez au moins un contenu à afficher'; + $text[1] = 'Modifications enregistrées'; + $text[2] = 'Personnalisation du pied de page'; + break; + case 'en' : + $text[0] = 'Select at least one content to display'; + $text[1] = 'Saved changes'; + $text[2] = 'Customise footer'; + break; + } // Soumission du formulaire if($this->isPost()) { if ( $this->getInput('themeFooterCopyrightPosition') === 'hide' && @@ -534,7 +853,7 @@ class theme extends common { $this->getInput('themeFooterTextPosition') === 'hide' ) { // Valeurs en sortie $this->addOutput([ - 'notification' => 'Sélectionnez au moins un contenu à afficher', + 'notification' => $text[0], 'redirect' => helper::baseUrl() . 'theme/footer', 'state' => false ]); @@ -574,7 +893,7 @@ class theme extends common { // Valeurs en sortie $this->addOutput([ - 'notification' => 'Modifications enregistrées', + 'notification' => $text[1], 'redirect' => helper::baseUrl() . 'theme', 'state' => true ]); @@ -590,9 +909,17 @@ class theme extends common { } } self::$fonts = $this->extract('./site/data/fonts.json'); + // Passage de la langue d'administration à Tinymce + $lang_admin = 'fr_FR'; + if( $this->getData(['config', 'i18n', 'langAdmin']) ==='en') $lang_admin = 'en_GB'; + ?> + + addOutput([ - 'title' => 'Personnalisation du pied de page', + 'title' => $text[2], 'vendor' => [ 'tinycolorpicker', 'tinymce' @@ -605,6 +932,19 @@ class theme extends common { * Options de la bannière */ public function header() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Modifications enregistrées'; + $text[1] = 'Personnalisation de la bannière'; + break; + case 'en' : + $text[0] = 'Changes saved'; + $text[1] = 'Customise banner'; + break; + } // Soumission du formulaire if($this->isPost()) { // Modification des URL des images dans la bannière perso @@ -651,15 +991,23 @@ class theme extends common { // Valeurs en sortie $this->addOutput([ - 'notification' => 'Modifications enregistrées', + 'notification' => $text[0], 'redirect' => helper::baseUrl() . 'theme', 'state' => true ]); } self::$fonts = $this->extract('./site/data/fonts.json'); + // Passage de la langue d'administration à Tinymce + $lang_admin = 'fr_FR'; + if( $this->getData(['config', 'i18n', 'langAdmin']) ==='en') $lang_admin = 'en_GB'; + ?> + + addOutput([ - 'title' => 'Personnalisation de la bannière', + 'title' => $text[1], 'vendor' => [ 'tinycolorpicker', 'tinymce' @@ -672,9 +1020,20 @@ class theme extends common { * Accueil de la personnalisation */ public function index() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Personnalisation des thèmes'; + break; + case 'en' : + $text[0] = 'Theme customisation'; + break; + } // Valeurs en sortie $this->addOutput([ - 'title' => 'Personnalisation des thèmes', + 'title' => $text[0], 'view' => 'index' ]); } @@ -683,6 +1042,19 @@ class theme extends common { * Options du menu */ public function menu() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Modifications enregistrées'; + $text[1] = 'Personnalisation du menu'; + break; + case 'en' : + $text[0] = 'Saved changes'; + $text[1] = 'Customise menu'; + break; + } // Soumission du formulaire if($this->isPost()) { $this->setData(['theme', 'menu', [ @@ -712,7 +1084,7 @@ class theme extends common { // Valeurs en sortie $this->addOutput([ - 'notification' => 'Modifications enregistrées', + 'notification' => $text[0], 'redirect' => helper::baseUrl() . 'theme', 'state' => true ]); @@ -720,7 +1092,7 @@ class theme extends common { self::$fonts = $this->extract('./site/data/fonts.json'); // Valeurs en sortie $this->addOutput([ - 'title' => 'Personnalisation du menu', + 'title' => $text[1], 'vendor' => [ 'tinycolorpicker' ], @@ -732,6 +1104,19 @@ class theme extends common { * Réinitialisation de la personnalisation avancée */ public function reset() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Réinitialisation effectuée'; + $text[1] = 'Jeton incorrect'; + break; + case 'en' : + $text[0] = 'Reset performed'; + $text[1] = 'Incorrect token'; + break; + } // $url prend l'adresse sans le token $url = explode('&',$this->getUrl(2)); @@ -759,14 +1144,14 @@ class theme extends common { // Valeurs en sortie $this->addOutput([ - 'notification' => 'Réinitialisation effectuée', + 'notification' => $text[0], 'redirect' => $redirect, 'state' => true ]); } else { // Valeurs en sortie $this->addOutput([ - 'notification' => 'Jeton incorrect' + 'notification' => $text[1] ]); } } @@ -776,6 +1161,19 @@ class theme extends common { * Options du site */ public function site() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Modifications enregistrées'; + $text[1] = 'Personnalisation du site'; + break; + case 'en' : + $text[0] = 'Changes saved'; + $text[1] = 'Site customisation'; + break; + } // Soumission du formulaire if($this->isPost()) { $this->setData(['theme', 'title', [ @@ -810,15 +1208,23 @@ class theme extends common { // Valeurs en sortie $this->addOutput([ - 'notification' => 'Modifications enregistrées', + 'notification' => $text[0], 'redirect' => helper::baseUrl() . 'theme', 'state' => true ]); } self::$fonts = $this->extract('./site/data/fonts.json'); + // Passage de la langue d'administration à Tinymce + $lang_admin = 'fr_FR'; + if( $this->getData(['config', 'i18n', 'langAdmin']) ==='en') $lang_admin = 'en_GB'; + ?> + + addOutput([ - 'title' => 'Personnalisation du site', + 'title' => $text[1], 'vendor' => [ 'tinycolorpicker', 'tinymce' @@ -831,6 +1237,17 @@ class theme extends common { * Import du thème */ public function manage() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Gestion des thèmes'; + break; + case 'en' : + $text[0] = 'Theme management'; + break; + } if($this->isPost() ) { $zipFilename = $this->getInput('themeManageImport', helper::FILTER_STRING_SHORT, true); @@ -842,14 +1259,14 @@ class theme extends common { $this->addOutput([ 'notification' => $data['notification'], 'state' => $data['success'], - 'title' => 'Gestion des thèmes', + 'title' => $text[0], 'view' => 'manage' ]);; } } // Valeurs en sortie $this->addOutput([ - 'title' => 'Gestion des thèmes', + 'title' => $text[0], 'view' => 'manage' ]); } @@ -861,6 +1278,25 @@ class theme extends common { */ public function import($zipName = '') { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Le thème a été importé'; + $text[1] = 'Erreur lors de l\'extraction, vérifiez les permissions.'; + $text[2] = 'Ce n\'est pas l\'archive d\'un thème !'; + $text[3] = 'Impossible d\'ouvrir l\'archive'; + $text[4] = 'Archive non spécifiée ou introuvable'; + break; + case 'en' : + $text[0] = 'The theme has been imported'; + $text[1] = 'Error while extracting, check permissions'; + $text[2] = 'This is not a theme archive!'; + $text[3] = 'Unable to open the archive'; + $text[4] = 'Archive not specified or not found'; + break; + } if ($zipName !== '' && file_exists($zipName)) { @@ -903,13 +1339,13 @@ class theme extends common { $this->copyDir( $importFolder, './'); $this->removeDir($importFolder); // traitement de l'erreur - $notification = $success ? 'Le thème a été importé' : 'Erreur lors de l\'extraction, vérifiez les permissions.'; + $notification = $success ? $text[0] : $text[1]; } else { // pas une archive de thème $success = false; - $notification = 'Ce n\'est pas l\'archive d\'un thème !'; + $notification = $text[2]; } // Supprimer le dossier temporaire même si le thème est invalide $this->removeDir(self::TEMP_DIR . $tempFolder); @@ -917,12 +1353,12 @@ class theme extends common { } else { // erreur à l'ouverture $success = false; - $notification = 'Impossible d\'ouvrir l\'archive'; + $notification = $text[3]; } return (['success' => $success, 'notification' => $notification]); } - return (['success' => false, 'notification' => 'Archive non spécifiée ou introuvable']); + return (['success' => false, 'notification' => $text[4]]); } @@ -949,6 +1385,19 @@ class theme extends common { * Export du thème */ public function save() { + // Lexique + $text = []; + $val = $this->getData(['config', 'i18n', 'langAdmin']); + switch ($val) { + case 'fr' : + $text[0] = 'Archive '; + $text[1] = ' sauvegardée avec succès'; + break; + case 'en' : + $text[0] = 'Archive '; + $text[1] = ' successfully saved'; + break; + } // Make zip $zipFilename = $this->zipTheme($this->getUrl(2)); // Téléchargement du ZIP @@ -960,7 +1409,7 @@ class theme extends common { unlink (self::TEMP_DIR . $zipFilename); // Valeurs en sortie $this->addOutput([ - 'notification' => 'Archive '.$zipFilename.' sauvegardée avec succès', + 'notification' => $text[0].''.$zipFilename.''. $text[1], 'redirect' => helper::baseUrl() . 'theme/manage', 'state' => true ]); diff --git a/core/module/theme/view/addFonts/addFonts.js.php b/core/module/theme/view/addFonts/addFonts.js.php index 080d465..76b4b04 100644 --- a/core/module/theme/view/addFonts/addFonts.js.php +++ b/core/module/theme/view/addFonts/addFonts.js.php @@ -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=""; + 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")); }); }); \ No newline at end of file diff --git a/core/module/theme/view/addFonts/addFonts.php b/core/module/theme/view/addFonts/addFonts.php index b607530..5e431d6 100644 --- a/core/module/theme/view/addFonts/addFonts.php +++ b/core/module/theme/view/addFonts/addFonts.php @@ -1,3 +1,40 @@ +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; +} +?>
      @@ -6,7 +43,7 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'theme/fonts', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
      @@ -14,37 +51,39 @@ 'href' => 'https://doc.deltacms.fr/polices', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
      - + $text[2] + ]); ?>
    -

    Paramètres de la nouvelle police

    +

    'off', - 'label' => 'Nom', - 'help' => 'Nom de la police, majuscules et espaces autorisés' + 'label' => $text[4], + 'help' => $text[5] ]); ?>
    - 'Liaison avec un fichier de police', + $text[6], 'selected' => 'file', - 'help' => 'Le fichier de police est envoyé, ou pas, depuis un dépôt local' + 'help' => $text[7] ]); ?>
    '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] ]); ?>
    @@ -53,8 +92,8 @@
    'off', - 'label' => 'License', - 'help' => 'Type de license de la police' + 'label' => $text[10], + 'help' => $text[11] ]); ?>
    diff --git a/core/module/theme/view/admin/admin.js.php b/core/module/theme/view/admin/admin.js.php index 46ddc96..a06d138 100644 --- a/core/module/theme/view/admin/admin.js.php +++ b/core/module/theme/view/admin/admin.js.php @@ -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=""; + 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")); }); }); diff --git a/core/module/theme/view/admin/admin.php b/core/module/theme/view/admin/admin.php index 688f8a5..74da2c1 100644 --- a/core/module/theme/view/admin/admin.php +++ b/core/module/theme/view/admin/admin.php @@ -1,3 +1,56 @@ +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.
    Le curseur horizontal règle le niveau de transparence.'; + $text[7] = 'Couleur visible en l\'absence d\'une image.
    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.
    The horizontal slider adjusts the level of transparency.'; + $text[7] = 'The colour visible in the absence of an image.
    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; +} +?>
    @@ -5,7 +58,7 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'theme', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -13,26 +66,21 @@ 'href' => 'https://doc.deltacms.fr/administration', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    -
    - 'Bouton Standard' - ]); ?> -
    -
    +
    'buttonRed', 'href' => helper::baseUrl() . 'theme/reset/admin' . '&csrf=' . $_SESSION['csrf'], - 'value' => 'Réinitialiser', + 'value' => $text[3], 'ico' => 'cancel' ]); ?>
    'Valider', + 'value' => $text[4], 'ico' => 'check' ]); ?>
    @@ -40,29 +88,29 @@
    -

    Couleurs

    +

    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Arrière-plan', + 'help' => $text[6], + 'label' => $text[8], 'value' => $this->getData(['admin', 'backgroundColor']) ]); ?>
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Titres', + 'help' => $text[6], + 'label' => $text[9], 'value' => $this->getData(['admin', 'colorTitle']) ]); ?>
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Texte', + 'help' => $text[6], + 'label' => $text[10], 'value' => $this->getData(['admin', 'colorText']) ]); ?>
    @@ -71,24 +119,24 @@
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    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']) ]); ?>
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Bordure des champs', + 'help' => $text[6], + 'label' => $text[12], 'value' => $this->getData(['admin', 'borderBlockColor']) ]); ?>
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Bouton Aide', + 'help' => $text[6], + 'label' => $text[13], 'value' => $this->getData(['admin', 'backgroundColorButtonHelp']) ]); ?>
    @@ -97,32 +145,32 @@
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Bouton retour', + 'help' => $text[6], + 'label' => $text[14], 'value' => $this->getData(['admin', 'backgroundColorButtonGrey']) ]); ?>
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Bouton standard', + 'help' => $text[6], + 'label' => $text[15], 'value' => $this->getData(['admin', 'backgroundColorButton']) ]); ?>
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Bouton effacement', + 'help' => $text[6], + 'label' => $text[16], 'value' => $this->getData(['admin', 'backgroundColorButtonRed']) ]); ?>
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Bouton validation', + 'help' => $text[6], + 'label' => $text[17], 'value' => $this->getData(['admin', 'backgroundColorButtonGreen']) ]); ?>
    @@ -133,24 +181,24 @@
    -

    Mise en forme du texte

    +

    'Police du texte', + 'label' => $text[19], 'selected' => $this->getData(['admin', 'fontText']), 'fonts' => true ]); ?>
    'Taille', + 'label' => $text[20], 'selected' => $this->getData(['admin', 'fontSize']) ]); ?>
    'Police des titres', + 'label' => $text[21], 'selected' => $this->getData(['admin', 'fontTitle']), 'fonts' => true ]); ?> diff --git a/core/module/theme/view/advanced/advanced.js.php b/core/module/theme/view/advanced/advanced.js.php index ad3936a..6d5a701 100644 --- a/core/module/theme/view/advanced/advanced.js.php +++ b/core/module/theme/view/advanced/advanced.js.php @@ -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=""; + 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")); }); }); \ No newline at end of file diff --git a/core/module/theme/view/advanced/advanced.php b/core/module/theme/view/advanced/advanced.php index ae1f7bf..95222a3 100644 --- a/core/module/theme/view/advanced/advanced.php +++ b/core/module/theme/view/advanced/advanced.php @@ -1,3 +1,22 @@ +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; +} +?>
    @@ -5,7 +24,7 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'theme', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -13,7 +32,7 @@ 'href' => 'https://doc.deltacms.fr/editeur-css', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    @@ -22,11 +41,13 @@ 'href' => helper::baseUrl() . 'theme/reset/custom' . '&csrf=' . $_SESSION['csrf'], 'class' => 'buttonRed', 'ico' => 'cancel', - 'value' => 'Réinitialiser' + 'value' => $text[2] ]); ?>
    - + $text[3] + ]); ?>
    diff --git a/core/module/theme/view/body/body.php b/core/module/theme/view/body/body.php index b55c4bf..f6b8e77 100644 --- a/core/module/theme/view/body/body.php +++ b/core/module/theme/view/body/body.php @@ -1,3 +1,54 @@ +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.
    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.
    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; +} +?>
    @@ -5,7 +56,7 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'theme', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -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' ]); ?>
    - + $text[2] + ]); ?>
    -

    Couleurs

    +

    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    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']) ]); ?>
    @@ -39,16 +92,16 @@
    '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']) ]); ?>
    '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']) ]); ?>
    @@ -59,14 +112,14 @@
    -

    Image

    +

    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 @@
    - 'Répétition', + $text[12], 'selected' => $this->getData(['theme', 'body', 'imageRepeat']) ]); ?>
    - 'Position', + $text[13], 'selected' => $this->getData(['theme', 'body', 'imagePosition']) ]); ?>
    - 'Défilement', + $text[14], 'selected' => $this->getData(['theme', 'body', 'imageAttachment']) ]); ?>
    - 'Taille', + $text[15], 'selected' => $this->getData(['theme', 'body', 'imageSize']) ]); ?>
    diff --git a/core/module/theme/view/editFonts/editFonts.php b/core/module/theme/view/editFonts/editFonts.php index 04cd257..8595302 100644 --- a/core/module/theme/view/editFonts/editFonts.php +++ b/core/module/theme/view/editFonts/editFonts.php @@ -1,3 +1,40 @@ +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; +} +?>
    @@ -6,7 +43,7 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'theme/fonts', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -14,31 +51,33 @@ 'href' => 'https://doc.deltacms.fr/polices', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    - + $text[2] + ]); ?>
    -

    Paramètres de la police

    +

    $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] ]); ?>
    - 'Liaison avec un fichier de police', + $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] ]); ?>
    @@ -46,8 +85,8 @@ 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] ]); ?>
    @@ -56,8 +95,8 @@
    $this->getData(['fonts', $this->getUrl(2),'license']), - 'label' => 'License', - 'help' => 'Type de license de la police' + 'label' => $text[10], + 'help' => $text[11] ]); ?>
    diff --git a/core/module/theme/view/fonts/fonts.js.php b/core/module/theme/view/fonts/fonts.js.php index 080d465..76b4b04 100644 --- a/core/module/theme/view/fonts/fonts.js.php +++ b/core/module/theme/view/fonts/fonts.js.php @@ -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=""; + 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")); }); }); \ No newline at end of file diff --git a/core/module/theme/view/fonts/fonts.php b/core/module/theme/view/fonts/fonts.php index d8e46eb..def8792 100644 --- a/core/module/theme/view/fonts/fonts.php +++ b/core/module/theme/view/fonts/fonts.php @@ -1,10 +1,35 @@ +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; +} +?>
    'buttonGrey', 'href' => helper::baseUrl() . 'theme', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -12,7 +37,7 @@ 'href' => 'https://doc.deltacms.fr/polices', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    @@ -20,9 +45,9 @@ helper::baseUrl() . 'theme/addFonts', 'ico' => 'plus', - 'value' => 'Police' + 'value' => $text[2] ]); ?>
    - + diff --git a/core/module/theme/view/footer/footer.js.php b/core/module/theme/view/footer/footer.js.php index e6dc861..0c9d9de 100644 --- a/core/module/theme/view/footer/footer.js.php +++ b/core/module/theme/view/footer/footer.js.php @@ -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 = {}; + 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 diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index 0e2a652..e110fbd 100644 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -1,3 +1,122 @@ +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; +} +?>
    @@ -5,7 +124,7 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'theme', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -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' ]); ?>
    - + $text[2] + ]); ?>
    -

    Paramètres

    +

    - 'Position', + $text[4], 'selected' => $this->getData(['theme', 'footer', 'position']) ]); ?>
    - 'Marges verticales', + $text[5], 'selected' => $this->getData(['theme', 'footer', 'height']) ]); ?>
    @@ -45,21 +166,21 @@
    -

    Couleurs

    +

    'colorPicker', - 'label' => 'Texte', + 'label' => $text[7], 'value' => $this->getData(['theme', 'footer', 'textColor']) ]); ?>
    '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] ]); ?>
    @@ -69,75 +190,77 @@
    -

    Contenu

    +

    - $this->getData(['theme', 'footer','displayCopyright']), - 'help' => 'Affiche cette mention devant DeltaCMS' + 'help' => $text[12] ]); ?>
    - $this->getData(['theme', 'footer','displayVersion']), - 'help' => 'Affiche le numéro de version après DeltaCMS' + 'help' => $text[14] ]); ?>
    - $this->getData(['theme', 'footer', 'displaySiteMap']) ]); ?>
    - $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']) ]); ?>
    - $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] ]); ?>
    - $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] ]); ?>
    - $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] ]); ?>
    - 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ - 'label' => 'Page "Mentions légales" ' . template::flag('site', '20px'), + getInput('DELTA_I18N_SITE') === 'base') $flag = $this->getData(['config', 'i18n', 'langBase']); ?> + $text[24]] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ + 'label' => $text[25] . template::flag($flag, '20px'), 'selected' => $this->getData(['locale', 'legalPageId']) ]); ?>
    - $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] ]); ?>
    - 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ - 'label' => 'Page "Rechercher" ' . template::flag('site', '20px'), + $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] ]); ?>
    @@ -147,7 +270,7 @@
    '
    Contenu personnalisé
    ', + 'label' => '
    '.$text[45].'
    ', 'value' => $this->getData(['theme', 'footer', 'text']), 'class' => 'editorWysiwyg' ]); ?> @@ -156,31 +279,31 @@
    -

    Mise en forme du texte

    +

    'Police', + 'label' => $text[31], 'selected' => $this->getData(['theme', 'footer', 'font']), 'fonts' => true ]); ?>
    - 'Taille', - 'help' => 'Proportionnelle à celle définie dans le site.', + $text[32], + 'help' => $text[33], 'selected' => $this->getData(['theme', 'footer', 'fontSize']) ]); ?>
    - 'Style', + $text[34], 'selected' => $this->getData(['theme', 'footer', 'fontWeight']) ]); ?>
    - 'Casse', + $text[35], 'selected' => $this->getData(['theme', 'footer', 'textTransform']) ]); ?>
    @@ -191,23 +314,23 @@
    -

    Dispositions

    +

    - getData(['theme', 'footer', 'template'])) ? $module::$footerblocks[3] : $module::$footerblocks [$this->getData(['theme', 'footer', 'template'])] ;?> - 'Répartition', + getData(['theme', 'footer', 'template'])) ? $footerblocks[3] : $footerblocks [$this->getData(['theme', 'footer', 'template'])] ;?> + $text[37], 'selected' => is_null($this->getData(['theme', 'footer', 'template'])) ? 4 : $this->getData(['theme', 'footer', 'template']) ]); ?>
    -

    Contenu personnalisé

    +

    'Position', + 'label' => $text[39], 'selected' => $this->getData(['theme', 'footer', 'textPosition']), 'class' => 'themeFooterContent' ]); ?> @@ -215,19 +338,19 @@
    - 'Alignement', + $text[40], 'selected' => $this->getData(['theme', 'footer', 'textAlign']) ]); ?>
    -

    Réseaux sociaux

    +

    'Position', + 'label' => $text[39], 'selected' => $this->getData(['theme', 'footer', 'socialsPosition']), 'class' => 'themeFooterContent' ]); ?> @@ -235,19 +358,19 @@
    - 'Alignement', + $text[40], 'selected' => $this->getData(['theme', 'footer', 'socialsAlign']) ]); ?>
    -

    Informations

    +

    'Position', + 'label' => $text[39], 'selected' => $this->getData(['theme', 'footer', 'copyrightPosition']), 'class' => 'themeFooterContent' ]); ?> @@ -255,8 +378,8 @@
    - 'Alignement', + $text[40], 'selected' => $this->getData(['theme', 'footer', 'copyrightAlign']) ]); ?>
    @@ -264,14 +387,14 @@
    - $this->getData(['theme', 'footer', 'margin']) ]); ?>
    - $this->getData(['theme', 'footer', 'fixed']) ]); ?>
    diff --git a/core/module/theme/view/header/header.js.php b/core/module/theme/view/header/header.js.php index 2dfbff0..461992d 100644 --- a/core/module/theme/view/header/header.js.php +++ b/core/module/theme/view/header/header.js.php @@ -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=""; + 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)"); } }; diff --git a/core/module/theme/view/header/header.php b/core/module/theme/view/header/header.php index 35272dd..6d64ea1 100644 --- a/core/module/theme/view/header/header.php +++ b/core/module/theme/view/header/header.php @@ -1,3 +1,106 @@ +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.
    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.
    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.
    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.
    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; +} +?>
    @@ -5,7 +108,7 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'theme', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -13,57 +116,59 @@ 'href' => 'https://doc.deltacms.fr/personnalisation-de-la-banniere', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    - + $text[34] + ]); ?>
    -

    Paramètres

    +

    - 'Position', + $text[3], 'selected' => $this->getData(['theme', 'header', 'position']) ]); ?>
    - 'Nature de contenu', + $text[4], 'selected' => $this->getData(['theme', 'header', 'feature']) ]); ?>
    - 'Hauteur maximale', + $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.
    Lorsque l\'adaptation est positionnée sur Responsive, la hauteur diminue proportionnellement à la largeur.' + 'help' => $text[6] ]); ?>
    - 'Largeur', + $text[7], 'selected' => $this->getData(['theme', 'header', 'wide']) ]); ?>
    - $this->getData(['theme', 'header', 'tinyHidden']) ]); ?>
    - $this->getData(['theme', 'header', 'margin']) ]); ?>
    @@ -75,21 +180,21 @@
    -

    Couleurs

    +

    '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']) ]); ?>
    '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']) ]); ?>
    @@ -100,44 +205,44 @@
    -

    Mise en forme du titre

    +

    - $this->getData(['theme', 'header', 'textHide']) ]); ?>
    'Police', + 'label' => $text[17], 'selected' => $this->getData(['theme', 'header', 'font']), 'fonts' => true ]); ?>
    - 'Taille', - 'help' => 'Proportionnelle à celle définie dans le site.', + $text[18], + 'help' => $text[21], 'selected' => $this->getData(['theme', 'header', 'fontSize']) ]); ?>
    - 'Style', + $text[19], 'selected' => $this->getData(['theme', 'header', 'fontWeight']) ]); ?>
    - 'Casse', + $text[20], 'selected' => $this->getData(['theme', 'header', 'textTransform']) ]); ?>
    - 'Alignement du contenu', + $text[22], 'selected' => $this->getData(['theme', 'header', 'textAlign']) ]); ?>
    @@ -149,15 +254,15 @@
    -

    Papier peint

    +

    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 @@
    - 'Répétition', + $text[26], 'selected' => $this->getData(['theme', 'header', 'imageRepeat']) ]); ?>
    - 'Adaptation', + $text[27], 'selected' => $this->getData(['theme', 'header', 'imageContainer']), - 'help' => 'Les modes responsives permettent de conserver des dimensions proportionnelles.
    - 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] ]); ?>
    - 'Position', + $text[3], 'selected' => $this->getData(['theme', 'header', 'imagePosition']) ]); ?>
    - $this->getData(['theme', 'header', 'linkHomePage']) ]); ?>
    @@ -195,7 +298,7 @@
    - Largeur : | Hauteur : | ratio : +
    @@ -208,7 +311,7 @@
    '
    Contenu personnalisé
    ', + 'label' => '
    '.$text[33].'
    ', 'class' => 'editorWysiwyg', 'value' => $this->getData(['theme', 'header', 'featureContent']) ]); ?> diff --git a/core/module/theme/view/index/index.php b/core/module/theme/view/index/index.php index 8926cc4..145494d 100644 --- a/core/module/theme/view/index/index.php +++ b/core/module/theme/view/index/index.php @@ -1,16 +1,45 @@ +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; +} +?> getData(['theme', 'header', 'position']) === 'hide' OR $this->getData(['theme', 'menu', 'position']) === 'hide' OR $this->getData(['theme', 'footer', 'position']) === 'hide' ): ?> - +
    'buttonGrey', 'href' => helper::baseUrl(false), 'ico' => 'home', - 'value' => 'Accueil' + 'value' => $text[1] ]); ?>
    @@ -18,14 +47,14 @@ 'href' => 'https://doc.deltacms.fr/theme-2', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[2], 'class' => 'buttonHelp' ]); ?>
    'eye', - 'value' => 'Zones cachées' + 'value' => $text[3] ]); ?>
    @@ -34,14 +63,14 @@ 'cogs', 'href' => helper::baseUrl() . $this->getUrl(0) . '/manage', - 'value' => 'Gestion' + 'value' => $text[4] ]); ?>
    'brush', 'href' => helper::baseUrl() . $this->getUrl(0) . '/admin', - 'value' => 'Administration' + 'value' => $text[5] ]); ?>
    @@ -49,7 +78,7 @@ 'code', 'href' => helper::baseUrl() . $this->getUrl(0) . '/advanced', - 'value' => 'Éditeur CSS' + 'value' => $text[6] ]); ?>
    @@ -58,19 +87,19 @@ 'pencil', 'href' => helper::baseUrl() . $this->getUrl(0) . '/fonts', - 'value' => 'Polices' + 'value' => $text[7] ]); ?>
    - +
    'buttonGrey', 'href' => helper::baseUrl(false), 'ico' => 'home', - 'value' => 'Accueil' + 'value' => $text[1] ]); ?>
    @@ -78,7 +107,7 @@ 'href' => 'https://doc.deltacms.fr/theme-2', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[2], 'class' => 'buttonHelp' ]); ?>
    @@ -88,14 +117,14 @@ 'cogs', 'href' => helper::baseUrl() . $this->getUrl(0) . '/manage', - 'value' => 'Gestion' + 'value' => $text[4] ]); ?>
    'brush', 'href' => helper::baseUrl() . $this->getUrl(0) . '/admin', - 'value' => 'Administration' + 'value' => $text[5] ]); ?>
    @@ -103,7 +132,7 @@ 'code', 'href' => helper::baseUrl() . $this->getUrl(0) . '/advanced', - 'value' => 'Éditeur CSS' + 'value' => $text[6] ]); ?>
    @@ -112,7 +141,7 @@ 'pencil', 'href' => helper::baseUrl() . $this->getUrl(0) . '/fonts', - 'value' => 'Polices' + 'value' => $text[7] ]); ?>
    diff --git a/core/module/theme/view/manage/manage.js.php b/core/module/theme/view/manage/manage.js.php index 4fcacc5..c985c3a 100644 --- a/core/module/theme/view/manage/manage.js.php +++ b/core/module/theme/view/manage/manage.js.php @@ -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=""; + 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")); }); }); \ No newline at end of file diff --git a/core/module/theme/view/manage/manage.php b/core/module/theme/view/manage/manage.php index 4e01eb3..558bc15 100644 --- a/core/module/theme/view/manage/manage.php +++ b/core/module/theme/view/manage/manage.php @@ -1,3 +1,42 @@ +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; +} +?>
    @@ -5,7 +44,7 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'theme', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -13,7 +52,7 @@ 'href' => 'https://doc.deltacms.fr/gestion', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    @@ -21,24 +60,24 @@ 'buttonRed', 'href' => helper::baseUrl() . 'theme/reset/manage' . '&csrf=' . $_SESSION['csrf'], - 'value' => 'Réinitialiser', + 'value' => $text[2], 'ico' => 'cancel' ]); ?>
    'Appliquer' + 'value' => $text[3] ]); ?>
    -

    Installer un thème archivé (site ou administration)

    +

    'Archive ZIP :', + 'label' => $text[5], 'type' => 2 ]); ?>
    @@ -49,20 +88,20 @@
    -

    Sauvegarde du thème dans les fichiers du site

    +

    helper::baseUrl() . 'theme/save/theme', 'ico' => 'download-cloud', - 'value' => 'Thème du site' + 'value' => $text[9] ]); ?>
    helper::baseUrl() . 'theme/save/admin', 'ico' => 'download-cloud', - 'value' => 'Thème de l\'administration' + 'value' => $text[10] ]); ?>
    @@ -71,20 +110,20 @@
    -

    Télécharger le thème

    +

    helper::baseUrl() . 'theme/export/theme', 'ico' => 'download', - 'value' => 'Thème du site' + 'value' => $text[12] ]); ?>
    helper::baseUrl() . 'theme/export/admin', 'ico' => 'download', - 'value' => 'Thème de l\'administration' + 'value' => $text[13] ]); ?>
    diff --git a/core/module/theme/view/menu/menu.php b/core/module/theme/view/menu/menu.php index 96c8d42..0bf6aea 100644 --- a/core/module/theme/view/menu/menu.php +++ b/core/module/theme/view/menu/menu.php @@ -1,3 +1,108 @@ +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.
    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.
    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; +} +?>
    @@ -5,7 +110,7 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'theme', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -13,68 +118,70 @@ 'href' => 'https://doc.deltacms.fr/personnalisation-du-menu', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    - + $text[2] + ]); ?>
    -

    Paramètres

    +

    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']) ]); } ?>
    - 'Largeur', + $text[5], 'selected' => $this->getData(['theme', 'menu', 'wide']) ]); ?>
    - 'Bords arrondis', + $text[6], 'selected' => $this->getData(['theme', 'menu', 'radius']), - 'help' => 'Autour de la page sélectionnée' + 'help' => $text[7] ]); ?>
    - 'Hauteur', + $text[8], 'selected' => $this->getData(['theme', 'menu', 'height']) ]); ?>
    - 'Alignement du contenu', + $text[9], 'selected' => $this->getData(['theme', 'menu', 'textAlign']) ]); ?>
    - $this->getData(['theme', 'menu', 'margin']) ]); ?>
    - $this->getData(['theme', 'menu', 'fixed']) ]); ?>
    @@ -84,24 +191,24 @@
    -

    Contenus

    +

    - $this->getData(['theme', 'menu', 'loginLink']) ]); ?>
    - $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] ]); ?>
    - 'Affichage dans le menu burger', + $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] ]); ?>
    @@ -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 @@
    -

    Couleurs

    +

    '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']) ]); ?>
    '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']) ]); ?>
    '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']) ]); ?>
    @@ -155,23 +262,23 @@
    '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']) ]); ?>
    $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] ]); ?>
    'colorPicker', - 'help' => 'Couleur de fond de la page sélectionnée dans le menu.
    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']) ]); ?>
    @@ -182,33 +289,33 @@
    -

    Mise en forme du texte

    +

    'Police', + 'label' => $text[31], 'selected' => $this->getData(['theme', 'menu', 'font']), 'fonts' => true ]); ?>
    - 'Taille', - 'help' => 'Proportionnelle à celle définie dans le site', + $text[32], + 'help' => $text[33], 'selected' => $this->getData(['theme', 'menu', 'fontSize']) ]); ?>
    - 'Style', + $text[34], 'selected' => $this->getData(['theme', 'menu', 'fontWeight']) ]); ?>
    - 'Casse', + $text[35], 'selected' => $this->getData(['theme', 'menu', 'textTransform']) ]); ?>
    diff --git a/core/module/theme/view/site/site.php b/core/module/theme/view/site/site.php index 659dd61..c2a5e93 100644 --- a/core/module/theme/view/site/site.php +++ b/core/module/theme/view/site/site.php @@ -1,3 +1,90 @@ +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.
    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; +} +?>
    @@ -5,7 +92,7 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'theme', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -13,41 +100,43 @@ 'href' => 'https://doc.deltacms.fr/personnalisation-du-site', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    - + $text[2] + ]); ?>
    -

    Paramètres

    +

    - 'Largeur du site', + $text[4], 'selected' => $this->getData(['theme', 'site', 'width']) ]); ?>
    - 'Arrondi des angles', + $text[5], 'selected' => $this->getData(['theme', 'site', 'radius']) ]); ?>
    - 'Ombre sur les bords du site', + $text[6], 'selected' => $this->getData(['theme', 'site', 'shadow']) ]); ?>
    - $this->getData(['theme', 'site', 'margin']) ]); ?>
    @@ -58,23 +147,23 @@
    -

    Couleurs

    +

    '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']) ]); ?>
    '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']) ]); ?>
    @@ -83,16 +172,16 @@
    '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']) ]); ?>
    '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']) ]); ?>
    @@ -101,16 +190,16 @@
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    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']) ]); ?>
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    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']) ]); ?>
    @@ -118,14 +207,14 @@
    - 'Arrondi des angles du bloc', + $text[17], 'selected' => $this->getData(['theme', 'block', 'blockBorderRadius']) ]); ?>
    - 'Ombre sur les bords du bloc', + $text[18], 'selected' => $this->getData(['theme', 'block', 'blockBorderShadow']) ]); ?>
    @@ -134,16 +223,16 @@
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    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']) ]); ?>
    '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']) ]); ?>
    @@ -154,20 +243,20 @@
    -

    Titre

    -

    Sous-titre

    +

    +

    'buttonSubmitPreview', - 'value' => 'Bouton' + 'value' => $text[23] ]); ?>
    -

    Bloc

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Lorem ipsum dolor sit amet.

    @@ -181,19 +270,19 @@
    -

    Mise en forme du texte

    +

    'Police', + 'label' => $text[26], 'selected' => $this->getData(['theme', 'text', 'font']), 'fonts' => true ]); ?>
    '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']) ]); ?>
    @@ -202,24 +291,24 @@
    -

    Mise en forme des titres

    +

    'Police', + 'label' => $text[26], 'selected' => $this->getData(['theme', 'title', 'font']), 'fonts' => true ]); ?>
    - 'Style', + $text[27], 'selected' => $this->getData(['theme', 'title', 'fontWeight']) ]); ?>
    - 'Casse', + $text[28], 'selected' => $this->getData(['theme', 'title', 'textTransform']) ]); ?>
    diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index 1da3afd..8a9b47b 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -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 diff --git a/core/module/translate/view/copy/copy.php b/core/module/translate/view/copy/copy.php index 4e4ae30..c267fbe 100644 --- a/core/module/translate/view/copy/copy.php +++ b/core/module/translate/view/copy/copy.php @@ -1,11 +1,33 @@ - +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; +} +?>
    'buttonGrey', 'href' => helper::baseUrl() . 'translate', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -13,27 +35,29 @@ 'href' => 'https://doc.deltacms.fr/utilitaire-de-copie', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    - + $text[2] + ]); ?>
    -

    Copie de site (traductions rédigées)

    +

    'Pages et les modules de' + 'label' => $text[4] ]); ?>
    'Vers' + 'label' => $text[5] ]); ?>
    diff --git a/core/module/translate/view/index/index.php b/core/module/translate/view/index/index.php index f477d10..cf5d746 100644 --- a/core/module/translate/view/index/index.php +++ b/core/module/translate/view/index/index.php @@ -1,11 +1,53 @@ - +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; +} +?>
    'buttonGrey', 'href' => helper::baseUrl(), 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -13,47 +55,71 @@ 'href' => 'https://doc.deltacms.fr/gestion-des-langues', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    - helper::baseUrl() . 'translate/copy', - 'value' => 'Utilitaire de copie', - 'ico' => 'cog-alt', - 'disabled' => $module::$siteTranslate - ]); ?> + helper::baseUrl() . 'translate/copy', + 'value' => $text[2], + 'ico' => 'cog-alt', + 'disabled' => $module::$siteTranslate + ]); ?>
    - + $text[3] + ]); ?>
    -

    Traduction automatique

    +

    - 'Français (fr)','en'=>'English (en)'], [ + 'label' => $text[4], + 'selected' => $this->getData(['config', 'i18n' , 'langAdmin']) + ]); ?> +
    +
    + $text[5], + 'selected' => $this->getData(['config', 'i18n' , 'langBase']) + ]); ?> +
    +
    + +
    +
    +
    +
    +
    +
    +

    +
    +
    + $this->getData(['config','i18n', 'scriptGoogle']), - 'help' => 'Le script Google Translate assure la traduction automatique du site.' + 'help' => $text[9] ]); ?>
    - $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] ]); ?>
    - $this->getData(['config','i18n', 'showCredits']), 'class' => 'translateGoogleScriptOption', - 'help' => 'Option recommandée pour le respect du droit d\'auteur' + 'help' => $text[13] ]); ?>
    @@ -63,61 +129,58 @@
    -

    Mode de traduction et affichage des drapeaux

    +

    - 'Drapeau masqué','site'=>'Drapeau affiché'], [ - 'label' => template::flag('', '30px'), + template::flag('fr', '30px'), + 'class' => 'translateFlagSelect', 'selected' => $this->getData(['config', 'i18n' , 'fr']), ]); ?>
    -
    template::flag('de', '30px'), 'class' => 'translateFlagSelect', 'selected' => $this->getData(['config', 'i18n' , 'de']) ]); ?> -
    -
    - template::flag('en', '30px'), - 'class' => 'translateFlagSelect', - 'selected' => $this->getData(['config', 'i18n' , 'en']) - ]); ?> -
    +
    +
    + template::flag('en', '30px'), + 'class' => 'translateFlagSelect', + 'selected' => $this->getData(['config', 'i18n' , 'en']) + ]); ?>
    -
    template::flag('es', '30px'), 'class' => 'translateFlagSelect', 'selected' => $this->getData(['config', 'i18n' , 'es']) ]); ?> -
    -
    - template::flag('it', '30px'), - 'class' => 'translateFlagSelect', - 'selected' => $this->getData(['config', 'i18n' , 'it']) - ]); ?> -
    +
    +
    +
    +
    + template::flag('it', '30px'), + 'class' => 'translateFlagSelect', + 'selected' => $this->getData(['config', 'i18n' , 'it']) + ]); ?>
    -
    template::flag('nl', '30px'), 'class' => 'translateFlagSelect', 'selected' => $this->getData(['config', 'i18n' , 'nl']) ]); ?> -
    -
    +
    +
    template::flag('pt', '30px'), 'class' => 'translateFlagSelect', 'selected' => $this->getData(['config', 'i18n' , 'pt']) ]); ?> -
    diff --git a/core/module/user/user.php b/core/module/user/user.php index 2b225fe..65abe2c 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -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 ' . $userFirstname . ' ' . $userLastname . ',

    ' . - 'Un administrateur vous a créé un compte sur le site ' . $this->getData(['locale', 'title']) . '. Vous trouverez ci-dessous les détails de votre compte.

    ' . - 'Identifiant du compte : ' . $this->getInput('userAddId') . '
    ' . - '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[2] . $this->getData(['locale', 'title']), + $text[3].'' . $userFirstname . ' ' . $userLastname . ',

    ' . + $text[4] . $this->getData(['locale', 'title']) . $text[5].'

    ' . + ''.$text[6].' ' . $this->getInput('userAddId') . '
    ' . + ''.$text[7].'', 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 ' . $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']) . ',

    ' . - 'Vous avez demandé à changer le mot de passe lié à votre compte. Vous trouverez ci-dessous un lien vous permettant de modifier celui-ci.

    ' . + $text[0], + $text[1] .'' . $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']) . ',

    ' . + $text[2].'

    ' . '' . helper::baseUrl() . 'user/reset/' . $userId . '/' . $uniqId . '

    ' . - 'Si nous n\'avez pas demandé à réinitialiser votre mot de passe, veuillez ignorer ce mail.', + $text[3].'', 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 ' . $item['prenom'] . ' ' . $item['nom'] . ',

    ' . - 'Un administrateur vous a créé un compte sur le site ' . $this->getData(['locale', 'title']) . '. Vous trouverez ci-dessous les détails de votre compte.

    ' . - 'Identifiant du compte : ' . $userId . '
    ' . - 'Un mot de passe provisoire vous été attribué, à la première connexion cliquez sur Mot de passe Oublié.' + $text[0] . $this->getData(['locale', 'title']), + $text[0].' ' . $item['prenom'] . ' ' . $item['nom'] . ',

    ' . + $text[2]. $this->getData(['locale', 'title']) . $text[3].'

    ' . + ''.$text[4].' ' . $userId . '
    ' . + ''.$text[5].'' ); 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 diff --git a/core/module/user/view/add/add.php b/core/module/user/view/add/add.php index ca4fcc9..a9525a7 100644 --- a/core/module/user/view/add/add.php +++ b/core/module/user/view/add/add.php @@ -1,11 +1,85 @@ - +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; +} +?>
    'buttonGrey', 'href' => helper::baseUrl() . 'user', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -13,99 +87,101 @@ 'href' => 'https://doc.deltacms.fr/nouvel-utilisateur', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    - + $text[29] + ]); ?>
    -

    Informations générales

    +

    'off', - 'label' => 'Prénom' + 'label' => $text[2] ]); ?>
    'off', - 'label' => 'Nom' + 'label' => $text[3] ]); ?>
    'off', - 'label' => 'Pseudo' + 'label' => $text[4] ]); ?> - 'Signature', + $text[5], 'selected' => 1 ]); ?> 'off', - 'label' => 'Adresse mail' + 'label' => $text[6] ]); ?> - 'Groupe', + $text[7], 'selected' => self::GROUP_MEMBER ]); ?>
    - 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] ]); ?>
    - Autorisations : +
      -
    • Accès aux pages privées membres
    • +
      -
    • Accès aux pages privées membres et éditeurs
    • -
    • Ajout / Édition / Suppression de pages
    • -
    • Ajout / Édition / Suppression de fichiers
    • +
    • +
    • +
      -
    • Accès à toutes les pages privées
    • -
    • Ajout / Édition / Suppression de pages
    • -
    • Ajout / Édition / Suppression de fichiers
    • -
    • Ajout / Édition / Suppression de dossiers
    • -
    • Ajout / Édition / Suppression d'utilisateurs
    • -
    • Configuration du site
    • -
    • Personnalisation du thème
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    -

    Authentification

    +

    'off', - 'label' => 'Identifiant' + 'label' => $text[22] ]); ?> 'off', - 'label' => 'Mot de passe' + 'label' => $text[23] ]); ?> 'off', - 'label' => 'Confirmation' + 'label' => $text[24] ]); ?>
    -

    Redirection

    +

    '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] ]); ?>
    diff --git a/core/module/user/view/edit/edit.php b/core/module/user/view/edit/edit.php index 62ba01e..73d4a84 100644 --- a/core/module/user/view/edit/edit.php +++ b/core/module/user/view/edit/edit.php @@ -1,4 +1,84 @@ - +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; +} +?>
    getUser('group') === self::GROUP_ADMIN): ?> @@ -6,31 +86,33 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'user', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?> 'buttonGrey', 'href' => helper::baseUrl(false), 'ico' => 'home', - 'value' => 'Accueil' + 'value' => $text[0] ]); ?>
    - + $text[29] + ]); ?>
    -

    Informations générales

    +

    'off', 'disabled' => $this->getUser('group') > 2 ? false : true, - 'label' => 'Prénom', + 'label' => $text[2], 'value' => $this->getData(['user', $this->getUrl(2), 'firstname']) ]); ?>
    @@ -38,88 +120,88 @@ 'off', 'disabled' => $this->getUser('group') > 2 ? false : true, - 'label' => 'Nom', + 'label' => $text[3], 'value' => $this->getData(['user', $this->getUrl(2), 'lastname']) ]); ?>
    'off', - 'label' => 'Pseudo', + 'label' => $text[4], 'value' => $this->getData(['user', $this->getUrl(2), 'pseudo']) ]); ?> - 'Signature', + $text[5], 'selected' => $this->getData(['user', $this->getUrl(2), 'signature']) ]); ?> 'off', - 'label' => 'Adresse mail', + 'label' => $text[6], 'value' => $this->getData(['user', $this->getUrl(2), 'mail']) ]); ?> getUser('group') === self::GROUP_ADMIN): ?> - ($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']) ]); ?>
    - $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] ]); ?>
    -
    Autorisations :
    +
      -
    • Accès aux pages privées membres
    • +
      -
    • Accès aux pages privées membres et éditeurs
    • -
    • Ajout / Édition / Suppression de pages
    • -
    • Ajout / Édition / Suppression de fichiers
    • +
    • +
    • +
      -
    • Accès à toutes les pages privées
    • -
    • Ajout / Édition / Suppression de pages
    • -
    • Ajout / Édition / Suppression de fichiers
    • -
    • Ajout / Édition / Suppression de dossiers
    • -
    • Ajout / Édition / Suppression d'utilisateurs
    • -
    • Configuration du site
    • -
    • Personnalisation du thème
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    -

    Authentification

    +

    '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) ]); ?> 'new-password', // remplace 'off' pour éviter le pré remplissage auto - 'label' => 'Ancien mot de passe' + 'label' => $text[23] ]); ?> 'off', - 'label' => 'Nouveau mot de passe' + 'label' => $text[32] ]); ?> 'off', - 'label' => 'Confirmation' + 'label' => $text[24] ]); ?>
    -

    Redirection

    +

    '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] ]); ?>
    diff --git a/core/module/user/view/forgot/forgot.php b/core/module/user/view/forgot/forgot.php index 29dc17e..7a88a7f 100644 --- a/core/module/user/view/forgot/forgot.php +++ b/core/module/user/view/forgot/forgot.php @@ -1,18 +1,34 @@ - +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; +} +?> 'Identifiant' + 'label' => $text[0] ]); ?>
    helper::baseUrl() . 'user/login/' . $this->getUrl(2), 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[1] ]); ?>
    'Valider' + 'value' => $text[2] ]); ?>
    diff --git a/core/module/user/view/import/import.php b/core/module/user/view/import/import.php index 608af52..cf8e139 100644 --- a/core/module/user/view/import/import.php +++ b/core/module/user/view/import/import.php @@ -1,11 +1,54 @@ - +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; +} + +?>
    'buttonGrey', 'href' => helper::baseUrl() . 'user', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -13,35 +56,35 @@ 'href' => 'https://doc.deltacms.fr/importation', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    'Importer' + 'value' => $text[2] ]); ?>
    -

    Importation de fichier plat CSV

    +

    'Liste d\'utilisateurs :' + 'label' => $text[4] ]); ?>
    'Séparateur' + 'label' => $text[5] ]); ?>
    - false ]); ?>
    @@ -53,8 +96,8 @@
    - - Compte créé | Compte créé et notifié | Erreur dans le fichier, compte non créé. + +
    diff --git a/core/module/user/view/index/index.js.php b/core/module/user/view/index/index.js.php index d10cc87..cc62625 100644 --- a/core/module/user/view/index/index.js.php +++ b/core/module/user/view/index/index.js.php @@ -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 = ""; + 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")); }); }); \ No newline at end of file diff --git a/core/module/user/view/index/index.php b/core/module/user/view/index/index.php index 19137b5..0d58328 100644 --- a/core/module/user/view/index/index.php +++ b/core/module/user/view/index/index.php @@ -1,10 +1,35 @@ +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; +} +?>
    'buttonGrey', 'href' => helper::baseUrl(false), 'ico' => 'home', - 'value' => 'Accueil' + 'value' => $text[0] ]); ?>
    @@ -12,7 +37,7 @@ 'href' => 'https://doc.deltacms.fr/liste-des-utilisateurs', 'target' => '_blank', 'ico' => 'help', - 'value' => 'Aide', + 'value' => $text[1], 'class' => 'buttonHelp' ]); ?>
    @@ -20,15 +45,15 @@ helper::baseUrl() . 'user/import', 'ico' => 'plus', - 'value' => 'Importation' + 'value' => $text[2] ]); ?>
    helper::baseUrl() . 'user/add', 'ico' => 'plus', - 'value' => 'Utilisateur' + 'value' => $text[3] ]); ?>
    - \ No newline at end of file + \ No newline at end of file diff --git a/core/module/user/view/login/login.php b/core/module/user/view/login/login.php index c0e0732..88e1480 100644 --- a/core/module/user/view/login/login.php +++ b/core/module/user/view/login/login.php @@ -1,14 +1,45 @@ - +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; +} + +?>
    'Identifiant', + 'label' => $text[0], 'value' => $module::$userId ]); ?>
    'Mot de passe' + 'label' => $text[1] ]); ?>
    @@ -24,12 +55,12 @@
    - $module::$userLongtime ]); ?>
    @@ -37,12 +68,12 @@ helper::baseUrl() . str_replace('_', '/', str_replace('__', '#', $this->getUrl(2))), 'ico' => 'left', - 'value' => 'Annuler' + 'value' => $text[2] ]); ?>
    'Connexion', + 'value' => $text[3], 'ico' => 'lock' ]); ?>
    diff --git a/core/module/user/view/reset/reset.php b/core/module/user/view/reset/reset.php index 61aa3ca..1d494ae 100644 --- a/core/module/user/view/reset/reset.php +++ b/core/module/user/view/reset/reset.php @@ -1,20 +1,36 @@ - +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; +} +?>
    'Nouveau mot de passe' + 'label' => $text[0] ]); ?>
    'Confirmation' + 'label' => $text[1] ]); ?>
    'Valider' + 'value' => $text[2] ]); ?>
    diff --git a/core/vendor/filemanager/lang/fr_FR.php b/core/vendor/filemanager/lang/fr_FR.php index ce5870a..292cac8 100644 --- a/core/vendor/filemanager/lang/fr_FR.php +++ b/core/vendor/filemanager/lang/fr_FR.php @@ -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 ?', diff --git a/core/vendor/tinymce/init.js b/core/vendor/tinymce/init.js index 569fd65..9046007 100644 --- a/core/vendor/tinymce/init.js +++ b/core/vendor/tinymce/init.js @@ -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 diff --git a/core/vendor/tinymce/langs/en_GB.js b/core/vendor/tinymce/langs/en_GB.js new file mode 100644 index 0000000..312698a --- /dev/null +++ b/core/vendor/tinymce/langs/en_GB.js @@ -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" +}); \ No newline at end of file diff --git a/core/vendor/tinymce/plugins/codemirror/langs/en_GB.js b/core/vendor/tinymce/plugins/codemirror/langs/en_GB.js new file mode 100644 index 0000000..312698a --- /dev/null +++ b/core/vendor/tinymce/plugins/codemirror/langs/en_GB.js @@ -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" +}); \ No newline at end of file diff --git a/core/vendor/zwiico/css/zwiico-codes.css b/core/vendor/zwiico/css/zwiico-codes.css index eda6869..d4981d7 100644 --- a/core/vendor/zwiico/css/zwiico-codes.css +++ b/core/vendor/zwiico/css/zwiico-codes.css @@ -53,4 +53,4 @@ .zwiico-youtube:before { content: '\f167'; } /* '' */ .zwiico-instagram:before { content: '\f16d'; } /* '' */ .zwiico-brush:before { content: '\f1fc'; } /* '' */ -.zwiico-pinterest:before { content: '\f231'; } /* '' */ \ No newline at end of file +.zwiico-pinterest:before { content: '\f231'; } /* '' */ diff --git a/core/vendor/zwiico/css/zwiico-embedded.css b/core/vendor/zwiico/css/zwiico-embedded.css index ad17bb2..10ce7e5 100644 --- a/core/vendor/zwiico/css/zwiico-embedded.css +++ b/core/vendor/zwiico/css/zwiico-embedded.css @@ -110,4 +110,5 @@ .zwiico-youtube:before { content: '\f167'; } /* '' */ .zwiico-instagram:before { content: '\f16d'; } /* '' */ .zwiico-brush:before { content: '\f1fc'; } /* '' */ -.zwiico-pinterest:before { content: '\f231'; } /* '' */ \ No newline at end of file +.zwiico-pinterest:before { content: '\f231'; } /* '' */ + diff --git a/module/agenda/view/index/index.js.php b/module/agenda/view/index/index.js.php index 00f32a8..e1744d6 100644 --- a/module/agenda/view/index/index.js.php +++ b/module/agenda/view/index/index.js.php @@ -35,7 +35,7 @@ } }, plugins: [ 'dayGrid', 'interaction' ], - locale : 'fr', + locale : 'getData(['config', 'i18n', 'langBase']) ;?>', defaultView: 'getData(['module', $this->getUrl(0), 'vue', 'vueagenda']) ;?>', defaultDate: 'getData(['module', $this->getUrl(0), 'vue', 'debagenda']) ;?>', selectable: true, diff --git a/module/form/form.php b/module/form/form.php index 9770c26..30d589f 100644 --- a/module/form/form.php +++ b/module/form/form.php @@ -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
    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
    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']) . '" :

    ' . + $text[2] . $this->getData(['page', $this->getUrl(0), 'title']) . '" :

    ' . $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' => [ diff --git a/module/form/view/config/config.php b/module/form/view/config/config.php index 6631a20..d676118 100644 --- a/module/form/view/config/config.php +++ b/module/form/view/config/config.php @@ -1,3 +1,80 @@ +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
    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
    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; +} +?>
    'Intitulé' + 'placeholder' => $text[0] ]); ?>
    - 'formConfigType' ]); ?>
    @@ -34,17 +111,17 @@
    - 'displayNone formConfigLabelWrapper' ]); ?>
    'Liste des valeurs séparées par des virgules (valeur1,valeur2,...)', + 'placeholder' => $text[2], 'class' => 'formConfigValues', 'classWrapper' => 'displayNone formConfigValuesWrapper' ]); ?> - +
    @@ -55,40 +132,42 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[4] ]); ?>
    helper::baseUrl() . $this->getUrl(0) . '/data', - 'value' => 'Gérer les données' + 'value' => $text[5] ]); ?>
    - + $text[30] + ]); ?>
    -

    Configuration

    +

    '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']) ]); ?> - (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] ]); ?>
    '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']) ]); ?>
    @@ -100,77 +179,77 @@
    'Aux groupes à partir de', + 'label' => $text[13], 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'group']), - 'help' => 'Editeurs = éditeurs + administrateurs
    Membres = membres + éditeurs + administrateurs' + 'help' => $text[14] ]); ?>
    'A un membre', + 'label' => $text[15], 'selected' => array_search($this->getData(['module', $this->getUrl(0), 'config', 'user']),$module::$listUsers) ]); ?>
    '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] ]); ?>
    - (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] ]); ?>
    - 'Sélectionner le type de signature', + $text[20], 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'signature']) ]); ?>
    'Sélectionnez le logo du site', - 'label' => 'Logo', + 'help' => $text[21], + 'label' => $text[22], 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'logoUrl']) ]); ?>
    'Sélectionner la largeur du logo', + 'label' => $text[23], 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'logoWidth']) ]); ?>
    - (bool) $this->getData(['module', $this->getUrl(0), 'config', 'pageId']) ]); ?>
    'displayNone', - 'label' => 'Sélectionner une page du site :', + 'label' => $text[25], 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageId']) ]); ?>
    - $this->getData(['module', $this->getUrl(0), 'config', 'captcha']) ]); ?>
    -

    Liste des champs

    +

    - +
    @@ -184,6 +263,6 @@
    -
    Version n° +
    diff --git a/module/form/view/data/data.js.php b/module/form/view/data/data.js.php index 15edac9..8ee5dfd 100644 --- a/module/form/view/data/data.js.php +++ b/module/form/view/data/data.js.php @@ -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=""; + 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=""; + 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")); }); }); \ No newline at end of file diff --git a/module/form/view/data/data.php b/module/form/view/data/data.php index d0a2286..e71120c 100644 --- a/module/form/view/data/data.php +++ b/module/form/view/data/data.php @@ -1,10 +1,33 @@ +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; +} +?>
    'buttonGrey', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    @@ -12,23 +35,23 @@ 'class' => 'formDataDeleteAll buttonRed', 'href' => helper::baseUrl() . $this->getUrl(0) . '/deleteall' . '/' . $_SESSION['csrf'], 'ico' => 'cancel', - 'value' => 'Tout effacer' + 'value' => $text[1] ]); ?>
    helper::baseUrl() . $this->getUrl(0) . '/export2csv' . '/' . $_SESSION['csrf'], 'ico' => 'download', - 'value' => 'Export CSV' + 'value' => $text[2] ]); ?>
    - + - + -
    Version n° +
    \ No newline at end of file diff --git a/module/form/view/index/index.php b/module/form/view/index/index.php index 6eba5cc..1538ee0 100644 --- a/module/form/view/index/index.php +++ b/module/form/view/index/index.php @@ -1,3 +1,18 @@ +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; +} +?> getData(['module', $this->getUrl(0), 'input'])): ?> getData(['module', $this->getUrl(0), 'input']) as $index => $input): ?> @@ -56,12 +71,12 @@
    $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' => '' ]); ?>
    - + \ No newline at end of file diff --git a/module/gallery/view/index/index.css b/module/gallery/view/index/index.css new file mode 100644 index 0000000..a9da410 --- /dev/null +++ b/module/gallery/view/index/index.css @@ -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; + } + } \ No newline at end of file diff --git a/module/news/news.php b/module/news/news.php index da50433..fe16824 100644 --- a/module/news/news.php +++ b/module/news/news.php @@ -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'; + ?> + + 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'; + ?> + + 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' ]); } diff --git a/module/news/view/add/add.php b/module/news/view/add/add.php index b4427b9..dce4285 100644 --- a/module/news/view/add/add.php +++ b/module/news/view/add/add.php @@ -1,3 +1,36 @@ +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; +} +?>
    @@ -5,13 +38,13 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    true, - 'value' => 'Enregistrer en brouillon' + 'value' => $text[1] ]); ?> true @@ -19,7 +52,7 @@
    'Publier', + 'value' => $text[2], 'uniqueSubmission' => true ]); ?>
    @@ -27,9 +60,9 @@
    -

    Informations générales

    +

    'Titre' + 'label' => $text[3] ]); ?>
    @@ -40,25 +73,25 @@
    -

    Options de publication

    +

    'Auteur', + 'label' => $text[4], 'selected' => $this->getUser('id') ]); ?>
    '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() ]); ?>
    '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']) ]); ?>
    diff --git a/module/news/view/config/config.js.php b/module/news/view/config/config.js.php index ccb9ad1..166bc7f 100644 --- a/module/news/view/config/config.js.php +++ b/module/news/view/config/config.js.php @@ -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=""; + 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")); }); }); \ No newline at end of file diff --git a/module/news/view/config/config.php b/module/news/view/config/config.php index 873c9a6..1e33356 100644 --- a/module/news/view/config/config.php +++ b/module/news/view/config/config.php @@ -1,3 +1,66 @@ +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.
    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; +} +?>
    @@ -5,54 +68,56 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),'posts', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    helper::baseUrl() . $this->getUrl(0) . '/add', 'ico' => 'plus', - 'value' => 'News' + 'value' => $text[1] ]); ?>
    - + $text[2] + ]); ?>
    -

    Paramètres du module

    +

    - $this->getData(['module', $this->getUrl(0), 'config', 'feeds']), - 'help' => 'Flux limité aux articles de la première page.' + 'help' => $text[5] ]); ?>
    'Etiquette RSS', + 'label' => $text[6], 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) ]); ?>
    - 'Nombre de colonnes', + $text[7], 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']) ]); ?>
    'Articles par page', + 'label' => $text[8], 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']) ]); ?>
    - 'Abrégé de l\'article', + $text[9], 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'height']) ]); ?>
    @@ -63,33 +128,33 @@
    -

    Thème du module

    +

    - 'Bordure', + $text[11], 'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderStyle']) ]); ?>
    - 'Epaisseur', + $text[12], 'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderWidth']) ]); ?>
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    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']) ]); ?>
    'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
    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']) ]); ?>
    @@ -98,12 +163,12 @@
    - + - + -
    Version n° +
    \ No newline at end of file diff --git a/module/news/view/edit/edit.php b/module/news/view/edit/edit.php index 927be92..1750adc 100644 --- a/module/news/view/edit/edit.php +++ b/module/news/view/edit/edit.php @@ -1,3 +1,36 @@ +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; +} +?>
    @@ -5,13 +38,13 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    true, - 'value' => 'Enregistrer en brouillon' + 'value' => $text[1] ]); ?> true @@ -19,7 +52,7 @@
    'Publier', + 'value' => $text[2], 'uniqueSubmission' => true ]); ?>
    @@ -27,9 +60,9 @@
    -

    Informations générales

    +

    'Titre', + 'label' => $text[4], 'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'title']) ]); ?>
    @@ -42,25 +75,25 @@
    -

    Options de publication

    +

    'Auteur', + 'label' => $text[6], 'selected' => $this->getUser('id') ]); ?>
    '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']) ]); ?>
    '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']) ]); ?>
    diff --git a/module/news/view/index/index.php b/module/news/view/index/index.php index f1ff225..a4e2123 100644 --- a/module/news/view/index/index.php +++ b/module/news/view/index/index.php @@ -1,3 +1,20 @@ +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; +} +?>
    $news): ?> @@ -10,7 +27,7 @@ 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'])):?> - getUrl(0) . '/' . $newsId . '">lire la suite'; ?> + getUrl(0) . '/' . $newsId . '">'.$text[0].''; ?>
    @@ -28,7 +45,7 @@ ) ): ?> - Editer +
    @@ -49,5 +66,5 @@
    - + diff --git a/module/redirection/redirection.php b/module/redirection/redirection.php index ab9a87d..1099573 100644 --- a/module/redirection/redirection.php +++ b/module/redirection/redirection.php @@ -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' ]); } diff --git a/module/redirection/view/config/config.php b/module/redirection/view/config/config.php index ff421b3..7a6104b 100644 --- a/module/redirection/view/config/config.php +++ b/module/redirection/view/config/config.php @@ -1,3 +1,30 @@ +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 (/page#ancre) ; (/?page#ancre)'; + $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 (/page#anchor) ; (/?page#anchor)'; + $text[4] = 'Redirection'; + $text[5] = 'Statistics'; + $text[6] = 'Number of redirections'; + $text[7] = 'Version no.'; + break; +} +?>
    @@ -5,37 +32,38 @@ 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    - + $text[1] + ]); ?>
    -

    Redirection

    +

    '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 (/page#ancre) ; (/?page#ancre)' + 'help' => $text[3] ]); ?>
    -

    Statistiques

    +

    true, - 'label' => 'Nombre de redirection', + 'label' => $text[6], 'value' => helper::filter($this->getData(['module', $this->getUrl(0), 'count']), helper::FILTER_INT) ]); ?>
    -
    Version n° - +
    \ No newline at end of file diff --git a/module/redirection/view/index/index.js.php b/module/redirection/view/index/index.js.php index aad94f9..b664956 100644 --- a/module/redirection/view/index/index.js.php +++ b/module/redirection/view/index/index.js.php @@ -17,8 +17,15 @@ if (document.referrer.indexOf("edit") === -1) { - core.confirm( - "OUI : éditer la page | NON : tester la redirection.", + var text=""; + 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", "page/edit/getUrl(0); ?>"); }, diff --git a/module/search/ressource/defaultdata.php b/module/search/ressource/defaultdata.php index 18005ff..85e328a 100644 --- a/module/search/ressource/defaultdata.php +++ b/module/search/ressource/defaultdata.php @@ -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)' diff --git a/module/search/search.php b/module/search/search.php index 5b765d3..0a78ddc 100644 --- a/module/search/search.php +++ b/module/search/search.php @@ -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é 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, '\1',$t); // Sauver résultat $resultat .= '

    '.$t.'...

    '; - $resultat .= '

    ' . count($matches[0]) . (count($matches[0]) === 1 ? ' correspondance

    ' : ' correspondances

    '); + $resultat .= '

    ' . count($matches[0]) . (count($matches[0]) === 1 ? $text[0].'

    ' : $text[0].'s

    '); //} return ([ 'matches' => count($matches[0]), diff --git a/module/search/view/config/config.php b/module/search/view/config/config.php index 68b6ab8..4d004b3 100644 --- a/module/search/view/config/config.php +++ b/module/search/view/config/config.php @@ -1,44 +1,119 @@ - +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; +} + +?>

    'buttonGrey', 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'ico' => 'left', - 'value' => 'Retour' + 'value' => $text[0] ]); ?>
    - + $text[1] + ]); ?>
    -

    Paramètres du module

    +

    'Texte du bouton', + 'label' => $text[2], 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'submitText']) ]); ?>
    'Dimension de l\'aperçu', + 'label' => $text[3], 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'previewLength']) ]); ?>
    -
    +
    'Aide dans la zone de saisie', + 'label' => $text[4], 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder']) ]); ?>
    -
    - + $text[12], + 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'nearWordText']) + ]); ?> +
    +
    +
    +
    + $text[13], + 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'successTitle']) + ]); ?> +
    +
    + $text[14], + 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'failureTitle']) + ]); ?> +
    +
    +
    +
    + $text[15], + 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'commentFailureTitle']) + ]); ?> +
    +
    +
    +
    + $this->getData(['module', $this->getUrl(0), 'config', 'resultHideContent']), ]); ?>
    @@ -49,16 +124,16 @@
    -

    Thème - +

    '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']) ]); ?>
    @@ -67,6 +142,6 @@
    -
    Version n° +
    \ No newline at end of file diff --git a/module/search/view/index/index.php b/module/search/view/index/index.php index 5af1208..f8c9081 100644 --- a/module/search/view/index/index.php +++ b/module/search/view/index/index.php @@ -1,10 +1,24 @@ - +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; +} + +?>
    $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 ]); ?>
    @@ -18,7 +32,7 @@
    - getData(['module', $this->getUrl(0), 'config', 'nearWordText']), [ 'checked' => $module::$motentier, ]); ?>