You are here

function nodehierarchy_views_tables in Node Hierarchy 5

Implementation of hook_views_tables().

File

nodehierarchy_views/nodehierarchy_views.module, line 205
Views.module integration for nodehierarchy.module.

Code

function nodehierarchy_views_tables() {
  $tables['nodehierarchy'] = array(
    'name' => 'nodehierarchy',
    'provider' => 'internal',
    'join' => array(
      'left' => array(
        'table' => 'node',
        'field' => 'nid',
      ),
      'right' => array(
        'field' => 'nid',
      ),
    ),
    'fields' => array(
      'order_by' => array(
        'name' => t('Node Hierarchy: Sort Order'),
        'sortable' => TRUE,
        'help' => t('This will display the sort order of a node in the hierarchy.'),
      ),
      'nid' => array(
        'name' => t('Node Hierarchy: Actions'),
        'sortable' => FALSE,
        'handler' => 'views_handler_field_nodehierarchy_actions',
        'help' => t('This will display hierarchy actions such as move up, move down, view and edit.'),
      ),
      'parent' => array(
        'name' => t('Node Hierarchy: Parent'),
        'sortable' => FALSE,
        'handler' => 'views_handler_field_nodehierarchy_parent',
        'help' => t('This will display the nodehierarchy parent for the node.'),
        'option' => array(
          '#type' => 'select',
          '#options' => array(
            'default' => 'Title (link)',
            'plain' => 'Title (no link)',
          ),
        ),
      ),
    ),
    'sorts' => array(
      'order_by' => array(
        'name' => t('Node Hierarchy: Sort Order'),
        'help' => t('This will allow you to sort by the heirarchical sort order.'),
      ),
    ),
  );
  return $tables;
}