You are here

class message_handler_field_message_render in Message 6

Same name and namespace in other branches
  1. 7 includes/views/handlers/message_handler_field_message_render.inc \message_handler_field_message_render

Views field handler for rendering a message.

Hierarchy

Expanded class hierarchy of message_handler_field_message_render

2 string references to 'message_handler_field_message_render'
message_views_data in includes/message.views.inc
Implementation of hook_views_data().
message_views_pre_render in ./message.module
Implementation of hook_views_pre_render().

File

includes/message_handler_field_message_render.inc, line 14
Contains the message field handler.

View source
class message_handler_field_message_render extends views_handler_field {
  function option_definition() {
    $options = parent::option_definition();
    $options['skip_access'] = array(
      'default' => FALSE,
    );
    return $options;
  }
  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    $form['skip_access'] = array(
      '#type' => 'checkbox',
      '#title' => t('Skip access'),
      '#options' => array(
        FALSE => t('No'),
        TRUE => t('Yes'),
      ),
      '#default_value' => !empty($this->options['skip_access']),
      '#description' => t('Determine if access should be checked before showing a message. You may disable this and use filters to filter out unaccessable messages from the user.'),
    );
  }
  function render($values) {
    if (!empty($values->iid)) {
      $message_instance = message_instance_load($values->iid);
      return message_show_message($message_instance, $this->options['skip_access']);
    }
  }

}

Members