function scheduler_menu in Scheduler 7
Same name and namespace in other branches
- 5 scheduler.module \scheduler_menu()
- 6 scheduler.module \scheduler_menu()
Implements hook_menu().
File
- ./
scheduler.module, line 46 - Scheduler publishes and unpublishes nodes on dates specified by the user.
Code
function scheduler_menu() {
$items = array();
$items['scheduler/cron'] = array(
'title' => 'Lightweight cron handler',
'description' => 'Run the lightweight cron process',
'page callback' => '_scheduler_run_cron',
'access callback' => '_scheduler_cron_access',
'access arguments' => array(
2,
),
'type' => MENU_CALLBACK,
'file' => 'scheduler.cron.inc',
);
// Redirect the legacy URL 'scheduler/timecheck' to the new admin tab
// 'admin/config/content/scheduler/timecheck'.
$items['scheduler/timecheck'] = array(
'page callback' => 'drupal_goto',
'page arguments' => array(
'admin/config/content/scheduler/timecheck',
),
'access arguments' => array(
'administer scheduler',
),
'type' => MENU_CALLBACK,
);
$items['admin/config/content/scheduler'] = array(
'title' => 'Scheduler',
'description' => "Configure settings for scheduled publishing and unpublishing, run the lightweight cron and check your servers clock time.",
'page callback' => 'drupal_get_form',
'page arguments' => array(
'scheduler_admin',
),
'access arguments' => array(
'administer scheduler',
),
'type' => MENU_NORMAL_ITEM,
'file' => 'scheduler.admin.inc',
);
$items['admin/config/content/scheduler/default'] = array(
'title' => 'Settings',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => 5,
);
$items['admin/config/content/scheduler/cron'] = array(
'title' => 'Lightweight Cron',
'description' => 'A lightweight cron handler to allow more frequent runs of Schedulers internal cron system.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'_scheduler_lightweight_cron',
),
'access arguments' => array(
'administer scheduler',
),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
'file' => 'scheduler.admin.inc',
);
$items['admin/config/content/scheduler/timecheck'] = array(
'title' => 'Time Check',
'description' => 'Allows site admin to check their servers internal clock',
'page callback' => '_scheduler_timecheck',
'access arguments' => array(
'administer scheduler',
),
'type' => MENU_LOCAL_TASK,
'weight' => 15,
'file' => 'scheduler.admin.inc',
);
$items['admin/content/scheduler'] = array(
'title' => 'Scheduled',
'page callback' => 'scheduler_list',
'page arguments' => array(
NULL,
NULL,
),
'access callback' => 'scheduler_list_access_callback',
'access arguments' => array(
NULL,
),
'description' => 'Display a list of scheduled nodes',
'type' => MENU_LOCAL_TASK,
'file' => 'scheduler.admin.inc',
);
// Reuse the above definition in the scheduler admin page.
$items['admin/config/content/scheduler/list'] = array(
'title' => 'Scheduled Content',
'weight' => 20,
) + $items['admin/content/scheduler'];
// Menu callback for confirmation before manually deleting obsolete rows from
// the Scheduler table. Cannot use normal node delete link because these rows
// no longer exist in the {node} table.
$items['admin/content/scheduler/delete/%'] = array(
'title' => 'Delete Scheduled Data',
'description' => 'Delete obsolete rows from Scheduler table',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'_scheduler_delete_row_confirm',
4,
),
'access arguments' => array(
'administer scheduler',
),
'type' => MENU_CALLBACK,
'file' => 'scheduler.admin.inc',
);
$items['user/%/scheduler'] = array(
'title' => 'Scheduled',
'page callback' => 'scheduler_list',
// This will pass the uid of the user account being viewed.
'page arguments' => array(
'user_only',
1,
),
'access callback' => 'scheduler_list_access_callback',
'access arguments' => array(
1,
),
'description' => 'Display a list of scheduled nodes',
'type' => MENU_LOCAL_TASK,
'file' => 'scheduler.admin.inc',
);
return $items;
}