You are here

function pathauto_admin_delete_submit in Pathauto 5.2

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

Process pathauto_admin_delete form submissions.

File

./pathauto.module, line 839
Main file for the Pathauto module, which automatically generates aliases for content.

Code

function pathauto_admin_delete_submit($form_id, $form_values) {
  foreach ($form_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],
        )));
      }
    }
  }
  return 'admin/build/path/delete_bulk';
}