Source
<?php
/*
** 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/>.
**/
/**
* A class to display Http tests table as a screen element.
*/
class CScreenHttpTest extends CScreenBase {
/**
* Screen data.
*
* @var array
*/
protected $data = [];
/**
* Init screen data.
*
* @param array $options
* @param array $options['data']
*/
public function __construct(array $options = []) {
parent::__construct($options);
$this->data = $options['data'];
}
/**
* Process screen.
*
* @return CDiv (screen inside container)
*/
public function get() {
$this->dataId = 'httptest';
$sort_field = $this->data['sort'];
$sort_order = $this->data['sortorder'];
$options = [
'output' => ['httptestid', 'name', 'hostid'],
'selectHosts' => ['name', 'status'],
'selectTags' => ['tag', 'value'],
'selectSteps' => API_OUTPUT_COUNT,
'evaltype' => array_key_exists('evaltype', $this->data) ? $this->data['evaltype'] : TAG_EVAL_TYPE_AND_OR,
'tags' => array_key_exists('tags', $this->data) ? $this->data['tags'] : [],
'templated' => false,
'preservekeys' => true,
'filter' => ['status' => HTTPTEST_STATUS_ACTIVE],
'limit' => CSettingsHelper::get(CSettingsHelper::SEARCH_LIMIT) + 1
];