public static function greyOut($type, $value, array $attributes = array())
{
$grayedOutClass = 'fork-data-grid-grayed-out grayedOut';
$greyOut = false;
switch ($type) {
case 'visible':
case 'active':
case 'published':
if ($value == 'N') {
$greyOut = true;
}
break;
case 'hidden':
if ($value == 'Y') {
$greyOut = true;
}
break;
}
// add the grayedOut class to any existing attributes
if ($greyOut) {
if (array_key_exists('class', $attributes)) {
$attributes['class'] .= ' ' . $grayedOutClass;
} else {
$attributes['class'] = $grayedOutClass;
}
}
return $attributes;
}