self::getName($severity), 'value' => $severity, 'style' => self::getStyle($severity) ]; } return $severities; } /** * Returns HTML representation of severity cell containing severity name and color. * * @param int $severity Trigger, Event or Problem severity. * @param array|string|null $text Trigger severity name. * @param bool $force_normal True to return 'normal' class, false to return corresponding severity class. * @param bool $return_as_div True to return severity cell as DIV element. * * @return CDiv|CCol */ public static function makeSeverityCell(int $severity, $text = null, bool $force_normal = false, bool $return_as_div = false) { if ($text === null) { $text = self::getName($severity); } if ($force_normal) { return new CCol($text); } $return = $return_as_div ? new CDiv($text) : new CCol($text); return $return->addClass(self::getStyle($severity)); } }