@@ -104,6 +104,14 @@ '#default_value' => FALSE, '#description' => t('Generate index aliases based on all pre-existing aliases.')); + // If requested, Clear all aliases from table url_alias + $do_remove_all_aliases = variable_get('pathauto_remove_all_aliases', FALSE); + variable_set('pathauto_remove_all_aliases', FALSE); + $form["general"]["pathauto_remove_all_aliases"] = array('#type' => 'checkbox', + '#title' => t('Remove ALL Aliases'), + '#default_value' => FALSE, + '#description' => t('This removes all aliases from the entire site. Use with caution and don\'t use in conjunction with any bulk updates')); + $form["general"]["pathauto_update_action"] = array('#type' => 'radios', '#title' => t('Update action'), '#default_value' => variable_get('pathauto_update_action', 2), '#options' => array(t('Do nothing, leaving the old alias intact'), @@ -116,6 +124,12 @@ '#description' => t('Words to strip out of the URL alias, separated by commas') ); + // Remove All Aliases from url_alias + if ($do_remove_all_aliases) { + pathauto_remove_all_aliases(); + drupal_set_message(t('All Aliases Removed')); + } + // Call the hook on all modules - an array of 'settings' objects is returned $all_settings = module_invoke_all('pathauto', 'settings'); $modulelist = ''; @@ -630,3 +644,8 @@ ' to '. $current_version["build"]); } } // end function _pathauto_update + +function pathauto_remove_all_aliases(){ + $query="DELETE FROM url_alias"; + mysql_query($query); +} \ No newline at end of file