function background_process_overview_page in Background Process 7.2
Same name and namespace in other branches
- 6 background_process.admin.inc \background_process_overview_page()
- 7 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 88
Code
function background_process_overview_page() {
$processes = BackgroundProcess::loadAll();
$data = array();
foreach ($processes as $process) {
$data[] = array(
$process
->getHandle(),
$process->callback,
$process->uid,
$process->service_host,
format_date((int) $process
->getStartTime(), 'custom', 'Y-m-d H:i:s'),
$process
->getProgress() >= 0 ? sprintf("%.02f%%", $process
->getProgress() * 100) : t('N/A'),
l(t('Unlock'), 'background-process/unlock/' . $process->pid, 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;
}