function hosting_queue_summary_block in Hosting 5
Same name and namespace in other branches
- 6.2 hosting.module \hosting_queue_summary_block()
- 7.4 hosting.module \hosting_queue_summary_block()
- 7.3 hosting.module \hosting_queue_summary_block()
1 call to hosting_queue_summary_block()
File
- ./
hosting.module, line 254 - Hosting module
Code
function hosting_queue_summary_block() {
if (user_access('administer hosting queues')) {
$queues = hosting_get_queues();
$output = '';
foreach ($queues as $queue => $info) {
$disp = array();
# special case
if (!$info['enabled']) {
$disp[] = t('Status: disabled');
continue;
}
$disp[] = t('Status: enabled');
foreach (array(
'description' => t('Description'),
'frequency' => t('Frequency'),
'items' => t('Items per run'),
'total_items' => t('Items in queue'),
'last_run' => t('Last run'),
) as $key => $title) {
if ($key == 'last_run') {
$info[$key] = hosting_format_interval($info[$key]);
}
elseif ($key == 'frequency') {
$info[$key] = t('every @interval', array(
'@interval' => format_interval($info[$key]),
));
}
$disp[] = $title . ": " . $info[$key];
}
$output .= theme('item_list', $disp, $info['name']);
/* to print all stats of the queue... */
#$lambda = create_function('$k,$v', 'return "$k: $v";');
#$output .= theme('item_list', array_map($lambda, array_keys($info), $info), $info['name']);
}
return $output;
}
}