From e5e26a07d6a3836ee3bd50117f92dce4747f879f Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 23 Apr 2004 07:40:26 +0000 Subject: [PATCH] - Patch #7302 by Gerhard: saves the selected terms in a session variable. --- modules/taxonomy.module | 8 ++++++++ modules/taxonomy/taxonomy.module | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 5e2f343a58f3..e6d1b9a791c3 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -603,6 +603,14 @@ function taxonomy_get_term($tid) { function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $description, $multiple, $blank, $exclude = array()) { $tree = taxonomy_get_tree($vocabulary_id); + // We store the last selected ID in a session variable: + if (!$value) { + $value = $_SESSION['vocabulary']["$vocabulary_id"]; + } + else { + $_SESSION['vocabulary']["$vocabulary_id"] = $value; + } + if ($blank) { $options[] = array("tid" => 0, "name" => $blank); } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 5e2f343a58f3..e6d1b9a791c3 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -603,6 +603,14 @@ function taxonomy_get_term($tid) { function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $description, $multiple, $blank, $exclude = array()) { $tree = taxonomy_get_tree($vocabulary_id); + // We store the last selected ID in a session variable: + if (!$value) { + $value = $_SESSION['vocabulary']["$vocabulary_id"]; + } + else { + $_SESSION['vocabulary']["$vocabulary_id"] = $value; + } + if ($blank) { $options[] = array("tid" => 0, "name" => $blank); }