On this page
function taxonomy_vocabulary_confirm_reset_alphabetical_submit
taxonomy_vocabulary_confirm_reset_alphabetical_submit($form, &$form_state)
Submit handler to reset a vocabulary to alphabetical order after confirmation.
See also
taxonomy_vocabulary_confirm_reset_alphabetical()
File
- modules/taxonomy/taxonomy.admin.inc, line 976
- Administrative page callbacks for the taxonomy module.
Code
function taxonomy_vocabulary_confirm_reset_alphabetical_submit($form, &$form_state) {
db_update('taxonomy_term_data')
->fields(array('weight' => 0))
->condition('vid', $form_state['values']['vid'])
->execute();
drupal_set_message(t('Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name'])));
watchdog('taxonomy', 'Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE);
$form_state['redirect'] = 'admin/structure/taxonomy/' . $form_state['values']['machine_name'];
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!taxonomy!taxonomy.admin.inc/function/taxonomy_vocabulary_confirm_reset_alphabetical_submit/7.x