You are here

function pathauto_admin_delete_submit in Pathauto 6

Same name and namespace in other branches
  1. 5.2 pathauto.module \pathauto_admin_delete_submit()
  2. 6.2 pathauto.admin.inc \pathauto_admin_delete_submit()
  3. 7 pathauto.admin.inc \pathauto_admin_delete_submit()

Process pathauto_admin_delete form submissions.

File

./pathauto.admin.inc, line 448
Admin page callbacks for the Pathauto module.

Code

function pathauto_admin_delete_submit($form, &$form_state) {
  foreach ($form_state['values'] as $key => $value) {
    if ($value) {
      if ($key === 'all_aliases') {
        db_query('DELETE FROM {url_alias}');
        drupal_set_message(t('All of your path aliases have been deleted.'));
      }
      $objects = module_invoke_all('path_alias_types');
      if (array_key_exists($key, $objects)) {
        db_query("DELETE FROM {url_alias} WHERE src LIKE '%s%%'", $key);
        drupal_set_message(t('All of your %type path aliases have been deleted.', array(
          '%type' => $objects[$key],
        )));
      }
    }
  }
  $form_state['redirect'] = 'admin/build/path/delete_bulk';
}