You are here

function og_views_data_og_ancestry in Organic groups 6.2

Same name and namespace in other branches
  1. 6 modules/og_views/og_views.views.inc \og_views_data_og_ancestry()

File

modules/og_views/og_views.views.inc, line 306

Code

function og_views_data_og_ancestry() {
  $data['og_ancestry']['table']['group'] = t('Organic groups');
  $data['og_ancestry']['table']['join'] = array(
    'node' => array(
      'left_field' => 'nid',
      'field' => 'nid',
    ),
  );
  $data['og_ancestry']['group_nid'] = array(
    'title' => t('Groups'),
    'help' => t('The groups for a post.'),
    'field' => array(
      'handler' => 'og_views_handler_field_og_group_nids',
    ),
    'relationship' => array(
      'title' => t('Group node (post)'),
      'help' => t("Bring in information about the group node based on a post's groups."),
      'base' => 'node',
      'field' => 'group_nid',
      'handler' => 'views_handler_relationship',
      'label' => t('Group node (post)'),
    ),
    'filter' => array(
      'handler' => 'og_views_handler_filter_og_group_nid',
      'numeric' => TRUE,
      'allow empty' => TRUE,
      // To select posts with no groups. Requires http://drupal.org/node/340824
      'help' => t('<strong>Posts</strong> are filtered for specific organic groups.'),
    ),
    'argument' => array(
      'name' => t('Post: in specified group (by number)'),
      'name field' => 'title',
      // the field to display in the summary.
      'validate type' => 'nid',
      'handler' => 'og_views_handler_argument_og_group_nid',
      'help' => t('<strong>Posts</strong> are filtered for specified organic groups. The page context (if Display is a page) will be set to the first listed group. That means that blocks and breadcrumbs (and theme and locale, if applicable) will be based upon the first specified node id.'),
    ),
  );
  $data['og_ancestry']['nid'] = array(
    'title' => t('Post: Nid'),
    'help' => t('The node ID of the node.'),
    'field' => array(
      'handler' => 'views_handler_field_node',
    ),
  );
  $data['og_ancestry']['picg'] = array(
    'title' => t('OG: Posts in current group'),
    'help' => t('Posts in current group. Useful for blocks where determining context is hard. If page is not in any group context, no nodes are listed and thus a block would not appear.'),
    'filter' => array(
      'handler' => 'og_views_handler_filter_og_picg',
    ),
  );
  return $data;
}