You are here

function elysia_cron_module_jobs in Elysia Cron 7

Same name and namespace in other branches
  1. 5.2 elysia_cron.module \elysia_cron_module_jobs()
  2. 5 elysia_cron.module \elysia_cron_module_jobs()
  3. 6.2 elysia_cron.module \elysia_cron_module_jobs()
  4. 6 elysia_cron.module \elysia_cron_module_jobs()
  5. 7.2 elysia_cron.module \elysia_cron_module_jobs()
1 call to elysia_cron_module_jobs()
elysia_cron_initialize in ./elysia_cron.module

File

./elysia_cron.module, line 756

Code

function elysia_cron_module_jobs() {
  static $jobs;
  if (!isset($jobs)) {
    $jobs = array();
    foreach (module_implements('cron') as $module) {
      if ($module != 'elysia_cron') {
        $jobs[$module . '_cron'] = array(
          'module' => $module,
          'callback' => $module . '_cron',
          'arguments' => array(),
        );
      }
    }
    foreach (module_implements('cronapi') as $module) {
      $fn = $module . '_cronapi';
      $l = $fn('list');
      if (is_array($l)) {
        foreach ($l as $job => $data) {
          if (is_array($data)) {
            $jobs[$job] = $data;
          }
          else {

            // Compatibility with v1.x settings
            $jobs[$job] = array(
              'description' => $data,
              'rule' => ($d = $fn('rule', $job)) ? $d : false,
              'weight' => ($d = $fn('weight', $job)) ? $d : 0,
            );
          }
          $jobs[$job] = $jobs[$job] + array(
            'module' => $module,
            'callback' => function_exists($job) ? $job : $fn,
            'arguments' => function_exists($job) ? array() : array(
              'execute',
              $job,
            ),
          );
        }
      }
    }
    if (function_exists('drupal_alter')) {
      drupal_alter('cron', $jobs);
    }
  }
  return $jobs;
}