You are here

message_notify_example.views_default.inc in Message Notify 7.2

Same filename and directory in other branches
  1. 7 message_notify_example/message_notify_example.views_default.inc

File

message_notify_example/message_notify_example.views_default.inc
View source
<?php

/**
 * @file
 * message_notify_example.views_default.inc
 */

/**
 * Implements hook_views_default_views().
 */
function message_notify_example_views_default_views() {
  $export = array();
  $view = new view();
  $view->name = 'message_notify_example';
  $view->description = 'Show messages that were sent by email.';
  $view->tag = 'default';
  $view->base_table = 'message';
  $view->human_name = 'Message notify example';
  $view->core = 7;
  $view->api_version = '3.0';
  $view->disabled = FALSE;

  /* Edit this to true to make a default view disabled initially */

  /* Display: Master */
  $handler = $view
    ->new_display('default', 'Master', 'default');
  $handler->display->display_options['title'] = 'Message notify example';
  $handler->display->display_options['access']['type'] = 'none';
  $handler->display->display_options['cache']['type'] = 'none';
  $handler->display->display_options['query']['type'] = 'views_query';
  $handler->display->display_options['query']['options']['query_comment'] = FALSE;
  $handler->display->display_options['exposed_form']['type'] = 'basic';
  $handler->display->display_options['pager']['type'] = 'full';
  $handler->display->display_options['pager']['options']['items_per_page'] = '25';
  $handler->display->display_options['style_plugin'] = 'table';
  $handler->display->display_options['style_options']['columns'] = array(
    'field_message_rendered_body' => 'field_message_rendered_body',
    'field_message_rendered_subject' => 'field_message_rendered_subject',
    'timestamp' => 'timestamp',
    'name' => 'name',
  );
  $handler->display->display_options['style_options']['default'] = '-1';
  $handler->display->display_options['style_options']['info'] = array(
    'field_message_rendered_body' => array(
      'sortable' => 0,
      'default_sort_order' => 'asc',
      'align' => '',
      'separator' => '',
      'empty_column' => 0,
    ),
    'field_message_rendered_subject' => array(
      'sortable' => 0,
      'default_sort_order' => 'asc',
      'align' => '',
      'separator' => '',
      'empty_column' => 0,
    ),
    'timestamp' => array(
      'sortable' => 0,
      'default_sort_order' => 'asc',
      'align' => '',
      'separator' => '',
      'empty_column' => 0,
    ),
    'name' => array(
      'sortable' => 0,
      'default_sort_order' => 'asc',
      'align' => '',
      'separator' => '',
      'empty_column' => 0,
    ),
  );

  /* Header: Global: Text area */
  $handler->display->display_options['header']['area']['id'] = 'area';
  $handler->display->display_options['header']['area']['table'] = 'views';
  $handler->display->display_options['header']['area']['field'] = 'area';
  $handler->display->display_options['header']['area']['empty'] = FALSE;
  $handler->display->display_options['header']['area']['content'] = 'Below are all the Messages that were sent, and their output saved into fields, to create a "Message log".';
  $handler->display->display_options['header']['area']['format'] = 'filtered_html';

  /* No results behavior: Global: Text area */
  $handler->display->display_options['empty']['area']['id'] = 'area';
  $handler->display->display_options['empty']['area']['table'] = 'views';
  $handler->display->display_options['empty']['area']['field'] = 'area';
  $handler->display->display_options['empty']['area']['empty'] = FALSE;
  $handler->display->display_options['empty']['area']['content'] = 'No Messages were sent by email.';
  $handler->display->display_options['empty']['area']['format'] = 'filtered_html';

  /* Relationship: Message: User uid */
  $handler->display->display_options['relationships']['user']['id'] = 'user';
  $handler->display->display_options['relationships']['user']['table'] = 'message';
  $handler->display->display_options['relationships']['user']['field'] = 'user';

  /* Field: Message: Rendered subject */
  $handler->display->display_options['fields']['field_message_rendered_subject']['id'] = 'field_message_rendered_subject';
  $handler->display->display_options['fields']['field_message_rendered_subject']['table'] = 'field_data_field_message_rendered_subject';
  $handler->display->display_options['fields']['field_message_rendered_subject']['field'] = 'field_message_rendered_subject';

  /* Field: Message: Rendered body */
  $handler->display->display_options['fields']['field_message_rendered_body']['id'] = 'field_message_rendered_body';
  $handler->display->display_options['fields']['field_message_rendered_body']['table'] = 'field_data_field_message_rendered_body';
  $handler->display->display_options['fields']['field_message_rendered_body']['field'] = 'field_message_rendered_body';

  /* Field: User: Name */
  $handler->display->display_options['fields']['name']['id'] = 'name';
  $handler->display->display_options['fields']['name']['table'] = 'users';
  $handler->display->display_options['fields']['name']['field'] = 'name';
  $handler->display->display_options['fields']['name']['relationship'] = 'user';

  /* Field: Message: Timestamp */
  $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
  $handler->display->display_options['fields']['timestamp']['table'] = 'message';
  $handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
  $handler->display->display_options['fields']['timestamp']['date_format'] = 'long';

  /* Sort criterion: Message: Message ID */
  $handler->display->display_options['sorts']['mid']['id'] = 'mid';
  $handler->display->display_options['sorts']['mid']['table'] = 'message';
  $handler->display->display_options['sorts']['mid']['field'] = 'mid';
  $handler->display->display_options['sorts']['mid']['order'] = 'DESC';

  /* Filter criterion: Message: Type */
  $handler->display->display_options['filters']['type']['id'] = 'type';
  $handler->display->display_options['filters']['type']['table'] = 'message';
  $handler->display->display_options['filters']['type']['field'] = 'type';
  $handler->display->display_options['filters']['type']['value'] = array(
    'comment_insert' => 'comment_insert',
  );

  /* Display: Page */
  $handler = $view
    ->new_display('page', 'Page', 'page');
  $handler->display->display_options['path'] = 'message-notify-example';
  $handler->display->display_options['menu']['type'] = 'normal';
  $handler->display->display_options['menu']['title'] = 'Message notify example';
  $handler->display->display_options['menu']['weight'] = '0';
  $export['message_notify_example'] = $view;
  return $export;
}