-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mise à jour pour la version alpha5 du CMS.
- Loading branch information
Showing
7 changed files
with
127 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
namespace Starterkit\Services; | ||
|
||
class HookConfig | ||
{ | ||
/** | ||
* @var \Soosyze\Config | ||
*/ | ||
protected $config; | ||
|
||
public function __construct($config) | ||
{ | ||
$this->config = $config; | ||
} | ||
|
||
public function menu(&$menu) | ||
{ | ||
$menu[] = [ | ||
'key' => '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') | ||
->group('start-start_check-group', 'div', function ($form) use ($data) { | ||
$form->checkbox('start_check', 'start_check', [ 'checked' => $data[ 'start_check' ] ]) | ||
->label('start-start_check-label', '<span class="ui"></span> 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') | ||
->text('start_text', 'start_text', [ | ||
'class' => 'form-control', | ||
'required' => 1, | ||
'placeholder' => 'Text exemple', | ||
'value' => $data[ 'start_text' ] | ||
]); | ||
}, [ 'class' => 'form-group' ]); | ||
}) | ||
->token() | ||
->submit('submit', 'Enregistrer', [ 'class' => 'btn btn-success' ]); | ||
} | ||
|
||
public function validator(&$validator) | ||
{ | ||
$validator->setRules([ | ||
'start_check' => '!required|bool', | ||
'start_text' => 'required|string|max:255' | ||
]); | ||
} | ||
|
||
public function before(&$validator, &$data) | ||
{ | ||
$data = [ | ||
'start_check' => $validator->getInput('start_check'), | ||
'start_text' => $validator->getInput('start_text') | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Starterkit\Services; | ||
|
||
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', | ||
]; | ||
} | ||
|
||
public function hookStarterkitCreated($req) | ||
{ | ||
return 'starterkit.created'; | ||
} | ||
|
||
public function hookStarterkitEdited($id, $req) | ||
{ | ||
return 'starterkit.edited'; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters