| 7 queue_example.module | theme_queue_items($variables) |
| 8 queue_example.module | theme_queue_items($variables) |
Themes the queue display.
Again, this is not part of the demonstration of the queue API, but is here just to make the user interface more understandable.
Parameters
$variables:
Related topics
1 theme call to theme_queue_items()
File
- queue_example/
queue_example.module, line 248 - Examples demonstrating the Drupal Queue API.
Code
function theme_queue_items($variables) {
$items = $variables['items'];
$rows = array();
foreach ($items as &$item) {
if ($item['expire'] > 0) {
$item['expire'] = t("Claimed: expires %expire", array('%expire' => date('r', $item['expire'])));
}
else {
$item['expire'] = t('Unclaimed');
}
$item['created'] = date('r', $item['created']);
$item['content'] = check_plain(unserialize($item['data']));
unset($item['data']);
$rows[] = $item;
}
if (!empty($rows)) {
$header = array(t('Item ID'), t('Claimed/Expiration'), t('Created'), t('Content/Data'));
$output = theme('table', array('header' => $header, 'rows' => $rows));
return $output;
}
else {
return t('There are no items in the queue.');
}
}
Login or register to post comments