You are here

public function ultimate_cron_job_ctools_export_ui::build_operations in Ultimate Cron 7.2

Ensure that we cannot clone from the operations link list.

Overrides ctools_export_ui::build_operations

1 call to ultimate_cron_job_ctools_export_ui::build_operations()
ultimate_cron_job_ctools_export_ui::list_form_submit in plugins/ctools/export_ui/ultimate_cron_job_ctools_export_ui.class.php
Submit the filter/sort form.

File

plugins/ctools/export_ui/ultimate_cron_job_ctools_export_ui.class.php, line 98
Export-ui handler for the Ultimate Cron jobs.

Class

ultimate_cron_job_ctools_export_ui
Class for cTools Export UI.

Code

public function build_operations($item) {
  $item->lock_id = isset($item->lock_id) ? $item->lock_id : $item
    ->isLocked();
  $allowed_operations = parent::build_operations($item);
  unset($allowed_operations['clone']);
  if ($item->lock_id) {
    unset($allowed_operations['run']);
    $allowed_operations['unlock']['href'] .= '/' . $item->lock_id;
  }
  else {
    unset($allowed_operations['unlock']);
  }
  if (!empty($item->hook['configure'])) {
    $allowed_operations['configure'] = array(
      'title' => t('Configure'),
      'href' => $item->hook['configure'],
    );
  }
  if (!empty($item->hook['immutable'])) {
    unset($allowed_operations['edit']);
    unset($allowed_operations['disable']);
    unset($allowed_operations['enable']);
    unset($allowed_operations['export']);
  }
  if (variable_get('maintenance_mode', 0)) {
    unset($allowed_operations['run']);
  }
  $item
    ->build_operations_alter($allowed_operations);
  $default_sort = array(
    'logs' => -10,
    'edit' => -2,
    'enable' => -1,
    'disable' => -1,
    'run' => 0,
    'unlock' => 0,
    'export' => 1,
    'configure' => 1,
  );
  $weight = 0;
  $this->notoken = TRUE;
  foreach ($allowed_operations as $name => &$operation) {
    if (!$this
      ->access($name, $item)) {
      unset($allowed_operations[$name]);
      continue;
    }
    $operation += array(
      'sort' => array(
        isset($default_sort[$name]) ? $default_sort[$name] : 0,
      ),
      'alias' => TRUE,
    );
    $operation['sort'][] = $weight++;
  }
  unset($this->notoken);
  uasort($allowed_operations, '_ultimate_cron_multi_column_sort');
  return $allowed_operations;
}