setModern(true); $this->setEnabled($enabled); } /** * Add value. * * @param string $label Input element label. * @param string|int $value Input element value. * @param string|null $class List item class name. * @param string|null $on_change Javascript handler for onchange event. * * @return CSeverity */ public function addValue($label, $value, $class = null, $on_change = null): self { $this->values[] = [ 'name' => $label, 'value' => $value, 'id' => null, 'class' => $class, 'on_change' => $on_change ]; return $this; } public function toString($destroy = true): string { foreach (CSeverityHelper::getSeverities() as $severity) { $this->addValue($severity['label'], $severity['value'], $severity['style']); } return parent::toString($destroy); } }