Source
$elements[] = (new CTextAreaFlexible($name.'[value]', $value, ['add_post_js' => $this->add_post_js]))
<?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/>.
**/
class CMacroValue extends CInput {
/**
* Container class.
*/
public const ZBX_STYLE_MACRO_INPUT_GROUP = 'macro-input-group';
public const ZBX_STYLE_MACRO_VALUE_TEXT = 'macro-value-text';
public const ZBX_STYLE_MACRO_VALUE_SECRET = 'macro-value-secret';
public const ZBX_STYLE_MACRO_VALUE_VAULT = 'macro-value-vault';
/**
* Button class for undo.
*/
public const ZBX_STYLE_BTN_UNDO = 'btn-undo';
/**
* Add element initialization javascript.
*
* @var bool
*/
protected $add_post_js = true;
/**
* Revert button visibility.
*
* @var bool
*/
protected $revert_visible = true;
/**
* Revert button element.
*
* @var CTag
*/
protected $revert_button = null;
/**
* Maxlength of macro value input field.
*
* @var int
*/
protected $maxlength = 2048;
/**
* Class constructor.
*
* @param int $type Macro type one of ZBX_MACRO_TYPE_SECRET or ZBX_MACRO_TYPE_TEXT value.