You are here

function og_context_og_context_negotiation_info in Organic groups 7.2

Same name and namespace in other branches
  1. 7 og_context/og_context.module \og_context_og_context_negotiation_info()

Implements hook_og_context_negotiation_info().

File

og_context/og_context.module, line 111
Get a group from a viewed page.

Code

function og_context_og_context_negotiation_info() {
  $providers = array();
  $providers['url'] = array(
    'name' => t('URL (content create)'),
    'description' => t('Select groups if they were passed in the node create URL (e.g. node/add/post?og_group_ref=4,5,6). <em>Note: Depends on <a href="@url">Entity reference prepopulate</a> module, and enabling "Prepopulate" in the field settings.</em>', array(
      '@url' => 'http://drupal.org/project/entityreference_prepopulate',
    )),
    'callback' => 'og_context_handler_url',
  );
  $providers['node'] = array(
    'name' => t('Node'),
    'description' => t("Determine context by checking if a node is a group or a group content."),
    'callback' => 'og_context_handler_node',
    'menu path' => array(
      'node/%',
      'group/%/%/admin',
    ),
  );
  $providers['user-view'] = array(
    'name' => t('User view'),
    'description' => t("Determine context by checking if a user is a group or a group content on the 'user view' page."),
    'callback' => 'og_context_handler_user_view',
    'menu path' => array(
      'user/%',
    ),
  );
  $providers['user-edit'] = array(
    'name' => t('User edit'),
    'description' => t("Determine context by checking if a user is a group or a group content on the 'user edit' page."),
    'callback' => 'og_context_handler_user_edit',
    'menu path' => array(
      'user/%/edit',
    ),
  );
  $providers['comment'] = array(
    'name' => t('Comment'),
    'description' => t("Determine context by checking if the parent content of the comment belongs to a group"),
    'callback' => 'og_context_handler_comment',
    'menu path' => array(
      'comment/reply/%',
      'comment/%',
    ),
  );
  return $providers;
}