You are here

function content_profile_help in Content Profile 6

Implementation of hook_help().

Show node submission guidelines for content profile node forms.

File

./content_profile.module, line 493

Code

function content_profile_help($path, $arg) {
  if (preg_match('/user\\/\\%\\/(profile|edit)\\/(.*)/', $path, $matches)) {
    foreach (content_profile_get_types('names') as $type => $typename) {
      if ($type == $matches[2]) {
        $node = content_profile_load($type, $arg[1]);
        if ($node) {
          return node_help('node/%/edit', array(
            1 => $node->nid,
          ));
        }
        else {
          return node_help('node/add/' . $type, array(
            'node',
            'add',
            $type,
          ));
        }
      }
    }
  }
}