1 queue_example.module | queue_example_show_queue($form, &$form_state) |
Submit function for the show-queue button.
Related topics
File
- modules/
examples/ queue_example/ queue_example.module, line 175 - Hook implementations for the Queue Example module.
Code
function queue_example_show_queue($form, &$form_state) {
$queue = BackdropQueue::get($form_state['values']['queue_name']);
// There is no harm in trying to recreate existing.
$queue->createQueue();
// Get the number of items.
$count = $queue->numberOfItems();
// Update the form item counter.
$form_state['storage']['insert_counter'] = $count + 1;
// Unset the string_to_add textbox.
unset($form_state['input']['string_to_add']);
$form_state['rebuild'] = TRUE;
}