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/>.
**/
/**
* Draws a table containing text or images.
*/
class CImageTextTable {
public $image;
public $fontsize;
public $color;
public $align;
public $x;
public $y;
/**
* Minimal row height. If the height of some row is bigger than given, the $rowheight will be set to this height.
*
* @var int
*/
public $rowheight;
private $table;
private $numrows;
public function __construct($image, $x, $y) {
$this->image = $image;
$this->fontsize = 8;
$this->rowheight = 0;
$this->color = 0;
$this->align = 0;
$this->x = $x;
$this->y = $y;
$this->table = [];
$this->numrows = 0;
}
public function getNumRows() {
return $this->numrows;
}
/**
* Adds a new table cell.
*
* Supported $cell options:
* - marginRight - right margin, defaults to 20
* - image - resource of the image to display in the cell
* - text - text to display in the cell
* - color - text color resource
* - align - text alignment: 0 - left, 1 - center, 2 - right