Source
* @param array $prepared_data [IN/OUT] Result of items matching primary filter.
<?php
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
/**
* Base controller for the "Latest data" page and the "Latest data" asynchronous refresh page.
*/
abstract class CControllerLatest extends CController {
// Filter idx prefix.
public const FILTER_IDX = 'web.monitoring.latest';
// Number of tag value rows allowed to be included in subfilter.
public const SUBFILTERS_TAG_VALUE_ROWS = 10;
// Number of tag value rows when tag values subfilter is expanded.
private const SUBFILTERS_TAG_VALUE_ROWS_EXPANDED = 200;
// Filter fields default values.
public const FILTER_FIELDS_DEFAULT = [
'groupids' => [],
'hostids' => [],
'name' => '',
'evaltype' => TAG_EVAL_TYPE_AND_OR,
'tags' => [],
'state' => -1,
'show_tags' => SHOW_TAGS_3,
'tag_name_format' => TAG_NAME_FULL,
'tag_priority' => '',
'show_details' => 0,
'page' => null,
'sort' => 'name',
'sortorder' => ZBX_SORT_UP,
'subfilter_hostids' => [],
'subfilter_tagnames' => [],
'subfilter_tags' => [],
'subfilter_state' => [],
'subfilter_data' => []
];
/**
* Prepare the latest data based on the given filter and sorting options.
*
* @param array $filter Item filter options.
* @param array $filter['groupids'] Filter items by host groups.
* @param array $filter['hostids'] Filter items by hosts.