You are here

function og_ui_og_ui_get_group_admin in Organic groups 7

Same name and namespace in other branches
  1. 7.2 og_ui/og_ui.module \og_ui_og_ui_get_group_admin()

Implementation of hook_og_ui_get_group_admin()

File

og_ui/og_ui.module, line 659
Organic groups UI.

Code

function og_ui_og_ui_get_group_admin($gid) {
  $items = array();
  $default_access = og_is_group_default_access($gid);
  if (og_user_access($gid, 'add user')) {
    $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".
      // @see og_ui_group_admin_overview().
      'href' => 'admin/people/add-user',
    );
  }
  if (og_user_access($gid, 'approve and deny subscription')) {
    $items['people'] = array(
      'title' => t('People'),
      'description' => t('Manage the group members.'),
      'href' => "admin/people",
    );
  }
  $items['roles'] = array(
    'title' => !$default_access ? t('Roles') : t('Roles (read-only)'),
    'description' => !$default_access ? t('Manage the group roles.') : t('View the group roles.'),
    'href' => "admin/people/roles",
  );
  $items['permissions'] = array(
    'title' => !$default_access ? t('Permissions') : t('Permissions (read-only)'),
    'description' => !$default_access ? t('Manage the group permissions.') : t('View the group permissions.'),
    'href' => "admin/people/permissions",
  );
  return $items;
}