summaryrefslogtreecommitdiff
path: root/modules/taxonomy
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-02-12 19:04:20 +0000
committerDries Buytaert <dries@buytaert.net>2004-02-12 19:04:20 +0000
commit14b84fa2997b5e27046a70ac307a4241d724e466 (patch)
treeaa917e3d96b31b451262bc22a39147f764c55ac4 /modules/taxonomy
parentf137b26979754e3e94bec73ea947cd87d08594a2 (diff)
downloadbrdo-14b84fa2997b5e27046a70ac307a4241d724e466.tar.gz
brdo-14b84fa2997b5e27046a70ac307a4241d724e466.tar.bz2
- Fixed bug #5831: added validation for posting to forum containers. Patch
by UnConeD.
Diffstat (limited to 'modules/taxonomy')
-rw-r--r--modules/taxonomy/taxonomy.module10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 68639d4ab..0d32a606b 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -299,7 +299,7 @@ function taxonomy_overview() {
return theme("table", $header, $rows);
}
-function taxonomy_form($vocabulary_id, $value = 0) {
+function taxonomy_form($vocabulary_id, $value = 0, $error = array()) {
$vocabulary = taxonomy_get_vocabulary($vocabulary_id);
if ($vocabulary->required) {
$descriptions = array(t("You must choose one term for this node."), t("You must choose one or more terms for this node."));
@@ -312,7 +312,9 @@ function taxonomy_form($vocabulary_id, $value = 0) {
$multiple = intval($vocabulary->multiple);
- return _taxonomy_term_select($vocabulary->name, "taxonomy", $value, $vocabulary_id, $descriptions[$multiple], $multiple, $blank);
+ $description = $descriptions[$multiple] . $error['taxonomy'];
+
+ return _taxonomy_term_select($vocabulary->name, 'taxonomy', $value, $vocabulary_id, $description, $multiple, $blank);
}
/*
@@ -336,7 +338,7 @@ function taxonomy_get_vocabularies($type = '', $key = "vid") {
}
// return form with current term
-function taxonomy_node_form($type, $node = '') {
+function taxonomy_node_form($type, $node = '', $error = array()) {
if (!$node->taxonomy) {
if ($node->nid) {
$terms = array_keys(taxonomy_node_get_terms($node->nid));
@@ -351,7 +353,7 @@ function taxonomy_node_form($type, $node = '') {
$c = db_query("SELECT * FROM {vocabulary} WHERE nodes LIKE '%%%s%%' ORDER BY weight, name", $type);
while ($vocabulary = db_fetch_object($c)) {
- $result[] .= taxonomy_form($vocabulary->vid, $terms);
+ $result[] .= taxonomy_form($vocabulary->vid, $terms, $error);
}
return $result ? $result : array();
}