diff --git a/core/core.php b/core/core.php index c5d516db..71bd7dd1 100644 --- a/core/core.php +++ b/core/core.php @@ -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 = [ diff --git a/core/module/i18n/i18n.php b/core/module/i18n/i18n.php index 535ce43a..1f05fe20 100644 --- a/core/module/i18n/i18n.php +++ b/core/module/i18n/i18n.php @@ -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 { @@ -97,7 +122,7 @@ class i18n extends common { } } - /* + /* * Traitement du changement de langues */ public function lang() { diff --git a/core/module/i18n/view/add/add.php b/core/module/i18n/view/add/add.php new file mode 100644 index 00000000..59920226 --- /dev/null +++ b/core/module/i18n/view/add/add.php @@ -0,0 +1,41 @@ + +
+
+ 'buttonGrey', + 'href' => helper::baseUrl() .'i18n', + 'value' => 'Retour' + ]); ?> +
+
+ +
+
+
+
+
+

Ajouter une localisation

+
+
+ i18nInstalled(true), [ + 'label' => 'Copier la structure de', + 'help' => 'Ne rien sélectionner pour une copie vierge ', + 'selected' => -1 + ]); ?> +
+
+ +
+
+ 'Sélectionner'); + $available = array_merge ($available, self::$i18nList); + echo template::select('i18nAddSelect', $available, [ + 'label' => 'vers' + ]); ?> +
+
+
+
+
+ \ No newline at end of file diff --git a/core/module/i18n/view/index/index.php b/core/module/i18n/view/index/index.php index ff6a02a4..762a7a8c 100644 --- a/core/module/i18n/view/index/index.php +++ b/core/module/i18n/view/index/index.php @@ -1,44 +1,25 @@
- 'buttonGrey', 'href' => helper::baseUrl(false), 'ico' => 'home', 'value' => 'Accueil' ]); ?>
-
- +
+ helper::baseUrl() . 'i18n/add', + 'value' => 'Ajouter' + ]); ?> +
+
+
-
-
-
-

Ajouter une localisation

-
-
- i18nInstalled(true), [ - 'label' => 'Copier la structure de', - 'help' => 'Ne rien sélectionner pour une copie vierge ', - 'selected' => -1 - ]); ?> -
-
- -
-
- 'Sélectionner'); - $available = array_merge ($available, self::$i18nList); - echo template::select('i18nLanguageAdd', $available, [ - 'label' => 'vers' - ]); ?> -
-
-
-
-
+
+

Supprimer une localisation