Source
$paging = CPagerHelper::paginate($this->getInput('page', 1), $prepared_data['items'], ZBX_SORT_UP, $view_url);
<?php declare(strict_types = 0);
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* Controller for the "Latest data" page.
*/
class CControllerLatestView extends CControllerLatest {
protected function init(): void {
$this->disableCsrfValidation();
}
protected function checkInput() {
$fields = [
// filter fields
'groupids' => 'array_db hosts_groups.groupid',
'hostids' => 'array_db hosts.hostid',
'name' => 'string',
'show_details' => 'in 1,0',
'evaltype' => 'in '.TAG_EVAL_TYPE_AND_OR.','.TAG_EVAL_TYPE_OR,
'tags' => 'array',
'state' => 'in -1,'.ITEM_STATE_NORMAL.','.ITEM_STATE_NOTSUPPORTED,
'show_tags' => 'in '.SHOW_TAGS_NONE.','.SHOW_TAGS_1.','.SHOW_TAGS_2.','.SHOW_TAGS_3,
'tag_name_format' => 'in '.TAG_NAME_FULL.','.TAG_NAME_SHORTENED.','.TAG_NAME_NONE,
'tag_priority' => 'string',
// table sorting inputs
'sort' => 'in host,name',
'sortorder' => 'in '.ZBX_SORT_UP.','.ZBX_SORT_DOWN,
'page' => 'ge 1',
// named filter properties
'filter_name' => 'string',
'filter_custom_time' => 'in 1,0',
'filter_show_counter' => 'in 1,0',
'filter_counters' => 'in 1',
'filter_set' => 'in 1',
'filter_reset' => 'in 1',
'counter_index' => 'ge 0',
'subfilter_hostids' => 'array',
'subfilter_tagnames' => 'array',
'subfilter_tags' => 'array',
'subfilter_state' => 'array',
'subfilter_data' => 'array',
'subfilters_expanded' => 'array'
];
$ret = $this->validateInput($fields);
// Validate tags filter.