You are here

function nodequeue_views_data_alter in Nodequeue 6.2

Same name and namespace in other branches
  1. 7.3 includes/views/nodequeue.views.inc \nodequeue_views_data_alter()
  2. 7.2 includes/views/nodequeue.views.inc \nodequeue_views_data_alter()

Implementation of hook_views_data_alter().

File

includes/views/nodequeue.views.inc, line 251
nodequeue.views.inc Provides support for the Views module.

Code

function nodequeue_views_data_alter(&$data) {

  // queue relationship
  $data['node']['nodequeue_rel'] = array(
    'group' => t('Nodequeue'),
    'title' => t('Queue (qid)'),
    'help' => t('Create a relationship to a nodequeue. This relationship requires one less JOIN than the queue name relationship, but is less useful if you are exporting this view across sites.'),
    'real field' => 'nid',
    'relationship' => array(
      'handler' => 'nodequeue_handler_relationship_nodequeue',
      'base' => 'nodequeue_nodes',
      'field' => 'nid',
      'label' => t('queue'),
    ),
  );
  $data['node']['nodequeue_rel_queue_name'] = array(
    'group' => t('Nodequeue'),
    'title' => t('Queue (name)'),
    'help' => t('Create a relationship to a nodequeue. This relationship requires an additional JOIN versus the queue qid based relationship, but is more useful for exporting views across sites.'),
    'real field' => 'nid',
    'relationship' => array(
      'handler' => 'nodequeue_handler_relationship_nodequeue_queue_name',
      'base' => 'nodequeue_nodes',
      'field' => 'nid',
      'label' => t('queue'),
    ),
  );

  // links
  $data['node']['nodequeue_links'] = array(
    'group' => t('Nodequeue'),
    'title' => t('Add/remove links'),
    'help' => t('Display add/remove links for all eligible nodequeues. Note that this performs a node_load so could add many extra queries to a view.'),
    'real field' => 'nid',
    'field' => array(
      'handler' => 'nodequeue_handler_field_links',
    ),
  );
  $data['node']['nodequeue_queue_tab'] = array(
    'group' => t('Nodequeue'),
    'title' => t('Link to tab'),
    'help' => t('Display add/remove links for all eligible nodequeues. Note that this performs a node_load so could add many extra queries to a view.'),
    'real field' => 'nid',
    'field' => array(
      'handler' => 'nodequeue_handler_field_queue_tab',
    ),
  );

  // all queues
  $data['node']['nodequeue_all_queues'] = array(
    'group' => t('Nodequeue'),
    'title' => t('All queues'),
    'help' => t('Display all queues a node is a member of.'),
    'real field' => 'nid',
    'field' => array(
      'handler' => 'nodequeue_handler_field_all_queues',
    ),
  );

  // all subqueues
  $data['node']['nodequeue_all_subqueues'] = array(
    'group' => t('Nodequeue'),
    'title' => t('All subqueues'),
    'help' => t('Display all subqueues a node is a member of.'),
    'real field' => 'nid',
    'field' => array(
      'handler' => 'nodequeue_handler_field_all_subqueues',
    ),
  );
}