You are here

function advanced_forum_views_data_alter in Advanced Forum 6.2

Same name and namespace in other branches
  1. 7.2 includes/views/advanced_forum.views.inc \advanced_forum_views_data_alter()

Use views_data_alter to add items to the node table that are relevant to topic icons.

File

includes/views/advanced_forum.views.inc, line 32
Views integration for advanced_forum.

Code

function advanced_forum_views_data_alter(&$data) {

  // Topic icon
  $data['node']['topic_icon'] = array(
    'title' => t('Topic Icon'),
    'help' => t('Icon that shows new posts, hot, sticky, locked, etc.'),
    'field' => array(
      'handler' => 'advanced_forum_handler_field_node_topic_icon',
    ),
  );
  $data['node']['topic_pager'] = array(
    'title' => t('Topic Pager'),
    'help' => t('Small pager for individual topics.'),
    'field' => array(
      'handler' => 'advanced_forum_handler_field_node_topic_pager',
    ),
  );

  // Define a custom field handler for node title, which overrides the render_as_link function
  // The purpose of doing so is to avoid character encoding errors caused by views.
  //  @see: http://drupal.org/node/1361526
  // If the problem is fixed in views, this can be removed.
  $data['node']['title']['field']['handler'] = 'advanced_forum_handler_field_node_title';
}