function certificate_menu in Certificate 6
Same name and namespace in other branches
- 8.3 certificate.module \certificate_menu()
- 6.2 certificate.module \certificate_menu()
- 7.3 certificate.module \certificate_menu()
- 7.2 certificate.module \certificate_menu()
- 3.x certificate.module \certificate_menu()
Implementation of hook_menu().
File
- ./
certificate.module, line 108 - Certificate module.
Code
function certificate_menu() {
$items = array();
// Certificate types.
$items['admin/settings/certificate'] = array(
'title' => 'Certificates',
'access arguments' => array(
'administer certificates',
),
'file' => 'certificate.admin.inc',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'certificate_admin_settings_form',
),
);
$items['admin/settings/certificate/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,
);
$items['admin/settings/certificate/types'] = array(
'title' => 'Settings',
'description' => 'Select nodes which are certifiable.',
'access arguments' => array(
'administer certificates',
),
'file' => 'certificate.admin.inc',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -100,
);
$items['admin/settings/certificate/templates'] = array(
'title' => 'Templates',
'access arguments' => array(
'administer certificates',
),
'type' => MENU_LOCAL_TASK,
'file' => 'certificate.admin.inc',
'page callback' => 'certificate_templates_list',
'weight' => -90,
);
$items['admin/settings/certificate/sets'] = array(
'title' => 'Criteria sets',
'access arguments' => array(
'administer certificates',
),
'type' => MENU_LOCAL_TASK,
'page callback' => 'certificate_sets_page',
'file' => 'certificate.admin.inc',
'weight' => -80,
);
$items['admin/settings/certificate/sets/list'] = array(
'title' => 'Sets',
'description' => 'Set up certificate sets',
'page callback' => 'certificate_sets_page',
'access arguments' => array(
'administer certificates',
),
'file' => 'certificate.admin.inc',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['admin/settings/certificate/sets/%certificate_set/criteria'] = array(
'title' => 'Criteria',
'description' => 'Edit certificate type criteria.',
'page callback' => 'certificate_sets_checks_page',
'page arguments' => array(
4,
),
'access arguments' => array(
'administer certificates',
),
'file' => 'certificate.admin.inc',
'type' => MENU_LOCAL_TASK,
);
// Edit/delete type.
$items['admin/settings/certificate/sets/%certificate_set/edit'] = array(
'title' => 'Edit certificate type',
'description' => 'Edit certificate type.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'certificate_sets_form',
4,
),
'access arguments' => array(
'administer certificates',
),
'file' => 'certificate.admin.inc',
);
$items['admin/settings/certificate/sets/%certificate_set/delete'] = array(
'title' => 'Edit certificate type',
'description' => 'Edit certificate type.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'certificate_set_delete_form',
4,
),
'access arguments' => array(
'administer certificates',
),
'file' => 'certificate.admin.inc',
);
// Delete criterion.
$items['admin/settings/certificate/criteria/%certificate_criterion/delete'] = array(
'title' => 'Delete Criterion',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'certificate_criterion_delete_form',
4,
),
'access arguments' => array(
'administer certificates',
),
'file' => 'certificate.admin.inc',
'type' => MENU_CALLBACK,
);
// Certificate templates.
$items['admin/settings/certificate/sets/add'] = array(
'title' => 'New set',
'description' => 'Add a new set of criteria',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'certificate_sets_form',
),
'access arguments' => array(
'administer certificates',
),
'file' => 'certificate.admin.inc',
'weight' => 1,
'type' => MENU_LOCAL_TASK,
);
$items['admin/settings/certificate/templates/add'] = array(
'title' => 'New template',
'description' => 'Add a new certificate template',
'page callback' => 'drupal_goto',
'page arguments' => array(
'node/add/certificate',
array(
'destination' => 'admin/settings/certificate/templates',
),
),
'access arguments' => array(
'administer certificates',
),
'type' => MENU_LOCAL_TASK,
'tab_parent' => 'admin/settings/certificate',
'tab_root' => 'admin/settings/certificate',
'file' => 'certificate.admin.inc',
'weight' => 100,
);
// Certificate template preview.
$items['admin/settings/certificate/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_LOCAL_TASK,
);
// 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/settings/certificate/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,
);
$items['admin/settings/certificate/mapping/list'] = array(
'title' => 'Fields',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items['admin/settings/certificate/mapping/groups'] = array(
'title' => 'Field groups',
'description' => 'Set up certificate field groups',
'page callback' => 'certificate_field_grouping_page',
'access arguments' => array(
'administer certificates',
),
'file' => 'certificate.admin.inc',
'type' => MENU_LOCAL_TASK,
'weight' => -9,
);
$items['admin/settings/certificate/mapping/groups/add'] = array(
'title' => 'Add field group',
'description' => 'Add a field group',
'page callback' => 'certificate_field_grouping_add_page',
'access arguments' => array(
'administer certificates',
),
'file' => 'certificate.admin.inc',
'type' => MENU_LOCAL_TASK,
);
$items['admin/settings/certificate/mapping/groups/delete/%'] = array(
'title' => 'Delete field group',
'description' => 'Delete a field group',
'page callback' => 'certificate_field_grouping_delete_page',
'page arguments' => array(
6,
),
'access arguments' => array(
'administer certificates',
),
'file' => 'certificate.admin.inc',
'type' => MENU_LOCAL_TASK,
);
return $items;
}