diff --git a/scheduler.module b/scheduler.module index d187a36..62dca4a 100644 --- a/scheduler.module +++ b/scheduler.module @@ -113,33 +113,24 @@ function scheduler_help($section) { $output = ''; switch ($section) { case 'admin/config/content/scheduler': - $output = '

' - . t('Some scheduler actions are set for each different content type. These are accessed via the admin content type list.', - array('@link' => url('admin/structure/types'))) . '
' - . t('The options and settings below are common to all content types.') . '

'; + $output = '

' . t('Some Scheduler options are set for each different content type, and are accessed via the admin content type list.', array('@link' => url('admin/structure/types'))) . '
'; + $output .= t('The options and settings below are common to all content types.') . '

'; break; case 'admin/config/content/scheduler/cron': $base_url = $GLOBALS['base_url']; - $output = '

' - . 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.") . '

' - . '

' . t("Scheduler's cron is at /scheduler/cron and a sample crontab entry to run scheduler every minute might look like:") . '

' - . '* * * * * wget -q -O /dev/null "' . $base_url . '/scheduler/cron"' - . '

' . t('or') . '

' - . '* * * * * curl -s -o /dev/null "' . $base_url . '/scheduler/cron"

'; + $output = '

' . 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.") . '

'; + $output .= '

' . t("Scheduler's cron is at /scheduler/cron and a sample crontab entry to run scheduler every minute might look like:") . '

'; + $output .= '* * * * * wget -q -O /dev/null "' . $base_url . '/scheduler/cron"'; + $output .= '

' . t('or') . '

'; + $output .= '* * * * * curl -s -o /dev/null "' . $base_url . '/scheduler/cron"

'; break; case 'admin/help#scheduler': // This is shown at the top of admin/help/scheduler. - $output = '

' - . t('The Scheduler module provides the functionality for automatic publishing and unpublishing of nodes at specified future dates.') - . '

' . '

' - . t('You can read more in the readme.txt file.', - array('@readme' => $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'scheduler') . '/README.txt')) - . '

'; + $output = '

' . t('About') . '

'; + $output .= '

' . t('The Scheduler module provides the functionality for automatic publishing and unpublishing of nodes at specified future dates.') . '

'; + $output .= '

' . t('You can read more in the readme.txt file.', array('@readme' => $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'scheduler') . '/README.txt')) . '

'; break; default: @@ -735,7 +726,7 @@ function scheduler_node_update($node) { } /** - * Implements hook_node_delte(). + * Implements hook_node_delete(). */ function scheduler_node_delete($node) { db_delete('scheduler')->condition('nid', $node->nid)->execute(); @@ -986,7 +977,7 @@ function _scheduler_lightweight_cron() { $form['scheduler_cron'] = array( '#type' => 'submit', '#prefix' => t("You can test Scheduler's lightweight cron process interactively") . ':
', - '#value' => t("Run Scheduler's cron now"), + '#value' => t("Run Scheduler's lightweight cron now"), '#submit' => array('_scheduler_run_cron'), '#suffix' => "
\n", ); @@ -1084,10 +1075,10 @@ function scheduler_preprocess_node(&$variables, $hook) { /** * Implements hook_feeds_processor_targets_alter(). - * Advertises publish_on and unpublish_on as mappable values to the feeds module. */ function scheduler_feeds_processor_targets_alter(&$targets, $processor, $content_type) { - + // This function will advertise publish_on and unpublish_on as mappable values + // to the feeds module. $publishing_enabled = variable_get('scheduler_publish_enable_' . $content_type, 0); $unpublishing_enabled = variable_get('scheduler_unpublish_enable_' . $content_type, 0); @@ -1109,20 +1100,18 @@ function scheduler_feeds_processor_targets_alter(&$targets, $processor, $content /** * Mapping callback for feeds module. - * - * This callback converts input from parser and converts it - * to timestamp form. After that it sets value of correct field of node. */ function scheduler_set_target($source, $node, $target, $value) { if (!is_array($value)) { + // Convert input from parser to timestamp form. if (!is_numeric($value)) { $timestamp = strtotime($value); } else { $timestamp = $value; } - // If strtotime returned correct timestamp, we proceed with - // processing. Otherwise do nothing. + // If strtotime returned correct timestamp then set the value of the target + // field in the node. Otherwise do nothing. if (($timestamp !== FALSE) && ($timestamp != -1)) { $node->$target = $timestamp; } @@ -1131,11 +1120,10 @@ function scheduler_set_target($source, $node, $target, $value) { /** * Implements hook_ctools_plugin_directory(). - * - * Declare a form pane (panels content type) for use in ctools and page manager. - * This allows the Scheduler fieldset to be placed in a panel. */ function scheduler_ctools_plugin_directory($owner, $plugin_type) { + // Declare a form pane (panels content type) for use in ctools and page + // manager. This allows the Scheduler fieldset to be placed in a panel. if ($owner == 'ctools' && $plugin_type == 'content_types') { return 'plugins/content_types'; } @@ -1143,11 +1131,10 @@ function scheduler_ctools_plugin_directory($owner, $plugin_type) { /** * Implements hook_i18n_sync_options(). - * - * Keep the scheduler dates synchronised between separate nodes which have been - * defined as translations of each other. */ function scheduler_i18n_sync_options($entity_type, $bundle_name) { + // Keep the scheduler dates synchronised between separate nodes which have + // been defined as translations of each other. if ($entity_type == 'node') { return array( 'publish_on' => array( @@ -1163,11 +1150,11 @@ function scheduler_i18n_sync_options($entity_type, $bundle_name) { } /** - * Implements drupal_alter('field_attach_prepare_translation'). - * - * Prefill the node translation form with values from the translation source node. + * Implements hook_field_attach_prepare_translation_alter(). */ function scheduler_field_attach_prepare_translation_alter($entity, $context) { + // Prefill the node translation form with values from the translation source + // node. $source_entity = $context['source_entity']; if (isset($source_entity->scheduler['publish_on'])) {