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/';
|
||||
|
||||
// Numéro de version
|
||||
const ZWII_VERSION = '10.0.43.dev';
|
||||
const ZWII_VERSION = '10.0.44.dev';
|
||||
|
||||
public static $actions = [];
|
||||
public static $coreModuleIds = [
|
||||
|
@ -16,28 +16,23 @@ class i18n extends common {
|
||||
|
||||
public static $actions = [
|
||||
'index' => self::GROUP_MODERATOR,
|
||||
//'config' => self::GROUP_MODERATOR,
|
||||
'add' => self::GROUP_MODERATOR,
|
||||
'lang' => self::GROUP_VISITOR
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Config : gestion des langues
|
||||
* Ajouter une localisation
|
||||
*/
|
||||
public function index() {
|
||||
|
||||
public function add() {
|
||||
// Soumission du formulaire
|
||||
if($this->isPost()) {
|
||||
// Et faire un backup
|
||||
// Fonction à révoir dans core.php
|
||||
|
||||
// Mode Création
|
||||
// Récupérer les données du formulaire
|
||||
$create = $this->getInput('i18nLanguageAdd');
|
||||
$remove = $this->getInput('i18nLanguageRemove');
|
||||
$copyFrom = $this->getInput('i18nLanguageCopyFrom');
|
||||
$create = $this->getInput('i18nAddSelect');
|
||||
$copyFrom = $this->getInput('i18nAddCopyFrom');
|
||||
$notification = '';
|
||||
$success = array ('create' => false,'remove'=> false);
|
||||
|
||||
// Mode Création
|
||||
if (!empty ($create)) {
|
||||
// Mode création de langue
|
||||
// La langue est déja créée ?
|
||||
@ -56,6 +51,36 @@ class i18n extends common {
|
||||
// Valeurs en sortie
|
||||
$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
|
||||
if (!empty ($remove)) {
|
||||
|
||||
@ -84,7 +109,7 @@ class i18n extends common {
|
||||
'notification' => $notification,
|
||||
'title' => 'Internationalisation',
|
||||
'view' => 'index',
|
||||
'state' => $success ['create'] || $success ['remove']
|
||||
'state' => $success ['remove']
|
||||
]);
|
||||
|
||||
} 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'); ?>
|
||||
<div class="row">
|
||||
<div class="col2">
|
||||
<?php echo template::button('configBack', [
|
||||
<?php echo template::button('i18nBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl(false),
|
||||
'ico' => 'home',
|
||||
'value' => 'Accueil'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset8">
|
||||
<?php echo template::submit('configSubmit'); ?>
|
||||
<div class="col2 offset6">
|
||||
<?php echo template::button('i18nAddButton', [
|
||||
'href' => helper::baseUrl() . 'i18n/add',
|
||||
'value' => 'Ajouter'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::submit('i18nSubmit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col8">
|
||||
<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="col12">
|
||||
<div class="block">
|
||||
<h4>Supprimer une localisation</h4>
|
||||
<div class="row">
|
||||
|
Loading…
Reference in New Issue
Block a user