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'))
->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'),

View file

@ -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()
);
}