fix: a few issues with colors (take two) (#6787)

This commit is contained in:
Olen
2017-06-06 13:42:49 +02:00
committed by Tony Murray
parent 96f066189e
commit 4b15713f69

View File

@@ -250,7 +250,7 @@ class IRCBot
$severity_extended = ''; $severity_extended = '';
endswitch; endswitch;
$severity = str_replace(array('warning', 'critical'), array(_color('Warning', 'orange'), _color('Critical', 'red')), $alert['severity']).$severity_extended.' '; $severity = str_replace(array('warning', 'critical'), array($this->_color('Warning', 'yellow'), $this->_color('Critical', 'red')), $alert['severity']).$severity_extended.' ';
if ($alert['state'] == 0 and $this->config['irc_alert_utf8']) { if ($alert['state'] == 0 and $this->config['irc_alert_utf8']) {
$severity = str_replace(array('Warning', 'Critical'), array('̶W̶a̶r̶n̶i̶n̶g', '̶C̶r̶i̶t̶i̶c̶a̶l'), $severity); $severity = str_replace(array('Warning', 'Critical'), array('̶W̶a̶r̶n̶i̶n̶g', '̶C̶r̶i̶t̶i̶c̶a̶l'), $severity);
} }
@@ -813,7 +813,7 @@ class IRCBot
} }
if ($devdown > 0) { if ($devdown > 0) {
$devdown = $this->_color($devdown, 'red'); $devdown = $this->_color($devdown, 'red');
$devcount = $this->_color($devcount, 'orange', null, 'bold'); $devcount = $this->_color($devcount, 'yellow', null, 'bold');
} else { } else {
$devcount = $this->_color($devcount, 'green', null, 'bold'); $devcount = $this->_color($devcount, 'green', null, 'bold');
} }
@@ -834,7 +834,7 @@ class IRCBot
} }
if ($prtdown > 0) { if ($prtdown > 0) {
$prtdown = $this->_color($prtdown, 'red'); $prtdown = $this->_color($prtdown, 'red');
$prtcount = $this->_color($prtcount, 'orange', null, 'bold'); $prtcount = $this->_color($prtcount, 'yellow', null, 'bold');
} else { } else {
$prtcount = $this->_color($prtcount, 'green', null, 'bold'); $prtcount = $this->_color($prtcount, 'green', null, 'bold');
} }
@@ -854,7 +854,7 @@ class IRCBot
} }
if ($srvdown > 0) { if ($srvdown > 0) {
$srvdown = $this->_color($srvdown, 'red'); $srvdown = $this->_color($srvdown, 'red');
$srvcount = $this->_color($srvcount, 'orange', null, 'bold'); $srvcount = $this->_color($srvcount, 'yellow', null, 'bold');
} else { } else {
$srvcount = $this->_color($srvcount, 'green', null, 'bold'); $srvcount = $this->_color($srvcount, 'green', null, 'bold');
} }
@@ -890,9 +890,9 @@ class IRCBot
'lightgrey' => "15", 'lightgrey' => "15",
); );
$ret = chr(3); $ret = chr(3);
if (in_array($fg_color, $colors)) { if (array_key_exists($fg_color, $colors)) {
$ret .= $colors[$fg_color]; $ret .= $colors[$fg_color];
if (in_array($bg_color, $colors)) { if (array_key_exists($bg_color, $colors)) {
$ret .= ",".$colors[$fg_color]; $ret .= ",".$colors[$fg_color];
} }
} }