You are here

function node_registration_menu in Node registration 7

Implements hook_menu().

File

./node_registration.module, line 253

Code

function node_registration_menu() {
  $module_path = _node_registration_type_to_uri('node_registration');

  // Admin pages.
  $items['admin/structure/' . $module_path] = array(
    'title' => 'Node registration',
    'description' => 'Manage Registration structure',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'node_registration_types_form',
    ),
    'access arguments' => array(
      'administer node registration',
    ),
    'file' => 'includes/node_registration.forms.inc',
  );
  $items['admin/structure/' . $module_path . '/manage/%node_registration_type'] = array(
    'title' => 'Type settings',
    'title callback' => 'node_registration_type_settings_page_title',
    'title arguments' => array(
      4,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'node_registration_type_settings',
      4,
    ),
    'access arguments' => array(
      'administer node registration',
    ),
    'file' => 'includes/node_registration.forms.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/structure/' . $module_path . '/manage/%node_registration_type/settings'] = array(
    'title callback' => 'node_registration_type_settings_page_title',
    'title arguments' => array(
      4,
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );

  // Registration entity pages.
  $items['registration/%node_registration'] = array(
    'title callback' => 'node_registration_page_title',
    'title arguments' => array(
      1,
    ),
    'page callback' => 'node_registration_view',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'node_registration_access',
    'access arguments' => array(
      1,
      'view',
    ),
  );
  $items['registration/%node_registration/view'] = array(
    'title' => 'View',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['registration/%node_registration/edit'] = array(
    'title' => 'Edit',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'node_registration_form',
      1,
    ),
    'access callback' => 'node_registration_access',
    'access arguments' => array(
      1,
      'edit',
    ),
    'file' => 'includes/node_registration.forms.inc',
    'weight' => 10,
    'type' => MENU_LOCAL_TASK,
  );
  $items['registration/%node_registration/cancel'] = array(
    'title' => 'Cancel',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'node_registration_cancel_confirm',
      1,
    ),
    'access callback' => 'node_registration_access',
    'access arguments' => array(
      1,
      'cancel',
    ),
    'file' => 'includes/node_registration.forms.inc',
    'weight' => 11,
    'type' => MENU_LOCAL_TASK,
  );
  $items['registration/%node_registration/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'node_registration_delete_confirm',
      1,
    ),
    'access callback' => 'node_registration_access',
    'access arguments' => array(
      1,
      'delete',
    ),
    'file' => 'includes/node_registration.forms.inc',
    'weight' => 12,
    'type' => MENU_LOCAL_TASK,
  );

  // Registration edit/toggle/ajax.
  $items['registration/%node_registration/toggle/nojs/%/%'] = array(
    'title' => 'Toggle NR flag',
    'page callback' => 'node_registration_toggle_flag',
    'page arguments' => array(
      1,
      3,
      4,
      5,
    ),
    'access callback' => 'node_registration_access_toggle_with_token',
    'access arguments' => array(
      1,
      4,
      5,
    ),
    'file' => 'includes/node_registration.forms.inc',
    'type' => MENU_CALLBACK,
  );
  $items['registration/%node_registration/toggle/ajax/%/%'] = $items['registration/%node_registration/toggle/nojs/%/%'];

  // Registration devel.
  if (module_exists('devel')) {
    $devel_path = drupal_get_path('module', 'devel');
    $items['registration/%node_registration/devel'] = array(
      'title' => 'Devel',
      'page callback' => 'devel_load_object',
      'page arguments' => array(
        'node_registration',
        1,
      ),
      'access arguments' => array(
        'access devel information',
      ),
      'type' => MENU_LOCAL_TASK,
      'file' => 'devel.pages.inc',
      'file path' => $devel_path,
      'weight' => 100,
    );
    $items['registration/%node_registration/devel/load'] = array(
      'title' => 'Load',
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items['registration/%node_registration/devel/render'] = array(
      'title' => 'Render',
      'page callback' => 'devel_render_object',
      'page arguments' => array(
        'node_registration',
        1,
      ),
      'access arguments' => array(
        'access devel information',
      ),
      'file' => 'devel.pages.inc',
      'file path' => $devel_path,
      'type' => MENU_LOCAL_TASK,
      'weight' => 100,
    );
  }

  // Node local tasks.
  $items['node/%node/register'] = array(
    'title' => 'Register',
    'page callback' => 'node_registration_register_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'node_registration_register_page_access',
    'access arguments' => array(
      1,
    ),
    'file' => 'includes/node_registration.forms.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 9,
  );
  $items['node/%node/register/%user'] = array(
    'title' => 'Register',
    'page callback' => 'node_registration_register_page',
    'page arguments' => array(
      1,
      3,
    ),
    'access callback' => 'node_registration_register_other_access',
    'access arguments' => array(
      1,
      3,
    ),
    'file' => 'includes/node_registration.forms.inc',
    'weight' => 10,
  );
  $items['node/%node/' . $module_path . '/list'] = array(
    'title' => 'Registrations',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'tab_parent' => 'node/%/node_registration',
  );
  $items['node/%node/' . $module_path . '/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'node_registration_registrations_settings_form',
      1,
    ),
    'access callback' => 'node_registration_node_access',
    'access arguments' => array(
      1,
      'registration settings',
    ),
    'file' => 'includes/node_registration.forms.inc',
    'weight' => 9,
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%node/' . $module_path . '/broadcast'] = array(
    'title' => 'E-mail registrees',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'node_registration_registrations_broadcast_form',
      1,
    ),
    'access callback' => 'node_registration_node_access',
    'access arguments' => array(
      1,
      'registration settings',
    ),
    'file' => 'includes/node_registration.forms.inc',
    'weight' => 10,
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}