message_handler_field_realm.inc in Message 6
Field handler to translate a realm type into its readable form.
File
includes/message_handler_field_realm.incView source
<?php
// $Id: message_handler_field_realm.inc,v 1.2 2010/06/07 10:54:11 amitaibu Exp $
/**
* @file
* Field handler to translate a realm type into its readable form.
*/
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;
}
}
}
Classes
Name | Description |
---|---|
message_handler_field_realm | @file Field handler to translate a realm type into its readable form. |