You are here

function content_profile_default_path_handler in Content Profile 6

Default path handler for content profile, which uses the default system paths

Parameters

$action 'add' or 'edit:

$arg For 'add' the content type, for 'edit' the node to be edited:

$uid the uid of the profile's owner.:

2 string references to 'content_profile_default_path_handler'
content_profile_get_add_path in ./content_profile.theme.inc
Gets the add path for a content_profile of the active user
content_profile_get_edit_path in ./content_profile.theme.inc
Gets the edit path for a content_profile

File

./content_profile.theme.inc, line 121
Theme and template preprocessing code

Code

function content_profile_default_path_handler($action, $arg, $uid) {
  $type = $action == 'add' ? $arg : $arg->type;
  if (content_profile_get_settings($type, 'edit_tab') == 'top') {
    return 'user/' . $uid . '/profile/' . $type;
  }
  elseif (content_profile_get_settings($type, 'edit_tab') == 'sub') {
    return 'user/' . $uid . '/edit/' . $type;
  }
  elseif ($action == 'add') {
    return 'node/add/' . str_replace('_', '-', $arg);
  }
  else {
    return 'node/' . $arg->nid . '/edit';
  }
}