You are here

function entityqueue_subqueue_delete_form in Entityqueue 7

Form callback.

1 string reference to 'entityqueue_subqueue_delete_form'
entityqueue_export_ui::subqueue_delete_page in plugins/ctools/export_ui/entityqueue_export_ui.class.php
Page callback; Displays the subqueue delete form.

File

includes/entityqueue.admin.inc, line 213
Administrative pages for Entity Queue.

Code

function entityqueue_subqueue_delete_form($form, &$form_state, $queue, $subqueue) {
  $handler = entityqueue_get_handler($queue);

  // If they can't delete this subqueue, return access denied.
  if (!$handler
    ->canDeleteSubqueue($subqueue)) {
    drupal_set_message(t('The %queue: %subqueue subqueue cannot be deleted.', array(
      '%queue' => $queue->label,
      '%subqueue' => $subqueue->label,
    )), 'warning');
    drupal_access_denied();
    drupal_exit();
  }
  $form['#queue'] = $queue;
  $form['#subqueue'] = $subqueue;
  $form['subqueue_id'] = array(
    '#type' => 'value',
    '#value' => $subqueue->subqueue_id,
  );
  return confirm_form($form, t('Are you sure you want to delete %queue: %subqueue?', array(
    '%queue' => $queue->label,
    '%subqueue' => $subqueue->label,
  )), 'admin/structure/entityqueue/list/' . $queue->name . '/subqueues', NULL, t('Delete'));
}