1 path.admin.inc path_admin_bulk_delete_confirm($form, $form_state)

Confirm form for path alias bulk deletion.

See also

path_bulk_update_form()

path_bulk_update_form_rebuild_submit()

File

core/modules/path/path.admin.inc, line 868
Administrative page callbacks for the path module.

Code

function path_admin_bulk_delete_confirm($form, $form_state) {
  $all_path_info = path_get_info();
  $delete_list = array();

  foreach ($form_state['values']['update'] as $key => $value) {
    $value = array_filter($value);
    if ($value) {
      if (isset($value['base'])) {
        $delete_list[] = t('All %type aliases', array('%type' => $all_path_info[$key]['label']));
      }
      else {
        foreach (array_keys($value) as $type) {
          $delete_list[] = $all_path_info[$key]['pattern items'][$type];
        }
      }
    }
  }

  $form['delete'] = array(
    '#type' => 'value',
    '#value' => $form_state['values']['update'],
  );
  $form['delete_list'] = array(
    '#markup' => theme('item_list', array('items' => $delete_list)),
  );

  $form['#submit'][] = 'path_bulk_update_form_bulk_delete_submit';

  $question = t('Delete all the following URL aliases?');
  $path = 'admin/config/urls/path/bulk-update';
  $description = t('This action cannot be undone.');
  $yes = t('Delete URL aliases');

  return confirm_form($form, $question, $path, $description, $yes);
}