You are here

og_ui.api.php in Organic groups 7.2

Same filename and directory in other branches
  1. 7 og_ui/og_ui.api.php

Hooks provided by the Organic groups UI module.

File

og_ui/og_ui.api.php
View source
<?php

/**
 * @file
 * Hooks provided by the Organic groups UI module.
 */

/**
 * @addtgrouproup hooks
 * @{
 */

/**
 * Add a menu item that should appear in the group admin page.
 */
function hook_og_ui_get_group_admin() {
  $items = array();
  $items['add_people'] = array(
    'title' => t('Add people'),
    'description' => t('Add group members.'),
    // The final URL will be "group/$entity_type/$etid/admin/people/add-user".
    'href' => 'admin/people/add-user',
  );
  return $items;
}

/**
 * Alter existing group admin menu items.
 *
 * @param $data
 *   The menu items passed by reference.
 * @param $gid
 *   The group being viewed.
 */
function hook_og_ui_get_group_admin_alter(&$data, $context) {

  // Hijack the add people to use a custom implementation.
  if (og_ui_user_access_group('add user', $context['entity_type'], $context['etid'])) {
    $data['add_people']['href'] = 'admin/people/mass-add-user-filter';
  }
}

/**
 * @} End of "addtgrouproup hooks".
 */

Functions

Namesort descending Description
hook_og_ui_get_group_admin Add a menu item that should appear in the group admin page.
hook_og_ui_get_group_admin_alter Alter existing group admin menu items.