From b2bf90be544e1e2800f3a1a6c5a7aa6935e050ab Mon Sep 17 00:00:00 2001 From: noelma Date: Fri, 20 Sep 2019 11:53:48 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20pour=20la=20version=20al?= =?UTF-8?q?pha8=20du=20CMS.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/Starterkit.php | 26 +++++++++++++------------- Services/HookConfig.php | 12 +++++------- Services/HookUser.php | 12 ++++++------ Views/page-starterkit-admin.php | 6 +++--- Views/page-starterkit-index.php | 4 ++-- Views/page-starterkit-show.php | 2 +- composer.json | 2 +- 7 files changed, 31 insertions(+), 33 deletions(-) diff --git a/Controller/Starterkit.php b/Controller/Starterkit.php index a4ff4c6..db6af36 100644 --- a/Controller/Starterkit.php +++ b/Controller/Starterkit.php @@ -24,9 +24,9 @@ public function index($req) return self::template() ->view('page', [ - 'title_main' => 'Starterkit index' + 'title_main' => t('Starterkit index') ]) - ->render('page.content', 'page-starterkit-index.php', $this->pathViews, [ + ->make('page.content', 'page-starterkit-index.php', $this->pathViews, [ 'link_show' => $linkShow ]); } @@ -42,9 +42,9 @@ public function admin($req) return self::template() ->getTheme('theme_admin') ->view('page', [ - 'title_main' => 'Starterkit admin', + 'title_main' => t('Starterkit admin'), ]) - ->render('page.content', 'page-starterkit-admin.php', $this->pathViews, [ + ->make('page.content', 'page-starterkit-admin.php', $this->pathViews, [ 'link_create' => $linkCreate, 'link_edit' => $linkEdit ]); @@ -59,7 +59,7 @@ public function show($id, $req) ->view('page', [ 'title_main' => 'Starterkit content ' . $id, ]) - ->render('page.content', 'page-starterkit-show.php', $this->pathViews, [ + ->make('page.content', 'page-starterkit-show.php', $this->pathViews, [ 'id' => $id ]); } @@ -78,19 +78,19 @@ public function create($req) ->text('text', [ 'class' => 'form-control', 'maxlength' => 255, - 'placeholder' => 'Champ d\'exemple', + 'placeholder' => 'Field example', 'required' => 1 ]); }, [ 'class' => 'form-group' ]) ->token('starterkit_create') - ->submit('submit', 'Enregistrer', [ 'class' => 'btn btn-success' ]); + ->submit('submit', t('Save'), [ 'class' => 'btn btn-success' ]); return self::template() ->getTheme('theme_admin') ->view('page', [ - 'title_main' => 'Starterkit create' + 'title_main' => t('Starterkit create') ]) - ->render('page.content', 'form-starterkit-create.php', $this->pathViews, [ + ->make('page.content', 'form-starterkit-create.php', $this->pathViews, [ 'form' => $form ]); } @@ -119,20 +119,20 @@ public function edit($id, $req) ->text('text', [ 'class' => 'form-control', 'maxlength' => 255, - 'placeholder' => 'Champ d\'exemple', + 'placeholder' => 'Field example', 'required' => 1, 'value' => $id ]); }, [ 'class' => 'form-group' ]) ->token('starterkit_edit') - ->submit('submit', 'Enregistrer', [ 'class' => 'btn btn-success' ]); + ->submit('submit', t('Save'), [ 'class' => 'btn btn-success' ]); return self::template() ->getTheme('theme_admin') ->view('page', [ - 'title_main' => 'Starterkit edit ' . $id + 'title_main' => t('Starterkit edit :id', [':id' => $id]) ]) - ->render('page.content', 'form-starterkit-edit.php', $this->pathViews, [ + ->make('page.content', 'form-starterkit-edit.php', $this->pathViews, [ 'form' => $form ]); } diff --git a/Services/HookConfig.php b/Services/HookConfig.php index afb6d26..86da771 100644 --- a/Services/HookConfig.php +++ b/Services/HookConfig.php @@ -16,8 +16,7 @@ public function __construct($config) public function menu(&$menu) { - $menu[] = [ - 'key' => 'starterkit', + $menu['starterkit'] = [ 'title_link' => 'Starterkit' ]; } @@ -25,25 +24,24 @@ public function menu(&$menu) public function form(&$form, $data) { return $form->group('start-config-fieldset', 'fieldset', function ($form) use ($data) { - $form->legend('start-config-legend', 'Starterkit config') + $form->legend('start-config-legend', t('Starterkit config')) ->group('start-start_check-group', 'div', function ($form) use ($data) { $form->checkbox('start_check', [ 'checked' => $data[ 'start_check' ] ]) - ->label('start-start_check-label', ' Start check.', [ + ->label('start-start_check-label', ' ' . t('Start check.'), [ 'for' => 'start_check' ]); }, [ 'class' => 'form-group' ]) ->group('system-start_text-group', 'div', function ($form) use ($data) { - $form->label('system-start_text-label', 'Start text') + $form->label('system-start_text-label', t('Start text')) ->text('start_text', [ 'class' => 'form-control', 'required' => 1, - 'placeholder' => 'Text exemple', 'value' => $data[ 'start_text' ] ]); }, [ 'class' => 'form-group' ]); }) ->token('config_starterkit') - ->submit('submit', 'Enregistrer', [ 'class' => 'btn btn-success' ]); + ->submit('submit', t('Save'), [ 'class' => 'btn btn-success' ]); } public function validator(&$validator) diff --git a/Services/HookUser.php b/Services/HookUser.php index 39d127b..d48e0cc 100644 --- a/Services/HookUser.php +++ b/Services/HookUser.php @@ -7,12 +7,12 @@ class HookUser public function hookPermission(&$permission) { $permission[ 'Starterkit' ] = [ - 'starterkit.index' => 'Voir starterkit', - 'starterkit.admin' => 'Voir l\'administration', - 'starterkit.show' => 'Voir le contenu', - 'starterkit.created' => 'Ajouter du contenu', - 'starterkit.edited' => 'Éditer du contenu', - 'starterkit.delete' => 'Supprimer du contenu', + 'starterkit.index' => t('View'), + 'starterkit.admin' => t('Administrator'), + 'starterkit.show' => t('View content'), + 'starterkit.created' => t('Add content'), + 'starterkit.edited' => t('Edit'), + 'starterkit.delete' => t('Delete'), ]; } diff --git a/Views/page-starterkit-admin.php b/Views/page-starterkit-admin.php index 9da30dd..0e5965b 100644 --- a/Views/page-starterkit-admin.php +++ b/Views/page-starterkit-admin.php @@ -1,4 +1,4 @@ -

La page d'administration du module.

-

Lien du formulaire de création

-

Lien du formulaire d'édition

\ No newline at end of file +

+

+

\ No newline at end of file diff --git a/Views/page-starterkit-index.php b/Views/page-starterkit-index.php index 99d68b3..d349cef 100644 --- a/Views/page-starterkit-index.php +++ b/Views/page-starterkit-index.php @@ -1,3 +1,3 @@ -

La page d'accueil du module.

-

Voir le contenu 1

\ No newline at end of file +

+

\ No newline at end of file diff --git a/Views/page-starterkit-show.php b/Views/page-starterkit-show.php index ee0cb90..84b2446 100644 --- a/Views/page-starterkit-show.php +++ b/Views/page-starterkit-show.php @@ -1,2 +1,2 @@ -

Page pour voir le contenu à partir de l'identifiant .

\ No newline at end of file +

$id]); ?>

\ No newline at end of file diff --git a/composer.json b/composer.json index 8dfba03..5dcb1d6 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "soosyze-extension/starterkit", "type": "soosyze-module", - "description": "Pour démarrer votre module Soosyze avec une base de code (CRUD, liens dans les menus, droits utilisateurs, page de configuration).", + "description": "To start your Soosyze module with a code base (CRUD, links in menus, user rights, configuration page).", "version": "1.0", "autoload": { "psr-4": {