This commit is contained in:
Jean-Christian Denis 2023-04-29 22:06:30 +02:00
parent 15d7248db5
commit 8315eede38
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
2 changed files with 36 additions and 22 deletions

View file

@ -111,12 +111,10 @@ class BackendList extends adminGenericListV2
'check' => (new Para(null, 'td')) 'check' => (new Para(null, 'td'))
->class('nowrap minimal') ->class('nowrap minimal')
->items([ ->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( 'date' => (new Text('td', Html::escapeHTML(Date::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->log_dt))))
__('%Y-%m-%d %H:%M'),
$this->rs->log_dt
))))
->class('nowrap minimal'), ->class('nowrap minimal'),
'msg' => (new Text('td', nl2br(Html::escapeHTML($this->rs->log_msg)))) 'msg' => (new Text('td', nl2br(Html::escapeHTML($this->rs->log_msg))))
->class('maximal'), ->class('maximal'),

View file

@ -97,22 +97,38 @@ class Manage extends dcNsProcess
if ($current->logs !== null && $current->list != null) { if ($current->logs !== null && $current->list != null) {
if ($current->logs->isEmpty() && !$current->filter->show()) { 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 { } else {
$current->filter->display( $current->filter->display(
'admin.plugin.' . My::id(), 'admin.plugin.' . My::id(),
(new Hidden(['p'], My::id()))->render() (new Hidden(['p'], My::id()))
->render()
); );
$current->list->display( $current->list->display(
is_numeric($current->filter->__get('page')) ? (int) $current->filter->__get('page') : 1, is_numeric($current->filter->__get('page')) ? (int) $current->filter->__get('page') : 1,
is_numeric($current->filter->__get('nb')) ? (int) $current->filter->__get('nb') : 10, 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 Form('dcLog_form'))
->action(dcCore::app()->adminurl?->get('admin.plugin.' . My::id()))
->method('post')
->fields([
(new Text('', '%s')), (new Text('', '%s')),
(new Div())->class('two-cols')->items([ (new Div())
(new Para())->class('col checkboxes-helpers'), ->class('two-cols')
(new Para())->class('col right')->separator(' ')->items([ ->items([
(new Submit(['selected_logs']))->class('delete')->value(__('Delete selected logs')), (new Para())
(new Submit(['all_logs']))->class('delete')->value(__('Delete all logs')), ->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( (new Text(
'', '',