- Patch #7302 by Gerhard: saves the selected terms in a session variable.

4.5.x
Dries Buytaert 2004-04-23 07:40:26 +00:00
parent cf98e0a1fc
commit e5e26a07d6
2 changed files with 16 additions and 0 deletions

View File

@ -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);
}

View File

@ -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);
}