diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-04-23 07:40:26 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-04-23 07:40:26 +0000 |
commit | e5e26a07d6a3836ee3bd50117f92dce4747f879f (patch) | |
tree | 2866bd089e95bcc6648f7da45a08c0fdf13f010b | |
parent | cf98e0a1fc3ae8fcc2766191e470ff5d4e01c7e1 (diff) | |
download | brdo-e5e26a07d6a3836ee3bd50117f92dce4747f879f.tar.gz brdo-e5e26a07d6a3836ee3bd50117f92dce4747f879f.tar.bz2 |
- Patch #7302 by Gerhard: saves the selected terms in a session variable.
-rw-r--r-- | modules/taxonomy.module | 8 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.module | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 5e2f343a5..e6d1b9a79 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 5e2f343a5..e6d1b9a79 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); } |