24
Aug
2010
Grayside

Adding Items to the Open Atrium Settings Menu

Recently I dusted off OG Vocabularies with an eye toward integration with OpenAtrium. To my mild surprise, there was really not much that needed to be done. The menu path (node/%node/og/vocab) isn’t great, but that can be tackled later.

All I wanted was to avoid another hidden tab that can only be reached by clicking on Settings > Customize Features. I wanted the group vocabularies to be accessible directly in the Settings menu.

It turns out it’s really simple. There is a hook.

/**
 * Implementation of hook_atrium_admin_links_alter().
 */
function custom_atrium_admin_links_alter(&$links, $space) {
  if ($space->type == 'og') {
    $item = menu_get_item("node/{$space->id}/og/vocab");
    if ($item && $item['access']) {
      $links['og_vocab'] = array(
        'title' => t('Manage Taxonomy'),
        'href' => $item['href'],
      );
    }
  }
}