Skip to content

Commit

Permalink
Mise à jour pour la version alpha8 du CMS.
Browse files Browse the repository at this point in the history
  • Loading branch information
noelma committed Sep 20, 2019
1 parent a5d0c02 commit b2bf90b
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 33 deletions.
26 changes: 13 additions & 13 deletions Controller/Starterkit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
]);
}
Expand All @@ -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
]);
Expand All @@ -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
]);
}
Expand All @@ -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
]);
}
Expand Down Expand Up @@ -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
]);
}
Expand Down
12 changes: 5 additions & 7 deletions Services/HookConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,32 @@ public function __construct($config)

public function menu(&$menu)
{
$menu[] = [
'key' => 'starterkit',
$menu['starterkit'] = [
'title_link' => 'Starterkit'
];
}

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', '<span class="ui"></span> Start check.', [
->label('start-start_check-label', '<span class="ui"></span> ' . 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)
Expand Down
12 changes: 6 additions & 6 deletions Services/HookUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
];
}

Expand Down
6 changes: 3 additions & 3 deletions Views/page-starterkit-admin.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

<p>La page d'administration du module.</p>
<p><a href="<?php echo $link_create; ?>">Lien du formulaire de création</a></p>
<p><a href="<?php echo $link_edit; ?>">Lien du formulaire d'édition</a></p>
<p><?php echo t('La page d\'administration du module.'); ?></p>
<p><a href="<?php echo $link_create; ?>"><?php echo t('Lien du formulaire de création'); ?></a></p>
<p><a href="<?php echo $link_edit; ?>"><?php echo t('Lien du formulaire d\'édition'); ?></a></p>
4 changes: 2 additions & 2 deletions Views/page-starterkit-index.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

<p>La page d'accueil du module.</p>
<p><a href="<?php echo $link_show; ?>">Voir le contenu 1</a></p>
<p><?php echo t('La page d\'accueil du module.'); ?></p>
<p><a href="<?php echo $link_show; ?>"><?php echo t('Voir le contenu 1'); ?></a></p>
2 changes: 1 addition & 1 deletion Views/page-starterkit-show.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

<p>Page pour voir le contenu à partir de l'identifiant <?php echo $id; ?>.</p>
<p><?php echo t('Page pour voir le contenu à partir de l\'identifiant :id.', [':id' => $id]); ?></p>
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit b2bf90b

Please sign in to comment.