You are here

public function bat_type_handler_type_revision_status_field::render in Booking and Availability Management Tools for Drupal 7

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

modules/bat_unit/views/bat_type_handler_type_revision_status_field.inc, line 35
Contains a Views field handler to take care of displaying the correct label for unit bundles.

Class

bat_type_handler_type_revision_status_field

Code

public function render($values) {
  $type_id = $this
    ->get_value($values, 'type_id');
  $revision_id = $this
    ->get_value($values, 'revision_id');
  $type = bat_type_load($type_id);
  $type_revision = bat_type_load_revision($revision_id);
  $is_current = $revision_id == $type->revision_id;
  $is_pending = $revision_id > $type->revision_id;
  if ($is_pending) {
    return t('in draft/pending publication');
  }
  elseif ($is_current) {
    return t('current revision (published)');
  }
  return t('archived');
}