diff --git a/include/lib/inplace_switch.class.php b/include/lib/inplace_switch.class.php index 558ffdaea..8120a8f9e 100644 --- a/include/lib/inplace_switch.class.php +++ b/include/lib/inplace_switch.class.php @@ -55,19 +55,23 @@ class Inplace_Switch function input() { - printf('', $this->name); if ($this->value==1) { - echo $this->iconon; + $icon=$this->iconon; + $color="green"; } elseif ($this->value==0) { - echo $this->iconoff; + $icon=$this->iconoff; + $color="red"; } else { throw new Exception(_("Invalide value")); } + + printf('', $color,$this->name); + echo $icon; echo ''; echo << diff --git a/include/param_sec.inc.php b/include/param_sec.inc.php index 73b43b487..43d7af706 100644 --- a/include/param_sec.inc.php +++ b/include/param_sec.inc.php @@ -360,9 +360,11 @@ if ( $action == "view" ) for (i = 0;i < a_select.length;i++) { str_id = new String( a_select[i].id); if ( str_id.search(/action/) > -1 ) { - if ( p_value == 1 ) { + if ( p_value == 0 ) { + a_select[i].setStyle("color:red"); a_select[i].innerHTML=''; } else { + a_select[i].setStyle("color:green"); a_select[i].innerHTML=''; } }