rs->isEmpty()) {
if ($filter) {
echo '
' . __('No log matches the filter') . '
';
} else {
echo '' . __('No log') . '
';
}
} else {
$pager = new dcPager($page, $this->rs_count, $nb_per_page, 10);
$entries = [];
if (isset($_REQUEST['entries'])) {
foreach ($_REQUEST['entries'] as $v) {
$entries[(int) $v] = true;
}
}
$cols = [
'date' => '' . __('Date') . ' | ',
'msg' => '' . __('Message') . ' | ',
'blog' => '' . __('Blog') . ' | ',
'table' => '' . __('Component') . ' | ',
'user' => '' . __('User') . ' | ',
'ip' => '' . __('IP') . ' | ',
];
$cols = new ArrayObject($cols);
$this->userColumns('dcloglist', $cols);
$html_block = '' .
'
';
if ($filter) {
$html_block .= '' . sprintf(__('List of %s logs matching the filter.'), $this->rs_count) . '';
}
$html_block .= '' . implode(iterator_to_array($cols)) . '
%s
%s
';
if ($enclose_block) {
$html_block = sprintf($enclose_block, $html_block);
}
$blocks = explode('%s', $html_block);
echo $pager->getLinks() . $blocks[0];
while ($this->rs->fetch()) {
$this->logLine(isset($entries[$this->rs->log_id]));
}
echo $blocks[1] . $blocks[2] . $pager->getLinks();
}
}
private function logLine($checked)
{
$cols = [
'check' => '' .
form::checkbox(['entries[]'], $this->rs->log_id, ['checked' => $checked]) .
' | ',
'date' => '' .
html::escapeHTML(dt::dt2str(
__('%Y-%m-%d %H:%M'),
$this->rs->log_dt
)) .
' | ',
'msg' => '' .
nl2br(html::escapeHTML($this->rs->log_msg)) .
' | ',
'blog' => '' .
html::escapeHTML($this->rs->blog_id) .
' | ',
'table' => '' .
html::escapeHTML($this->rs->log_table) .
' | ',
'user' => '' .
html::escapeHTML($this->rs->getUserCN()) .
' | ',
'ip' => '' .
html::escapeHTML($this->rs->log_ip) .
' | ',
];
$cols = new ArrayObject($cols);
$this->userColumns('dcloglist', $cols);
echo
'' .
implode(iterator_to_array($cols)) .
'
';
}
}