You are here

class message_handler_field_realm in Message 6

@file Field handler to translate a realm type into its readable form.

Hierarchy

Expanded class hierarchy of message_handler_field_realm

1 string reference to 'message_handler_field_realm'
message_views_data in includes/message.views.inc
Implementation of hook_views_data().

File

includes/message_handler_field_realm.inc, line 8
Field handler to translate a realm type into its readable form.

View source
class message_handler_field_realm extends views_handler_field {
  function render($values) {
    return $this
      ->realm_type($values->{$this->field_alias});
  }
  function realm_type($realm) {
    $output = '';
    ctools_include('plugins');
    $plugins = ctools_get_plugins('message', 'plugins');
    foreach ($plugins as $key => $value) {
      if ($value['realm'] == $realm) {
        $output = check_plain($value['title']);
        break;
      }
    }
    if (empty($output)) {
      return t('Unknown realm');
    }
    else {
      return $output;
    }
  }

}

Members