You are here

function hosting_package_handler_field_status::render in Hosting 7.3

Same name and namespace in other branches
  1. 7.4 package/includes/views/handlers/hosting_package_handler_field_status.inc \hosting_package_handler_field_status::render()

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides hosting_site_handler_field_status::render

File

package/includes/views/handlers/hosting_package_handler_field_status.inc, line 17

Class

hosting_package_handler_field_status
A handler for the Package status field.

Code

function render($values) {
  $value = $values->{$this->field_alias};
  $output = $value ? t('Enabled') : t('Disabled');
  switch ($this->options['status_mode']) {
    case 'image':
      return "<span class='hosting-status hosting-status-icon'></span>";
    case 'text_image':
      return "<span class='hosting-status'>{$output}</span>";
    case 'class':
      return $value ? 'hosting-success' : 'hosting-info';
  }
  return $output;
}