og_ui.api.php

  1. 7.x-2.x og/og_ui/og_ui.api.php
  2. 7.x-1.x og/og_ui/og_ui.api.php

Hooks provided by the Organic groups UI module.

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.

File

og/og_ui/og_ui.api.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Hooks provided by the Organic groups UI module.
  5. */
  6. /**
  7. * @addtgrouproup hooks
  8. * @{
  9. */
  10. /**
  11. * Add a menu item that should appear in the group admin page.
  12. */
  13. function hook_og_ui_get_group_admin() {
  14. $items = array();
  15. $items['add_people'] = array(
  16. 'title' => t('Add people'),
  17. 'description' => t('Add group members.'),
  18. // The final URL will be "group/$entity_type/$etid/admin/people/add-user".
  19. 'href' => 'admin/people/add-user',
  20. );
  21. return $items;
  22. }
  23. /**
  24. * Alter existing group admin menu items.
  25. *
  26. * @param $data
  27. * The menu items passed by reference.
  28. * @param $gid
  29. * The group being viewed.
  30. */
  31. function hook_og_ui_get_group_admin_alter(&$data, $context) {
  32. // Hijack the add people to use a custom implementation.
  33. if (og_ui_user_access_group('add user', $context['entity_type'], $context['etid'])) {
  34. $data['add_people']['href'] = 'admin/people/mass-add-user-filter';
  35. }
  36. }
  37. /**
  38. * @} End of "addtgrouproup hooks".
  39. */