You are here

function content_profile_menu in Content Profile 6

Implementation of hook_menu().

File

./content_profile.module, line 22

Code

function content_profile_menu() {
  $items = array();

  //Register a path for each content profile type
  foreach (content_profile_get_types('names') as $type => $typename) {
    $items['admin/content/node-type/' . str_replace('_', '-', $type) . '/edit'] = array(
      'title' => 'Edit',
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items['admin/content/node-type/' . str_replace('_', '-', $type) . '/profile'] = array(
      'title' => 'Content profile',
      'description' => 'Configure the display and management of this content profile.',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'content_profile_admin_settings',
        $type,
      ),
      'access callback' => 'user_access',
      'access arguments' => array(
        'administer nodes',
      ),
      'type' => MENU_LOCAL_TASK,
      'weight' => 1,
    );
  }
  foreach (content_profile_get_types('names') as $type => $type_name) {
    $items['user/%user/profile/' . $type] = array(
      'title callback' => 'check_plain',
      'title' => drupal_ucfirst($type_name),
      'page callback' => 'content_profile_page_edit',
      'page arguments' => array(
        $type,
        1,
      ),
      'access callback' => 'content_profile_page_access',
      'access arguments' => array(
        $type,
        1,
      ),
      'weight' => content_profile_get_settings($type, 'weight'),
      'file' => 'node.pages.inc',
      'file path' => drupal_get_path('module', 'node'),
      'type' => content_profile_get_settings($type, 'edit_tab') == 'top' ? MENU_LOCAL_TASK : MENU_CALLBACK,
    );
  }
  return $items;
}