Ejemplo n.º 1
0
 public function __construct($id = null)
 {
     parent::__construct();
     $this->addClass('table-forms');
     if ($id) {
         $this->setId(zbx_formatDomId($id));
     }
 }
Ejemplo n.º 2
0
 public function __construct($name, $value)
 {
     parent::__construct();
     $this->name = $name;
     $this->value = $value;
     $this->orientation = self::ORIENTATION_HORIZONTAL;
     $this->enabled = true;
     $this->values = [];
     $this->modern = false;
     $this->setId(zbx_formatDomId($name));
 }
Ejemplo n.º 3
0
 /**
  * @param string $options['name']
  * @param int    $options['value']		(optional) Default: TRIGGER_SEVERITY_NOT_CLASSIFIED
  * @param bool   $options['all']		(optional)
  */
 public function __construct(array $options = [])
 {
     parent::__construct();
     $id = zbx_formatDomId($options['name']);
     $this->addClass(ZBX_STYLE_RADIO_SEGMENTED);
     $this->setId($id);
     if (!array_key_exists('value', $options)) {
         $options['value'] = TRIGGER_SEVERITY_NOT_CLASSIFIED;
     }
     $severity_from = array_key_exists('all', $options) && $options['all'] ? -1 : TRIGGER_SEVERITY_NOT_CLASSIFIED;
     $config = select_config();
     for ($severity = $severity_from; $severity < TRIGGER_SEVERITY_COUNT; $severity++) {
         $name = $severity == -1 ? _('all') : getSeverityName($severity, $config);
         $class = $severity == -1 ? null : getSeverityStyle($severity);
         $radio = (new CInput('radio', $options['name'], $severity))->setId(zbx_formatDomId($options['name'] . '_' . $severity));
         if ($severity === $options['value']) {
             $radio->setAttribute('checked', 'checked');
         }
         parent::addItem((new CListItem([$radio, new CLabel($name, $options['name'] . '_' . $severity)]))->addClass($class));
     }
 }
Ejemplo n.º 4
0
 /**
  * Creates a UL horizontal list with spaces between elements.
  *
  * @param array $values			an array of items to add to the list
  */
 public function __construct(array $values = [])
 {
     parent::__construct($values);
     $this->addClass(ZBX_STYLE_HOR_LIST);
 }