/[drupal]/contributions/modules/cronplus/cronplus.module
ViewVC logotype

Diff of /contributions/modules/cronplus/cronplus.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.8.2.4, Fri Dec 19 09:47:18 2008 UTC revision 1.8.2.5, Fri Dec 19 10:00:28 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /**  /**
3   * $Id: cronplus.module,v 1.8.2.3 2008/12/19 04:45:24 syscrusher Exp $   * $Id: cronplus.module,v 1.8 2007/03/22 23:41:18 syscrusher Exp $
4   *   *
5   * CronPlus enhances the Drupal cron feature to provide specific calls to   * CronPlus enhances the Drupal cron feature to provide specific calls to
6   * other modules at hourly, daily, weekly, monthly, and yearly intervals.   * other modules at hourly, daily, weekly, monthly, and yearly intervals.
# Line 22  function cronplus_help($section) { Line 22  function cronplus_help($section) {
22  /**  /**
23   * Implements hook_menu().   * Implements hook_menu().
24   */   */
25  function cronplus_menu() {  function cronplus_menu($may_cache) {
26    $items = array();    $items = array();
27    $items['admin/settings/cronplus'] = array(    if ($may_cache) {
28      'title' => t('cronplus'),      $items[] = array(
29      'page callback' => 'cronplus_settings_main',        'path' => 'admin/settings/cronplus',
30      'description' => 'Select which hour and on what day you would like houly and daily crons to run. Also see the status of cronplus',        'title' => t('cronplus'),
31      'access callback' => 'user_access',        'callback' => 'cronplus_settings_main',
32      'access arguments' => array('administer site configuration'),        'description' => 'Select which hour and on what day you would like houly and daily crons to run. Also see the status of cronplus',
33  //    'type' => MENU_LOCAL_TASK,        'access' => user_access('administer site configuration'),
34    );  //      'type' => MENU_LOCAL_TASK,
35    $items['admin/settings/cronplus/main'] = array(      );
36      'title' => t('configuration'),      $items[] = array(
37      'type' => MENU_DEFAULT_LOCAL_TASK,        'path' => 'admin/settings/cronplus/main',
38      'access callback' => 'user_access',        'title' => t('configuration'),
39      'access arguments' => array('administer site configuration'),        'type' => MENU_DEFAULT_LOCAL_TASK,
40      'weight' => -10,        'weight' => -10,
41    );      );
42    $items['admin/settings/cronplus/status'] = array(    }
43      'title' => t('status report'),    else {
44      'page callback' => 'cronplus_settings_status', 'access' => user_access('administer site configuration'),      $items[] = array(
45      'access callback' => 'user_access',        'path' => 'admin/settings/cronplus/status',
46      'access arguments' => array('administer site configuration'),        'title' => t('status report'),
47      'type' => MENU_LOCAL_TASK, 'weight' => 10        'callback' => 'cronplus_settings_status', 'access' => user_access('administer site configuration'),
48    );        'type' => MENU_LOCAL_TASK, 'weight' => 10);
49      }
50    return $items;    return $items;
51  }  }
52    
# Line 104  function cronplus_settings_form() { Line 105  function cronplus_settings_form() {
105      '#type' => 'submit',      '#type' => 'submit',
106      '#value' => t('Save settings'),      '#value' => t('Save settings'),
107    );    );
108    return system_settings_form($form);    return $form;
109  }  }
110    
111  /**  /**
# Line 142  function cronplus_logview_form() { Line 143  function cronplus_logview_form() {
143   */   */
144  function cronplus_logview_form_submit($form_id, $form_values) {  function cronplus_logview_form_submit($form_id, $form_values) {
145    $_SESSION['watchdog_overview_filter'] = 'cronplus';    $_SESSION['watchdog_overview_filter'] = 'cronplus';
146    drupal_goto('admin/reports/dblog');    drupal_goto('admin/logs/watchdog');
147  }  }
148    
149  /**  /**
# Line 273  function cronplus_invoke_hook($period, $ Line 274  function cronplus_invoke_hook($period, $
274    $function_name = 'cronplus_'. $period;    $function_name = 'cronplus_'. $period;
275    $last_this = variable_get($function_name .'_last', 0);    $last_this = variable_get($function_name .'_last', 0);
276    variable_set($function_name .'_last', $now);    variable_set($function_name .'_last', $now);
277    watchdog('cronplus', 'Processing %period cron for %d UTC, calling {module}_%func() for all modules', array('%d' => $now_fmt, '%period' => t($period), '%func' => $function_name), WATCHDOG_NOTICE);    watchdog('cronplus', t('Processing %period cron for %d UTC, calling {module}_%func() for all modules', array('%d' => $now_fmt, '%period' => t($period), '%func' => $function_name)), WATCHDOG_NOTICE);
278    @module_invoke_all($function_name, $now, $last_cron, $last_this);    @module_invoke_all($function_name, $now, $last_cron, $last_this);
279    @module_invoke_all('cronplus', $period, $now, $last_cron, $last_this);    @module_invoke_all('cronplus', $period, $now, $last_cron, $last_this);
280  }  }
# Line 295  function _cronplus_int_options($min, $ma Line 296  function _cronplus_int_options($min, $ma
296    }    }
297    return $options;    return $options;
298  }  }
299    ?>

Legend:
Removed from v.1.8.2.4  
changed lines
  Added in v.1.8.2.5

  ViewVC Help
Powered by ViewVC 1.1.2