You are here

function spaces_user_menu in Spaces 5.2

Same name and namespace in other branches
  1. 6 spaces_user/spaces_user.module \spaces_user_menu()
  2. 6.2 spaces_user/spaces_user.module \spaces_user_menu()

Implementation of hook_menu().

File

./spaces_user.module, line 226

Code

function spaces_user_menu($may_cache) {
  $items = array();
  if (!$may_cache) {

    // Graft spaces local tasks onto user
    if (arg(0) == 'user' && is_numeric(arg(1)) && ($account = user_load(array(
      'uid' => arg(1),
    )))) {
      $space = spaces_get_space();
      if ($space->type == 'user') {
        $spaces_items = spaces_active_space_menu($space, true, 'user/' . arg(1));
        unset($spaces_items['spaces/settings']);
        $items = $items + $spaces_items;
      }
    }
  }
  return $items;
}