You are here

function background_process_overview_page in Background Process 7

Same name and namespace in other branches
  1. 6 background_process.admin.inc \background_process_overview_page()
  2. 7.2 background_process.admin.inc \background_process_overview_page()

Overview of background processes.

1 string reference to 'background_process_overview_page'
background_process_menu in ./background_process.module
Implements hook_menu().

File

./background_process.admin.inc, line 115

Code

function background_process_overview_page() {
  $processes = background_process_get_processes();
  $data = array();
  foreach ($processes as $process) {
    $progress = progress_get_progress($process->handle);
    $data[] = array(
      $process->handle,
      _background_process_callback_name($process->callback),
      $process->uid,
      $process->service_host,
      format_date((int) $process->start, 'custom', 'Y-m-d H:i:s'),
      $progress ? sprintf("%.02f%%", $progress->progress * 100) : t('N/A'),
      l(t('Unlock'), 'background-process/unlock/' . rawurlencode($process->handle), array(
        'attributes' => array(
          'class' => 'button-unlock',
        ),
        'query' => drupal_get_destination(),
      )),
    );
  }
  $header = array(
    'Handle',
    'Callback',
    'User',
    'Host',
    'Start time',
    'Progress',
    '',
  );
  $output = '';
  $output .= theme('table', array(
    'header' => $header,
    'rows' => $data,
    'class' => 'background-process-overview',
  ));
  return $output;
}