core = &$core;
$this->rs = &$rs;
$this->rs_count = $rs_count;
$this->html_prev = __('« prev.');
$this->html_next = __('next »');
}
public function display($page, $nb_per_page, $enclose_block = '', $filter = false, $redir = '')
{
$this->redir = $redir;
if ($this->rs->isEmpty()) {
if ($filter) {
echo '
' . __('No link matches the filter') . '
';
} else {
echo '' . __('No link') . '
';
}
} else {
$pager = new dcPager($page, $this->rs_count, $nb_per_page, 10);
$links = [];
if (isset($_REQUEST['links'])) {
foreach ($_REQUEST['links'] as $v) {
$links[(integer) $v] = true;
}
}
$html_block =
'' .
'
' .
'' . ($filter ?
sprintf(__('List of %s links matching the filter.'), $this->rs_count) :
sprintf(__('List of links (%s)'), $this->rs_count)
). '' .
'' .
'' .
'' . __('Title') . ' | ' .
'' . __('Author') . ' | ' .
'' . __('Description') . ' | ' .
'' . __('Links') . ' | ' .
'' . __('Category') . ' | ' .
'' . __('Rating') . ' | ' .
'' . __('Date') . ' | ' .
'
' .
'' .
'%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()) {
echo $this->linkLine(isset($links[$this->rs->link_id]));
}
echo $blocks[1] . $blocks[2] . $pager->getLinks();
}
}
private function linkLine($checked)
{
return
'' .
'' .
form::checkbox(['entries[]'], $this->rs->link_id, ['checked' => $checked]) .
' | ' .
'' .
'' .
html::escapeHTML($this->rs->link_title) . '' .
' | ' .
'' .
html::escapeHTML($this->rs->link_author) .
' | ' .
'' .
html::escapeHTML($this->rs->link_desc) .
' | ' .
'' .
'' . __('URL') . ' ' .
'' . __('image') . ' ' .
' | ' .
'' .
'' .
html::escapeHTML($this->rs->cat_title) . '' .
' | ' .
'' .
html::escapeHTML($this->rs->link_note) . '/20' .
' | ' .
'' .
dt::dt2str(
$this->core->blog->settings->system->date_format . ', ' . $this->core->blog->settings->system->time_format,
$this->rs->link_upddt,
$this->core->auth->getInfo('user_tz')
) .
' | ' .
'
' . "\n";
}
}