function tft_archive_term_form_submit in Taxonomy File Tree 7.2
Same name and namespace in other branches
- 7 tft.admin.inc \tft_archive_term_form_submit()
Submission callback for tft_archive_term_form().
File
- modules/
tft_archive/ includes/ tft_archive.pages.inc, line 91 - Page and form callbacks.
Code
function tft_archive_term_form_submit($form, $form_state) {
$name = $form_state['values']['name'];
$tid = $form_state['values']['tid'];
$archive_tid = tft_archive_get_closest_parent_archive_tid($tid);
$parent_tid = tft_get_parent_tid($tid);
db_update('taxonomy_term_hierarchy')
->fields(array(
'parent' => $archive_tid,
))
->condition('tid', $form_state['values']['tid'])
->execute();
tft_archive_log($form_state['values']['tid'], 'term', $parent_tid);
drupal_set_message(t("The <em>@term</em> folder was archived.", array(
'@term' => $name,
)));
}