You are here

function certificate_menu in Certificate 7.2

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.3 certificate.module \certificate_menu()
  5. 3.x certificate.module \certificate_menu()

Implements hook_menu().

File

./certificate.module, line 57
Certificate module.

Code

function certificate_menu() {
  $items = array();
  $items['admin/structure/certificates'] = array(
    'title' => 'Certificates',
    'description' => 'Manage certificates and mappings.',
    'access arguments' => array(
      'administer certificates',
    ),
    'file' => 'certificate.admin.inc',
    'page callback' => 'certificate_templates_list',
  );
  $items['admin/structure/certificates/templates'] = array(
    'title' => 'List',
    'access arguments' => array(
      'administer certificates',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'file' => 'certificate.admin.inc',
    'page callback' => 'certificate_templates_list',
    'weight' => -5,
  );
  $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/list'] = array(
    'title' => 'Global',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -5,
  );
  $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/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/clear'] = array(
    'title' => 'Clear',
    'access arguments' => array(
      'administer certificates',
    ),
    'file' => 'certificate.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'certificate_admin_clear_form',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 99,
  );
  $items['admin/structure/certificates/templates/preview/%'] = array(
    'title' => 'Certificate Preview',
    'description' => 'Display earned certificate for this node',
    'page callback' => 'certificate_preview',
    'page arguments' => array(
      5,
    ),
    '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,
  );
  $items['admin/structure/certificates/add'] = array(
    'title' => 'Create new certificate',
    'page callback' => 'drupal_goto',
    'page arguments' => array(
      'node/add/certificate',
      array(
        'query' => array(
          'destination' => 'admin/structure/certificates',
        ),
      ),
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'create',
      'certificate',
    ),
    'type' => MENU_LOCAL_ACTION,
  );
  return $items;
}