You are here

function _views_file_status in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 8.3 modules/file.views.inc \_views_file_status()
  2. 6.3 modules/system.views.inc \_views_file_status()
  3. 6.2 modules/system.views.inc \_views_file_status()

Obtain a human readable label for a file's status.

Parameters

int $choice: Indicate the file's status, expected to be either '0' for a temporary file or the value of FILE_STATUS_PERMANENT for a permanent file; any other value will be indicated as being 'Unknown'.

Return value

string A string representing the file's status.

2 calls to _views_file_status()
views_handler_field_file_status::render in modules/system/views_handler_field_file_status.inc
Render the field.
views_handler_filter_file_status::get_value_options in modules/system/views_handler_filter_file_status.inc
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.

File

modules/system.views.inc, line 599
Provide views data and handlers for system.module.

Code

function _views_file_status($choice = NULL) {
  $status = array(
    0 => t('Temporary'),
    FILE_STATUS_PERMANENT => t('Permanent'),
  );
  if (isset($choice)) {
    return isset($status[$choice]) ? $status[$choice] : t('Unknown');
  }
  return $status;
}