function scheduler_help in Scheduler 8
Same name and namespace in other branches
- 5 scheduler.module \scheduler_help()
- 6 scheduler.module \scheduler_help()
- 7 scheduler.module \scheduler_help()
- 2.x scheduler.module \scheduler_help()
Implements hook_help().
File
- ./
scheduler.module, line 23 - Scheduler publishes and unpublishes nodes on dates specified by the user.
Code
function scheduler_help($route_name, RouteMatchInterface $route_match) {
$output = '';
switch ($route_name) {
case 'help.page.scheduler':
$output = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Scheduler module provides the functionality for automatic publishing and unpublishing of nodes at specified future dates.') . '</p>';
$output .= '<p>' . t('You can read more in the <a href="@readme">readme</a> file or our <a href="@project">project page on Drupal.org</a>.', [
'@readme' => $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'scheduler') . '/README.md',
'@project' => 'https://drupal.org/project/scheduler',
]) . '</p>';
break;
case 'scheduler.admin_form':
$output = '<p>' . t('Most of the Scheduler options are set for each different content type, and are accessed via the <a href="@link">admin content type</a> list.', [
'@link' => Url::fromRoute('entity.node_type.collection')
->toString(),
]) . '</br>';
$output .= t('The options and settings below are common to all content types.') . '</p>';
break;
case 'scheduler.cron_form':
$base_url = $GLOBALS['base_url'];
$access_key = \Drupal::config('scheduler.settings')
->get('lightweight_cron_access_key');
$cron_url = $base_url . '/scheduler/cron/' . $access_key;
$output = '<p>' . t("When you have set up Drupal's standard crontab job cron.php then Scheduler will be executed during each cron run. However, if you would like finer granularity to scheduler, but don't want to run Drupal's cron more often then you can use the lightweight cron handler provided by Scheduler. This is an independent cron job which only runs the scheduler process and does not execute any cron tasks defined by Drupal core or any other modules.") . '</p>';
$output .= '<p>' . t("Scheduler's cron is at /scheduler/cron/{access-key} and a sample crontab entry to run scheduler every minute might look like:") . '</p>';
$output .= '<code>* * * * * wget -q -O /dev/null "' . $cron_url . '"</code>';
$output .= '<p>' . t('or') . '</p>';
$output .= '<code>* * * * * curl -s -o /dev/null "' . $cron_url . '"</code><br/><br/>';
break;
default:
}
return $output;
}