Backend\Core\Engine\DataGridFunctions::greyOut PHP Method

greyOut() public static method

'visible', 'hidden', 'active', 'published'
public static greyOut ( string $type, string $value, array $attributes = [] ) : array
$type string The type of column. This is given since some columns can have different meanings than others.
$value string
$attributes array
return array
    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;
    }