code review

This commit is contained in:
Jean-Christian Denis 2023-04-07 23:51:19 +02:00
parent f0debe050f
commit aeb9bb3353
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
3 changed files with 44 additions and 35 deletions

View file

@ -29,7 +29,6 @@ use Dotclear\Helper\Html\Form\{
Para, Para,
Select Select
}; };
use Dotclear\Helper\Html\Html;
use Exception; use Exception;
class Config extends dcNsProcess class Config extends dcNsProcess

View file

@ -321,7 +321,8 @@ class Manage extends dcNsProcess
<div class="two-cols"> <div class="two-cols">
<p class="col checkboxes-helpers"></p>' . <p class="col checkboxes-helpers"></p>' .
(new Para())->class('col right')->items(array_merge([ (new Para())->class('col right')->items(array_merge(
[
(new Text('', __('Selected languages action:'))), (new Text('', __('Selected languages action:'))),
(new Select('action'))->items([ (new Select('action'))->items([
__('Backup languages') => 'module_create_backups', __('Backup languages') => 'module_create_backups',
@ -330,7 +331,8 @@ class Manage extends dcNsProcess
]), ]),
(new Submit('do-action'))->value(__('ok')), (new Submit('do-action'))->value(__('ok')),
dcCore::app()->formNonce(false), dcCore::app()->formNonce(false),
], dcCore::app()->adminurl?->hiddenFormFields( ],
dcCore::app()->adminurl?->hiddenFormFields(
My::id(), My::id(),
['type' => $current->module->type, 'module' => $current->module->id] ['type' => $current->module->type, 'module' => $current->module->id]
) )
@ -389,7 +391,8 @@ class Manage extends dcNsProcess
<div class="two-cols"> <div class="two-cols">
<p class="col checkboxes-helpers"></p>' . <p class="col checkboxes-helpers"></p>' .
(new Para())->class('col right')->items(array_merge([ (new Para())->class('col right')->items(array_merge(
[
(new Text('', __('Selected backups action:'))), (new Text('', __('Selected backups action:'))),
(new Select('action'))->items([ (new Select('action'))->items([
__('Restore backups') => 'module_restore_backup', __('Restore backups') => 'module_restore_backup',
@ -397,7 +400,8 @@ class Manage extends dcNsProcess
]), ]),
(new Submit('do-action'))->value(__('ok')), (new Submit('do-action'))->value(__('ok')),
dcCore::app()->formNonce(false), dcCore::app()->formNonce(false),
], dcCore::app()->adminurl?->hiddenFormFields( ],
dcCore::app()->adminurl?->hiddenFormFields(
My::id(), My::id(),
['type' => $current->module->type, 'module' => $current->module->id] ['type' => $current->module->type, 'module' => $current->module->id]
) )
@ -428,10 +432,12 @@ class Manage extends dcNsProcess
])->render(); ])->render();
} }
echo echo
(new Para())->items(array_merge([ (new Para())->items(array_merge(
[
(new Submit(['save']))->value(__('Create')), (new Submit(['save']))->value(__('Create')),
dcCore::app()->formNonce(false), dcCore::app()->formNonce(false),
], dcCore::app()->adminurl?->hiddenFormFields( ],
dcCore::app()->adminurl?->hiddenFormFields(
My::id(), My::id(),
['type' => $current->module->type, 'module' => $current->module->id, 'action' => 'module_add_code'] ['type' => $current->module->type, 'module' => $current->module->id, 'action' => 'module_add_code']
) )
@ -447,10 +453,12 @@ class Manage extends dcNsProcess
(new File('packfile')), (new File('packfile')),
]), ]),
(new Para())->items(array_merge([ (new Para())->items(array_merge(
[
(new Submit(['save']))->value(__('Import')), (new Submit(['save']))->value(__('Import')),
dcCore::app()->formNonce(false), dcCore::app()->formNonce(false),
], dcCore::app()->adminurl?->hiddenFormFields( ],
dcCore::app()->adminurl?->hiddenFormFields(
My::id(), My::id(),
['type' => $current->module->type, 'module' => $current->module->id, 'action' => 'module_import_pack'] ['type' => $current->module->type, 'module' => $current->module->id, 'action' => 'module_import_pack']
) )
@ -590,11 +598,13 @@ class Manage extends dcNsProcess
(new Select('multigroup'))->items(My::l10nGroupsCombo()), (new Select('multigroup'))->items(My::l10nGroupsCombo()),
])->render() . ])->render() .
'</div>' . '</div>' .
(new Para())->class('col right')->items(array_merge([ (new Para())->class('col right')->items(array_merge(
[
(new Submit('do-action'))->value(__('Save') . ' (s)')->accesskey('s'), (new Submit('do-action'))->value(__('Save') . ' (s)')->accesskey('s'),
dcCore::app()->formNonce(false), dcCore::app()->formNonce(false),
(new Hidden(['code'], $current->lang->code)), (new Hidden(['code'], $current->lang->code)),
], dcCore::app()->adminurl?->hiddenFormFields( ],
dcCore::app()->adminurl?->hiddenFormFields(
My::id(), My::id(),
['type' => $current->module?->type, 'module' => $current->module?->id, 'lang' => $current->lang->code, 'action' => 'module_update_code'] ['type' => $current->module?->type, 'module' => $current->module?->id, 'lang' => $current->lang->code, 'action' => 'module_update_code']
) )