Correction couleur pour Inswitch_place

Correction couleur pour Module sécurité
This commit is contained in:
Dany De Bontridder 2018-01-31 07:27:28 +01:00
parent 0088aa8b72
commit cd78ed2a4a
2 changed files with 10 additions and 4 deletions

View file

@ -55,19 +55,23 @@ class Inplace_Switch
function input() function input()
{ {
printf('<span style="text-decoration: none" class="inplace_edit icon" id="%s">', $this->name);
if ($this->value==1) if ($this->value==1)
{ {
echo $this->iconon; $icon=$this->iconon;
$color="green";
} }
elseif ($this->value==0) elseif ($this->value==0)
{ {
echo $this->iconoff; $icon=$this->iconoff;
$color="red";
} }
else else
{ {
throw new Exception(_("Invalide value")); throw new Exception(_("Invalide value"));
} }
printf('<span style="text-decoration: none;color:%s" class="inplace_edit icon" id="%s">', $color,$this->name);
echo $icon;
echo '</span>'; echo '</span>';
echo <<<EOF echo <<<EOF
<script> <script>

View file

@ -360,9 +360,11 @@ if ( $action == "view" )
for (i = 0;i < a_select.length;i++) { for (i = 0;i < a_select.length;i++) {
str_id = new String( a_select[i].id); str_id = new String( a_select[i].id);
if ( str_id.search(/action/) > -1 ) { if ( str_id.search(/action/) > -1 ) {
if ( p_value == 1 ) { if ( p_value == 0 ) {
a_select[i].setStyle("color:red");
a_select[i].innerHTML='&#xf204'; a_select[i].innerHTML='&#xf204';
} else { } else {
a_select[i].setStyle("color:green");
a_select[i].innerHTML='&#xf205'; a_select[i].innerHTML='&#xf205';
} }
} }