You are here

class message_handler_argument_realm in Message 6

@file Argument handler to accept a realm.

Hierarchy

Expanded class hierarchy of message_handler_argument_realm

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

File

includes/message_handler_argument_realm.inc, line 8
Argument handler to accept a realm.

View source
class message_handler_argument_realm extends views_handler_argument {
  function construct() {
    parent::construct('realm');
  }

  /**
   * Override the behavior of summary_name(). Get the user friendly version
   * of the realm.
   */
  function summary_name($data) {
    return $this
      ->realm_type($data->{$this->name_alias});
  }

  /**
   * Override the behavior of title(). Get the user friendly version of the
   * realm.
   */
  function title() {
    return $this
      ->realm_type($this->argument);
  }
  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

Namesort descending Modifiers Type Description Overrides
message_handler_argument_realm::construct function
message_handler_argument_realm::realm_type function
message_handler_argument_realm::summary_name function Override the behavior of summary_name(). Get the user friendly version of the realm.
message_handler_argument_realm::title function Override the behavior of title(). Get the user friendly version of the realm.