You are here

function certificate_menu in Certificate 7.3

Same name and namespace in other branches
  1. 8.3 certificate.module \certificate_menu()
  2. 6.2 certificate.module \certificate_menu()
  3. 6 certificate.module \certificate_menu()
  4. 7.2 certificate.module \certificate_menu()
  5. 3.x certificate.module \certificate_menu()

Implements hook_menu().

File

./certificate.module, line 85
Certificate module.

Code

function certificate_menu() {
  $items = array();
  $items['admin/structure/certificates/mapping'] = array(
    'title' => 'Mapping',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'certificate_settings_form',
    ),
    'access arguments' => array(
      'administer certificates',
    ),
    'file' => 'certificate.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -4,
  );
  $items['admin/structure/certificates/mapping/groups'] = array(
    'title' => 'Field groups',
    'description' => 'Set up certificate field groups',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'certificate_field_grouping_form',
    ),
    'access arguments' => array(
      'administer certificates',
    ),
    'file' => 'certificate.admin.inc',
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/structure/certificates/mapping/list'] = array(
    'title' => 'Global',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -5,
  );
  $items['admin/structure/certificates/mapping/groups/add'] = array(
    'title' => 'Add field group',
    'description' => 'Add a field group',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'certificate_field_grouping_add_form',
    ),
    'access arguments' => array(
      'administer certificates',
    ),
    'file' => 'certificate.admin.inc',
    'type' => MENU_LOCAL_ACTION,
  );

  /*
   $items['admin/structure/certificates/mapping/groups/delete/%'] = array(
   'title' => 'Delete field group',
   'description' => 'Delete a field group',
   'page callback' => 'drupal_get_form',
   'page arguments' => array('certificate_field_grouping_delete_form'),
   'page arguments' => array(6),
   'access arguments' => array('administer certificates'),
   'file' => 'certificate.admin.inc',
   'type' => MENU_LOCAL_TASK,
   );
  */
  $items['admin/structure/certificates/settings'] = array(
    'title' => 'Settings',
    'description' => 'Certificate settings.',
    'access arguments' => array(
      'administer certificates',
    ),
    'file' => 'certificate.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'certificate_admin_settings_form',
    ),
  );
  $items['admin/structure/certificates/preview/%'] = array(
    'title' => 'Certificate preview',
    'description' => 'Display earned certificate for this node',
    'page callback' => 'certificate_preview',
    'page arguments' => array(
      4,
    ),
    'access arguments' => array(
      'administer certificates',
    ),
    'file' => 'certificate.pages.inc',
    'type' => MENU_CALLBACK,
  );

  // Certificate tab on nodes.
  $items['node/%node/certificate'] = array(
    'title' => 'Certificate',
    'description' => 'Display earned certificate for this node',
    'page callback' => 'certificate_node_certificate',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'certificate_can_access_certificate',
    'access arguments' => array(
      1,
    ),
    'file' => 'certificate.pages.inc',
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}