Nouvel écran de langues partie 1
This commit is contained in:
parent
16fe83021e
commit
0ef4ac1b08
@ -31,7 +31,7 @@ class common {
|
|||||||
const TEMP_DIR = 'site/tmp/';
|
const TEMP_DIR = 'site/tmp/';
|
||||||
|
|
||||||
// Numéro de version
|
// Numéro de version
|
||||||
const ZWII_VERSION = '10.0.43.dev';
|
const ZWII_VERSION = '10.0.44.dev';
|
||||||
|
|
||||||
public static $actions = [];
|
public static $actions = [];
|
||||||
public static $coreModuleIds = [
|
public static $coreModuleIds = [
|
||||||
|
@ -16,28 +16,23 @@ class i18n extends common {
|
|||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'index' => self::GROUP_MODERATOR,
|
'index' => self::GROUP_MODERATOR,
|
||||||
//'config' => self::GROUP_MODERATOR,
|
'add' => self::GROUP_MODERATOR,
|
||||||
'lang' => self::GROUP_VISITOR
|
'lang' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Config : gestion des langues
|
* Ajouter une localisation
|
||||||
*/
|
*/
|
||||||
public function index() {
|
public function add() {
|
||||||
|
// Soumission du formulaire
|
||||||
if($this->isPost()) {
|
if($this->isPost()) {
|
||||||
// Et faire un backup
|
// Mode Création
|
||||||
// Fonction à révoir dans core.php
|
|
||||||
|
|
||||||
// Récupérer les données du formulaire
|
// Récupérer les données du formulaire
|
||||||
$create = $this->getInput('i18nLanguageAdd');
|
$create = $this->getInput('i18nAddSelect');
|
||||||
$remove = $this->getInput('i18nLanguageRemove');
|
$copyFrom = $this->getInput('i18nAddCopyFrom');
|
||||||
$copyFrom = $this->getInput('i18nLanguageCopyFrom');
|
|
||||||
$notification = '';
|
$notification = '';
|
||||||
$success = array ('create' => false,'remove'=> false);
|
$success = array ('create' => false,'remove'=> false);
|
||||||
|
|
||||||
// Mode Création
|
|
||||||
if (!empty ($create)) {
|
if (!empty ($create)) {
|
||||||
// Mode création de langue
|
// Mode création de langue
|
||||||
// La langue est déja créée ?
|
// La langue est déja créée ?
|
||||||
@ -56,6 +51,36 @@ class i18n extends common {
|
|||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$notification = $success['create'] === true ? self::$i18nList[$create] . ' installée' : self::$i18nList[$create] . ' déjà installée' ;
|
$notification = $success['create'] === true ? self::$i18nList[$create] . ' installée' : self::$i18nList[$create] . ' déjà installée' ;
|
||||||
}
|
}
|
||||||
|
$this->addOutput([
|
||||||
|
'notification' => $notification,
|
||||||
|
'title' => 'Ajouter une langue',
|
||||||
|
'view' => 'add',
|
||||||
|
'state' => $success ['create']
|
||||||
|
]);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Valeurs en sortie sans post
|
||||||
|
$this->addOutput([
|
||||||
|
'title' => 'Ajouter une langue',
|
||||||
|
'view' => 'add'
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Config : gestion des langues
|
||||||
|
*/
|
||||||
|
public function index() {
|
||||||
|
// Soumission du formulaire
|
||||||
|
if($this->isPost()) {
|
||||||
|
// Et faire un backup
|
||||||
|
|
||||||
|
// Récupérer les données du formulaire
|
||||||
|
$remove = $this->getInput('i18nLanguageRemove');
|
||||||
|
$notification = '';
|
||||||
|
$success = array ('create' => false,'remove'=> false);
|
||||||
|
|
||||||
// Mode effacement
|
// Mode effacement
|
||||||
if (!empty ($remove)) {
|
if (!empty ($remove)) {
|
||||||
|
|
||||||
@ -84,7 +109,7 @@ class i18n extends common {
|
|||||||
'notification' => $notification,
|
'notification' => $notification,
|
||||||
'title' => 'Internationalisation',
|
'title' => 'Internationalisation',
|
||||||
'view' => 'index',
|
'view' => 'index',
|
||||||
'state' => $success ['create'] || $success ['remove']
|
'state' => $success ['remove']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
41
core/module/i18n/view/add/add.php
Normal file
41
core/module/i18n/view/add/add.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?php echo template::formOpen('i18nAdd'); ?>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col2">
|
||||||
|
<?php echo template::button('i18nAddBack', [
|
||||||
|
'class' => 'buttonGrey',
|
||||||
|
'href' => helper::baseUrl() .'i18n',
|
||||||
|
'value' => 'Retour'
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col2 offset8">
|
||||||
|
<?php echo template::submit('i18NAddSubmit'); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col12">
|
||||||
|
<div class="block">
|
||||||
|
<h4>Ajouter une localisation</h4>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col5">
|
||||||
|
<?php echo template::select('i18nAddCopyFrom', $this->i18nInstalled(true), [
|
||||||
|
'label' => 'Copier la structure de',
|
||||||
|
'help' => 'Ne rien sélectionner pour une copie vierge ',
|
||||||
|
'selected' => -1
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col1">
|
||||||
|
<?php echo template::ico('right-big'); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col5">
|
||||||
|
<?php
|
||||||
|
$available = array ('' => 'Sélectionner');
|
||||||
|
$available = array_merge ($available, self::$i18nList);
|
||||||
|
echo template::select('i18nAddSelect', $available, [
|
||||||
|
'label' => 'vers'
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php echo template::formClose(); ?>
|
@ -1,44 +1,25 @@
|
|||||||
<?php echo template::formOpen('i18nIndex'); ?>
|
<?php echo template::formOpen('i18nIndex'); ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col2">
|
<div class="col2">
|
||||||
<?php echo template::button('configBack', [
|
<?php echo template::button('i18nBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl(false),
|
'href' => helper::baseUrl(false),
|
||||||
'ico' => 'home',
|
'ico' => 'home',
|
||||||
'value' => 'Accueil'
|
'value' => 'Accueil'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col2 offset8">
|
<div class="col2 offset6">
|
||||||
<?php echo template::submit('configSubmit'); ?>
|
<?php echo template::button('i18nAddButton', [
|
||||||
|
'href' => helper::baseUrl() . 'i18n/add',
|
||||||
|
'value' => 'Ajouter'
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col2">
|
||||||
|
<?php echo template::submit('i18nSubmit'); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col8">
|
<div class="col12">
|
||||||
<div class="block">
|
|
||||||
<h4>Ajouter une localisation</h4>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col5">
|
|
||||||
<?php echo template::select('i18nLanguageCopyFrom', $this->i18nInstalled(true), [
|
|
||||||
'label' => 'Copier la structure de',
|
|
||||||
'help' => 'Ne rien sélectionner pour une copie vierge ',
|
|
||||||
'selected' => -1
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
<div class="col1">
|
|
||||||
<?php echo template::ico('right-big'); ?>
|
|
||||||
</div>
|
|
||||||
<div class="col5">
|
|
||||||
<?php
|
|
||||||
$available = array ('' => 'Sélectionner');
|
|
||||||
$available = array_merge ($available, self::$i18nList);
|
|
||||||
echo template::select('i18nLanguageAdd', $available, [
|
|
||||||
'label' => 'vers'
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col4">
|
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>Supprimer une localisation</h4>
|
<h4>Supprimer une localisation</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
Loading…
Reference in New Issue
Block a user