All pastes #102555 Raw Edit

Stuff

public text v1 · immutable
#102555 ·published 2006-07-27 17:42 UTC
rendered paste body
function cnucustom_menu($may_cache) {
  global $user;
  $items = array();

  if ($may_cache) {
    $items[] = array('title'    => t('Map Drupal Users'),
                     'path'     => 'civicrm/map',
                     'access'   => user_access('access CiviCRM'),
                     'callback' => 'cnucustom_uf_matches',
    );
  }

  // we have to override the tabs on the user's page so that we can add
  // a new member splash page and make the 'view' say 'member profile'.
  else {
    if (arg(0) == 'user' && is_numeric(arg(1)) && arg(1) > 0) {
      $title = (arg(1) == $user->uid) ? t('my profile') : t('member profile');
      $items[] = array('path'       => 'user/'. arg(1), 
                       'title'      => $title,
                       'type'       => MENU_CALLBACK,
                       'callback arguments' => array(arg(1)),
                       'callback'   => 'user_view',
                       'access' => 1,
      );
      $items[] = array('path'     => 'user/'. arg(1) .'/view', 
                       'type'     => MENU_DEFAULT_LOCAL_TASK, 
                       'title'    => $title, // "my" or "member"
                       'access'   => 1,
                       'weight'   => -10,
      );
    }
  }

  return $items;
}