From 8315eede380e402a9dc3602aee2590d934167e05 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 29 Apr 2023 22:06:30 +0200 Subject: [PATCH] cosmetic --- src/BackendList.php | 8 +++----- src/Manage.php | 50 ++++++++++++++++++++++++++++++--------------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/src/BackendList.php b/src/BackendList.php index a90938e..96e2724 100644 --- a/src/BackendList.php +++ b/src/BackendList.php @@ -111,12 +111,10 @@ class BackendList extends adminGenericListV2 'check' => (new Para(null, 'td')) ->class('nowrap minimal') ->items([ - (new Checkbox(['entries[]'], $checked))->value($this->rs->log_id), + (new Checkbox(['entries[]'], $checked)) + ->value($this->rs->log_id), ]), - 'date' => (new Text('td', Html::escapeHTML(Date::dt2str( - __('%Y-%m-%d %H:%M'), - $this->rs->log_dt - )))) + 'date' => (new Text('td', Html::escapeHTML(Date::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->log_dt)))) ->class('nowrap minimal'), 'msg' => (new Text('td', nl2br(Html::escapeHTML($this->rs->log_msg)))) ->class('maximal'), diff --git a/src/Manage.php b/src/Manage.php index ef7e864..026fe2a 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -97,30 +97,46 @@ class Manage extends dcNsProcess if ($current->logs !== null && $current->list != null) { if ($current->logs->isEmpty() && !$current->filter->show()) { - echo (new Text('p', __('There are no logs')))->render(); + echo + (new Text('p', __('There are no logs'))) + ->render(); } else { $current->filter->display( 'admin.plugin.' . My::id(), - (new Hidden(['p'], My::id()))->render() + (new Hidden(['p'], My::id())) + ->render() ); $current->list->display( is_numeric($current->filter->__get('page')) ? (int) $current->filter->__get('page') : 1, is_numeric($current->filter->__get('nb')) ? (int) $current->filter->__get('nb') : 10, - (new Form('form-entries'))->action(dcCore::app()->adminurl?->get('admin.plugin.' . My::id()))->method('post')->fields([ - (new Text('', '%s')), - (new Div())->class('two-cols')->items([ - (new Para())->class('col checkboxes-helpers'), - (new Para())->class('col right')->separator(' ')->items([ - (new Submit(['selected_logs']))->class('delete')->value(__('Delete selected logs')), - (new Submit(['all_logs']))->class('delete')->value(__('Delete all logs')), - ]), - (new Text( - '', - dcCore::app()->adminurl?->getHiddenFormFields('admin.plugin.' . My::id(), $current->filter->values()) . - dcCore::app()->formNonce() - )), - ]), - ])->render(), + (new Form('dcLog_form')) + ->action(dcCore::app()->adminurl?->get('admin.plugin.' . My::id())) + ->method('post') + ->fields([ + (new Text('', '%s')), + (new Div()) + ->class('two-cols') + ->items([ + (new Para()) + ->class('col checkboxes-helpers'), + (new Para()) + ->class('col right') + ->separator(' ') + ->items([ + (new Submit('selected_logs')) + ->class('delete') + ->value(__('Delete selected logs')), + (new Submit('all_logs')) + ->class('delete') + ->value(__('Delete all logs')), + ]), + (new Text( + '', + dcCore::app()->adminurl?->getHiddenFormFields('admin.plugin.' . My::id(), $current->filter->values()) . + dcCore::app()->formNonce() + )), + ]), + ])->render(), $current->filter->show() ); }