You are here

function og_ui_menu_bundle_roles_title_callback in Organic groups 7.2

Title callback; Return the title for role or permission editing, based on context.

1 string reference to 'og_ui_menu_bundle_roles_title_callback'
og_ui_menu in og_ui/og_ui.module
Implements hook_menu().

File

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

Code

function og_ui_menu_bundle_roles_title_callback($title, $group_type, $bundle, $rid = 0) {
  if ($rid) {

    // Get group type and bundle from role.
    $role = og_role_load($rid);
    if (!$role->group_type) {
      $title = str_replace('@type', '', $title);
      $title = str_replace('@bundle', t('Global'), $title);
    }
    $bundle = $role->group_bundle;
    $group_type = $role->group_type;
    $title = str_replace('@role', check_plain($role->name), $title);
  }
  $entity_info = entity_get_info($group_type);
  if (!empty($entity_info['label'])) {
    $title = str_replace('@type', check_plain($entity_info['label']), $title);
    $title = str_replace('@bundle', check_plain($entity_info['bundles'][$bundle]['label']), $title);
  }
  return $title;
}