rs->isEmpty()) { echo '

' . ( $filter ? __('No entries matches the filter') : __('No entries') ) . '

'; } else { $pager = new dcPager($page, $this->rs_count, $nb_per_page, 10); $pager->base_url = $base_url; $entries = []; if (isset($_REQUEST['feeds'])) { foreach ($_REQUEST['feeds'] as $v) { $entries[(int) $v] = true; } } $html_block = '
' . '' . ''; $cols = [ 'title' => '', 'date' => '', 'author' => '', 'category' => '', 'status' => '', ]; $cols = new ArrayObject($cols); dcCore::app()->callBehavior('adminZcfsPostListHeader', $this->rs, $cols); $this->userColumns('zcfs_entries', $cols); $html_block .= '' . implode(iterator_to_array($cols)) . '%s
' . ( $filter ? sprintf(__('List of %s entries matching the filter.'), $this->rs_count) : sprintf(__('List of entries (%s)'), $this->rs_count) ) . '
' . __('Title') . '' . __('Date') . '' . __('Author') . '' . __('Category') . '' . __('Status') . '
'; if ($enclose_block) { $html_block = sprintf($enclose_block, $html_block); } echo $pager->getLinks(); $blocks = explode('%s', $html_block); echo $blocks[0]; while ($this->rs->fetch()) { echo $this->postLine(); } echo $blocks[1]; echo $pager->getLinks(); } } private function postLine() { $cat_link = dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CATEGORIES]), dcCore::app()->blog->id) ? '%s' : '%2$s'; $cat_title = $this->rs->cat_title ? sprintf($cat_link, $this->rs->cat_id, html::escapeHTML($this->rs->cat_title)) : __('None'); $img = '%1$s'; $img_status = ''; $sts_class = ''; switch ($this->rs->post_status) { case 1: $img_status = sprintf($img, __('Published'), 'check-on.png'); $sts_class = 'sts-online'; break; case 0: $img_status = sprintf($img, __('Unpublished'), 'check-off.png'); $sts_class = 'sts-offline'; break; case -1: $img_status = sprintf($img, __('Scheduled'), 'scheduled.png'); $sts_class = 'sts-scheduled'; break; case -2: $img_status = sprintf($img, __('Pending'), 'check-wrn.png'); $sts_class = 'sts-pending'; break; } $res = ''; $cols = [ 'check' => '' . form::checkbox(['entries[]'], $this->rs->post_id, '', '', '', !$this->rs->isEditable()) . '', 'title' => '' . html::escapeHTML(trim(html::clean($this->rs->post_title))) . '', 'date' => '' . dt::dt2str(__('%Y-%m-%d %H:%M'), $this->rs->post_dt) . '', 'author' => '' . html::escapeHTML($this->rs->user_id) . '', 'category' => '' . $cat_title . '', 'status' => '' . $img_status . '', ]; $cols = new ArrayObject($cols); dcCore::app()->callBehavior('adminZcfsPostListValue', $this->rs, $cols); $this->userColumns('zcfs_entries', $cols); $res .= implode(iterator_to_array($cols)); $res .= ''; return $res; } }