You are here

function _ultimate_cron_job_set_status in Ultimate Cron 7.2

CTools Export set status callback.

Set job status and log it.

Parameters

mixed $object: Name of job or UltimateCronJob object.

bool $status: The status to set (TRUE = disabled).

2 string references to '_ultimate_cron_job_set_status'
ultimate_cron_schema in ./ultimate_cron.install
Implements hook_schema().
ultimate_cron_update_7200 in ./ultimate_cron.install
Rename columns and indices to 2.x style.

File

./ultimate_cron.module, line 493

Code

function _ultimate_cron_job_set_status($object, $status) {
  if (!is_object($object)) {
    $object = _ultimate_cron_job_load($object);
  }
  if (empty($object->dont_log)) {
    $log_entry = $object
      ->startLog(uniqid($object->name, TRUE), 'modification', ULTIMATE_CRON_LOG_TYPE_ADMIN);
    $log_entry
      ->log($object->name, 'Job @status by ' . $log_entry
      ->formatUser(), array(
      '@status' => $status ? t('disabled') : t('enabled'),
    ), WATCHDOG_INFO);
    $log_entry
      ->finish();
  }
  variable_set('default_ultimate_cron_job_' . $object->name, $status ? TRUE : FALSE);
  $object->disabled = $status;
}