You are here

function notifications_admin_queue in Notifications 5

Same name and namespace in other branches
  1. 6 notifications.admin.inc \notifications_admin_queue()
  2. 6.2 notifications.admin.inc \notifications_admin_queue()
  3. 6.3 notifications.admin.inc \notifications_admin_queue()

Admin queue management

@ TO DO Add confirmation before queue reset

1 string reference to 'notifications_admin_queue'
notifications_menu in ./notifications.module
Implementation of hook_menu().

File

./notifications.admin.inc, line 370

Code

function notifications_admin_queue($op = 'status', $param = NULL) {
  $base = 'admin/messaging/notifications-status/queue';
  $output = '';
  switch ($op) {
    case 'run':
      $out = notifications_admin_queue_process($param);
      if ($out) {
        $output .= theme('box', t('Output'), $out);
      }
      break;
    case 'reset':
      db_query("DELETE FROM {notifications_queue}");
      db_query("DELETE FROM {notifications_event}");
      drupal_set_message(t('The queue has been reset.'));
      drupal_goto($base);
      break;
    default:
  }

  // Add operations
  $list[] = l(t('Run queue process'), "{$base}/run");
  $list[] = l(t('Process immediate sending'), "{$base}/run/immediate");
  $list[] = l(t('Reset queue. Delete all notifications.'), "{$base}/reset");
  $output .= theme('box', t('Operations'), theme('item_list', $list));

  // Summary
  $output .= notifications_admin_queue_summary();
  return $output;
}