You are here

public function UltimateCronGeneralSettings::build_operations_alter in Ultimate Cron 7.2

Use ajax for run, since we're launching in the background.

Overrides UltimateCronPlugin::build_operations_alter

File

plugins/ultimate_cron/settings/general.class.php, line 25
General settings for Ultimate Cron.

Class

UltimateCronGeneralSettings
General settings plugin class.

Code

public function build_operations_alter($job, &$allowed_operations) {
  if (empty($allowed_operations['run'])) {
    if (in_array('killable', $job->hook['tags']) && !$job
      ->peekSignal('kill')) {
      $allowed_operations['kill'] = array(
        'title' => t('Kill'),
        'href' => 'admin/config/system/cron/jobs/list/' . $job->name . '/signal/' . $this->type . '/' . $this->name . '/kill',
        'attributes' => array(
          'class' => array(
            'use-ajax',
          ),
        ),
        'query' => array(
          'token' => drupal_get_token('signal'),
        ),
      );
    }
  }
}