summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-04-23 07:40:26 +0000
committerDries Buytaert <dries@buytaert.net>2004-04-23 07:40:26 +0000
commite5e26a07d6a3836ee3bd50117f92dce4747f879f (patch)
tree2866bd089e95bcc6648f7da45a08c0fdf13f010b
parentcf98e0a1fc3ae8fcc2766191e470ff5d4e01c7e1 (diff)
downloadbrdo-e5e26a07d6a3836ee3bd50117f92dce4747f879f.tar.gz
brdo-e5e26a07d6a3836ee3bd50117f92dce4747f879f.tar.bz2
- Patch #7302 by Gerhard: saves the selected terms in a session variable.
-rw-r--r--modules/taxonomy.module8
-rw-r--r--modules/taxonomy/taxonomy.module8
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);
}