You are here

function tft_archive_restore_element in Taxonomy File Tree 7.2

Page callback: restore element.

1 string reference to 'tft_archive_restore_element'
tft_archive_menu in modules/tft_archive/tft_archive.module
Implements hook_menu().

File

modules/tft_archive/includes/tft_archive.pages.inc, line 11
Page and form callbacks.

Code

function tft_archive_restore_element($id, $type) {
  $tid = tft_archive_restore_archived_element($id, $type);
  if (!$tid) {
    $term = t("Root");
  }
  else {
    $term = taxonomy_term_load($tid);
    $term = $term->name;
  }
  $url = explode('%23', $_GET['destination']);
  drupal_set_message(t("The element was restored to <a href='!link'>%term</a>.", array(
    '!link' => url($url, array(
      'fragment' => "tft/{$tid}",
    )),
    '%term' => $term,
  )));
  if (isset($_GET['destination'])) {
    drupal_goto($_GET['destination']);
  }
  else {
    drupal_goto();
  }
}