Revize 1394
Přidáno uživatelem David Raška před asi 12 roky(ů)
freenetis/branches/testing/application/helpers/callback.php | ||
---|---|---|
*/
|
||
public static function active_field($item, $name)
|
||
{
|
||
// 1 => active, 0 => inactive
|
||
switch ($item->$name)
|
||
$color = 'red';
|
||
$state = 'Yes';
|
||
|
||
if (!$item->$name)
|
||
{
|
||
case 1:
|
||
$state = 'active';
|
||
break;
|
||
case 0:
|
||
$state = 'inactive';
|
||
break;
|
||
default:
|
||
$state = 'inactive';
|
||
break;
|
||
$state = 'No';
|
||
$color = 'green';
|
||
}
|
||
|
||
echo html::image(array
|
||
(
|
||
'src' => 'media/images/states/'.$state.'.png',
|
||
'title' => __(''.$state)
|
||
));
|
||
|
||
echo '<span style="color: '.$color.'">'.__(''.$state).'</span>';
|
||
}
|
||
|
||
/**
|
Také k dispozici: Unified diff
Opravy:
- #87: Puntiky predelane na texty + negace stavu, tak aby to davalo smysl