Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
Fred Tempez | e77edb5161 | |
Fred Tempez | 804341de2d | |
Fred Tempez | 23bbbf114e |
|
@ -56,7 +56,6 @@ class common {
|
|||
'sitemap',
|
||||
'theme',
|
||||
'user',
|
||||
'translate',
|
||||
'addon'
|
||||
];
|
||||
public static $accessList = [
|
||||
|
@ -64,8 +63,7 @@ class common {
|
|||
'theme',
|
||||
'config',
|
||||
'edit',
|
||||
'config',
|
||||
'translate'
|
||||
'config'
|
||||
];
|
||||
public static $accessExclude = [
|
||||
'login',
|
||||
|
|
|
@ -29,7 +29,7 @@ body {
|
|||
}
|
||||
|
||||
|
||||
@media (min-width: 769px) {
|
||||
@media screen and (min-width: 769px) {
|
||||
body {
|
||||
/*margin:0px 10px;*/
|
||||
margin: 0;
|
||||
|
@ -41,7 +41,7 @@ body {
|
|||
/**
|
||||
* Petits écrans inférieurs à 768px de largeur, on supprime les marges
|
||||
*/
|
||||
@media (max-width: 768px) {
|
||||
@media screen and (max-width: 768px) {
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ body {
|
|||
|
||||
|
||||
|
||||
@media (max-width: 768px) {
|
||||
@media screen and (max-width: 768px) {
|
||||
.siteContainer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -237,12 +237,12 @@ td>.col12 {
|
|||
}
|
||||
|
||||
/* Tableau sur les écrans de petites tailles */
|
||||
@media (max-width: 768px) {
|
||||
@media screen and (max-width: 768px) {
|
||||
.table thead {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
}
|
||||
@media (max-width: 668px) {
|
||||
@media screen and (max-width: 668px) {
|
||||
.table thead {
|
||||
display:none;
|
||||
}
|
||||
|
@ -408,7 +408,7 @@ td>.col12 {
|
|||
background-color: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
@media (min-width: 769px) {
|
||||
@media screen and (min-width: 769px) {
|
||||
#bar #barLeft {
|
||||
float: left;
|
||||
}
|
||||
|
@ -419,7 +419,7 @@ td>.col12 {
|
|||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
@media screen and (max-width: 768px) {
|
||||
#bar {
|
||||
text-align: center;
|
||||
padding: 0 1;
|
||||
|
@ -455,7 +455,7 @@ td>.col12 {
|
|||
overflow: hidden;
|
||||
}
|
||||
/* Dans theme.css
|
||||
@media (min-width:768px) {
|
||||
@media screen and (min-width:768px) {
|
||||
#site {
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
@ -464,7 +464,7 @@ td>.col12 {
|
|||
|
||||
/* Bannière */
|
||||
|
||||
@media (min-width:768px) {
|
||||
@media screen and (min-width:768px) {
|
||||
body>header {
|
||||
margin: 0;
|
||||
/*-10px;*/
|
||||
|
@ -598,13 +598,13 @@ nav::before {
|
|||
display: flex;
|
||||
}
|
||||
|
||||
@media (min-width: 769px) {
|
||||
@media screen and (min-width: 769px) {
|
||||
nav #menu {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
@media screen and (max-width: 768px) {
|
||||
body>nav {
|
||||
margin: 0;
|
||||
}
|
||||
|
@ -725,7 +725,7 @@ li .menuSideChild {
|
|||
|
||||
|
||||
/* Corps */
|
||||
@media (min-width:768px) {
|
||||
@media screen and (min-width:768px) {
|
||||
section {
|
||||
padding: 20px;
|
||||
}
|
||||
|
@ -822,7 +822,7 @@ footer #footerbody>div {
|
|||
}
|
||||
|
||||
/* Conserve le pied de page sur une ligne */
|
||||
@media (max-width: 768px) {
|
||||
@media screen and (max-width: 768px) {
|
||||
body>footer {
|
||||
margin: 0;
|
||||
}
|
||||
|
@ -1367,7 +1367,7 @@ input[type='checkbox']:disabled+label:before {
|
|||
display: inline-block;
|
||||
}
|
||||
|
||||
@media (min-width: 769px) {
|
||||
@media screen and (min-width: 769px) {
|
||||
.col1 {
|
||||
width: 8.33333333%;
|
||||
}
|
||||
|
@ -1556,7 +1556,7 @@ th.col12 {
|
|||
}
|
||||
|
||||
/* Tableau sur les écrans de très petites tailles */
|
||||
@media (max-width: 480px){
|
||||
@media screen and (max-width: 480px){
|
||||
.table tr{
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
<?php echo template::select('configSearchPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($pages, 'title', 'SORT_ASC') ) , [
|
||||
'label' => 'Recherche dans le site',
|
||||
'selected' => $this->getData(['locale', 'searchPageId']),
|
||||
'help' => 'Sélectionner la page "Recherche" ou une page contenant le module "Recherche". Une option du pied de page ajoute un lien discret vers cette page.'
|
||||
'help' => 'Sélectionnez une page contenant le module \'Recherche\'. Une option du pied de page ajoute un lien discret vers cette page.'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Before Width: | Height: | Size: 119 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 287 B |
Before Width: | Height: | Size: 96 B |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 96 B |
Before Width: | Height: | Size: 108 B |
Before Width: | Height: | Size: 395 B |
|
@ -1,110 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of Zwii.
|
||||
* For full copyright and license information, please see the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2021, Frédéric Tempez
|
||||
* @license GNU General Public License, version 3
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
class translate extends common {
|
||||
|
||||
public static $actions = [
|
||||
/*'config' => self::GROUP_MODERATOR,*/
|
||||
'index' => self::GROUP_MODERATOR,
|
||||
'language' => self::GROUP_VISITOR
|
||||
];
|
||||
|
||||
/**
|
||||
* Configuration
|
||||
*/
|
||||
public function index() {
|
||||
|
||||
// Soumission du formulaire
|
||||
if($this->isPost()) {
|
||||
// Edtion des langues
|
||||
foreach (self::$i18nList as $keyi18n => $value) {
|
||||
if ($keyi18n === 'fr') {continue;}
|
||||
// Effacement d'une langue installée (dossier plus option désactivée précédemment)
|
||||
if ( is_dir( self::DATA_DIR . $keyi18n ) === true
|
||||
AND $this->getInput('translateSiteFlag' . strtoupper($keyi18n) , helper::FILTER_BOOLEAN) === false )
|
||||
{
|
||||
$this->removeDir( self::DATA_DIR . $keyi18n);
|
||||
}
|
||||
// Installation d'une langue
|
||||
if ( $this->getInput('translateSiteFlag' . strtoupper($keyi18n) , helper::FILTER_BOOLEAN) === true )
|
||||
{
|
||||
// Créer le dossier
|
||||
if (is_dir( self::DATA_DIR . $keyi18n ) === false ) {
|
||||
mkdir( self::DATA_DIR . $keyi18n);
|
||||
}
|
||||
// Charger les modèles
|
||||
require_once('core/module/install/ressource/defaultdata.php');
|
||||
// Nouvelle instance des pages, module, locale
|
||||
$files = ['page','module','locale'];
|
||||
foreach ($files as $keyFile) {
|
||||
echo $keyFile;
|
||||
$e = new \Prowebcraft\JsonDb([
|
||||
'name' => $keyFile . '.json',
|
||||
'dir' => $this->dataPath ($keyFile,$keyi18n)
|
||||
]);;
|
||||
$e->set($keyFile, init::$defaultData[$keyFile]);
|
||||
$e->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Enregistrement des données
|
||||
$this->setData(['config','translate', [
|
||||
'scriptGoogle' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN),
|
||||
'showCredits' => $this->getInput('translateCredits', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false,
|
||||
'autoDetect' => $this->getInput('translateAutoDetect', helper::FILTER_BOOLEAN),
|
||||
'admin' => $this->getInput('translateAdmin', helper::FILTER_BOOLEAN),
|
||||
'scriptFR' => $this->getInput('translateScriptFlagFR', helper::FILTER_BOOLEAN),
|
||||
'scriptDE' => $this->getInput('translateScriptFlagDE', helper::FILTER_BOOLEAN),
|
||||
'scriptEN' => $this->getInput('translateScriptFlagEN', helper::FILTER_BOOLEAN),
|
||||
'scriptES' => $this->getInput('translateScriptFlagES', helper::FILTER_BOOLEAN),
|
||||
'scriptIT' => $this->getInput('translateScriptFlagIT', helper::FILTER_BOOLEAN),
|
||||
'scriptNL' => $this->getInput('translateScriptFlagNL', helper::FILTER_BOOLEAN),
|
||||
'scriptPT' => $this->getInput('translateScriptFlagPT', helper::FILTER_BOOLEAN),
|
||||
'site' => $this->getInput('translateSite', helper::FILTER_BOOLEAN),
|
||||
'siteFR' => $this->getInput('translateSiteFlagFR', helper::FILTER_BOOLEAN),
|
||||
'siteDE' => $this->getInput('translateSiteFlagDE', helper::FILTER_BOOLEAN),
|
||||
'siteEN' => $this->getInput('translateSiteFlagEN', helper::FILTER_BOOLEAN),
|
||||
'siteES' => $this->getInput('translateSiteFlagES', helper::FILTER_BOOLEAN),
|
||||
'siteIT' => $this->getInput('translateSiteFlagIT', helper::FILTER_BOOLEAN),
|
||||
'siteNL' => $this->getInput('translateSiteFlagNL', helper::FILTER_BOOLEAN),
|
||||
'sitePT' => $this->getInput('translateSiteFlagPT', helper::FILTER_BOOLEAN)
|
||||
]]);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . $this->getUrl(),
|
||||
'notification' => 'Modifications enregistrées',
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => 'Paramètres',
|
||||
'view' => 'index'
|
||||
]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Traitement du changement de langues
|
||||
*/
|
||||
public function language() {
|
||||
// Transmettre le choix au noyau
|
||||
setcookie('ZWII_USER_I18N', $this->getUrl(2), time() + 3600, helper::baseUrl(false, false) , '', helper::isHttps(), true);
|
||||
// Valeurs en sortie sans post
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . $this->getUrl(3)
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
/**
|
||||
* This file is part of Zwii.
|
||||
*
|
||||
* For full copyright and license information, please see the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2021, Frédéric Tempez
|
||||
* @license GNU General Public License, version 3
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
|
||||
/** @import url("site/data/admin.css"); */
|
||||
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
|
@ -1,124 +0,0 @@
|
|||
<?php echo template::formOpen('translateForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col2">
|
||||
<?php echo template::button('translateFormBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl(),
|
||||
'ico' => 'left',
|
||||
'value' => 'Retour'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset8">
|
||||
<?php echo template::submit('translateFormSubmit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>Langues supportées</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<b>Traduction automatique :</b>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateScriptFlagDE', true, 'Allemand', [
|
||||
'checked' => $this->getData(['config','translate', 'scriptDE'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateScriptFlagEN', true, 'Anglais', [
|
||||
'checked' => $this->getData(['config','translate', 'scriptEN'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateScriptFlagES', true, 'Espagnol', [
|
||||
'checked' => $this->getData(['config','translate', 'scriptES'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateScriptFlagIT', true, 'Italien', [
|
||||
'checked' => $this->getData(['config','translate', 'scriptIT'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateScriptFlagNL', true, 'Néerlandais', [
|
||||
'checked' => $this->getData(['config','translate', 'scriptNL'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateScriptFlagPT', true, 'Portugais', [
|
||||
'checked' => $this->getData(['config','translate', 'scriptPT'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateAutoDetect', true, 'Détection automatique', [
|
||||
'checked' => $this->getData(['config','translate', 'autoDetect']),
|
||||
'help' => 'Détecte la langue du navigateur.'
|
||||
]); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<b>Traduction rédigée :</b>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateSiteFlagEN', true, 'Anglais', [
|
||||
'checked' => $this->getData(['config', 'translate', 'siteEN'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateSiteFlagDE', true, 'Allemand', [
|
||||
'checked' => $this->getData(['config', 'translate', 'siteDE'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateSiteFlagES', true, 'Espagnol', [
|
||||
'checked' => $this->getData(['config', 'translate', 'siteES'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateSiteFlagIT', true, 'Italien', [
|
||||
'checked' => $this->getData(['config', 'translate', 'siteIT'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateSiteFlagNL', true, 'Néerlandais', [
|
||||
'checked' => $this->getData(['config', 'translate', 'siteNL'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('translateSiteFlagPT', true, 'Portugais', [
|
||||
'checked' => $this->getData(['config', 'translate', 'sitePT'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>Paramètres de traduction automatique</h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::checkbox('translateScriptGoogle', true, 'Active le script de traduction automatique', [
|
||||
'checked' => $this->getData(['config','translate', 'scriptGoogle'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::checkbox('translateAdmin', true, 'Mode connexion', [
|
||||
'checked' => $this->getData(['config','translate', 'admin']),
|
||||
'help' => 'Traduction automatique du site et de l\'interface du CMS'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::checkbox('translateCredits', true, 'Afficher les crédits du script Google', [
|
||||
'checked' => $this->getData(['config','translate', 'showCredits']),
|
||||
'help' => 'Option vivement recommandée pour le respect du droit d\'auteur'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|