Source
$clock->setAttribute('style', 'width: '.$this->width.'px; height:'.$this->height.'px;');
<?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.
**/
class CClock extends CDiv {
private $width;
private $height;
private $is_enabled = true;
public function __construct() {
parent::__construct();
$this->addClass(ZBX_STYLE_CLOCK);
}
public function setWidth($value) {
$this->width = $value;
return $this;
}
public function setHeight($value) {
$this->height = $value;
return $this;
}
public function setEnabled($is_enabled) {
$this->is_enabled = $is_enabled;
return $this;
}
private function makeClockLine($width, $height, $x, $y, $deg) {
return (new CTag('rect', true))
->setAttribute('width', $width)
->setAttribute('height', $height)
->setAttribute('x', $x)
->setAttribute('y', $y)
->setAttribute('transform', 'rotate('.$deg.' 50 50)')
->addClass(ZBX_STYLE_CLOCK_LINES);
}
private function makeClockFace() {
return [