You are here

function template_preprocess_hacked_file_status in Hacked! 8.2

Parameters

$variables:

File

./hacked.details.inc, line 67

Code

function template_preprocess_hacked_file_status(&$variables) {
  switch ($variables['file']['status']) {
    case HACKED_STATUS_UNHACKED:
      $uri = 'core/misc/icons/73b355/check.svg';
      $text = t('Unchanged');
      break;
    case HACKED_STATUS_DELETED:
      $uri = 'core/misc/icons/e32700/error.svg';
      $text = t('Deleted');
      break;
    case HACKED_STATUS_HACKED:
      $uri = 'core/misc/icons/e29700/warning.svg';
      $text = t('Changed!');
      break;
    case HACKED_STATUS_PERMISSION_DENIED:
      $uri = 'core/misc/icons/e29700/warning.svg';
      $text = t('Permission Denied');
      break;
    case HACKED_STATUS_UNCHECKED:
    default:
      $uri = 'core/misc/icons/e29700/warning.svg';
      $text = t('Unchecked');
      break;
  }
  $variables['status']['attributes'] = new Attribute();
  $variables['status']['label'] = $text;
  $variables['status']['icon'] = [
    '#theme' => 'image',
    '#width' => 18,
    '#height' => 18,
    '#uri' => $uri,
    '#alt' => $text,
    '#title' => $text,
  ];
}