You are here

public function ultimate_cron_job_ctools_export_ui::list_form_submit in Ultimate Cron 7.2

Submit the filter/sort form.

This submit handler is actually responsible for building up all of the rows that will later be rendered, since it is doing the filtering and sorting.

For the most part, you should not need to override this method, as the fiddly bits call through to other functions.

Overrides ctools_export_ui::list_form_submit

File

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

Class

ultimate_cron_job_ctools_export_ui
Class for cTools Export UI.

Code

public function list_form_submit(&$form, &$form_state) {

  // Filter and re-sort the pages.
  $plugin = $this->plugin;
  $prefix = ctools_export_ui_plugin_base_path($plugin);
  $this->jobs_behind = 0;
  foreach ($this->items as $name => $item) {

    // Call through to the filter and see if we're going to render this
    // row. If it returns TRUE, then this row is filtered out.
    if ($this
      ->list_filter($form_state, $item)) {
      continue;
    }
    $operations = $this
      ->build_operations($item);
    $this
      ->list_build_row($item, $form_state, $operations);
  }
  if ($this->jobs_behind) {
    drupal_set_message(format_plural($this->jobs_behind, '@count job is behind schedule.', '@count jobs are behind schedule.'), 'warning');
  }

  // Now actually sort.
  uasort($this->rows, '_ultimate_cron_multi_column_sort');
  if ($form_state['values']['sort'] == 'desc') {
    $this->rows = array_reverse($this->rows);
  }
  foreach ($this->rows as &$row) {
    unset($row['sort']);
  }
}