summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.module
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2005-01-17 00:41:35 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2005-01-17 00:41:35 +0000
commitb45bd13d444109244826c59f4900874bc31534c3 (patch)
tree98cb0e8c8683f4a67f10616a1d65a29e1e3e7929 /modules/taxonomy/taxonomy.module
parent18dfd4a81a1fff11320569ca3183e35eae7d766d (diff)
downloadbrdo-b45bd13d444109244826c59f4900874bc31534c3.tar.gz
brdo-b45bd13d444109244826c59f4900874bc31534c3.tar.bz2
- Various code style fixes
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r--modules/taxonomy/taxonomy.module19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index caa3fa1fe..c30032355 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -389,6 +389,25 @@ function taxonomy_form($vid, $value = 0, $help = NULL, $name = 'taxonomy') {
}
/**
+* Generate a set of options for selecting a term from all vocabularies. Can be
+* passed to form_select.
+*/
+function taxonomy_form_all($value = 0, $help = NULL, $name = 'taxonomy') {
+ $vocabularies = taxonomy_get_vocabularies();
+ $options = array();
+ foreach ($vocabularies as $vid => $vocabulary) {
+ $tree = taxonomy_get_tree($vid);
+ $options[$vocabulary->name] = array();
+ if ($tree) {
+ foreach ($tree as $term) {
+ $options[$vocabulary->name][$term->tid] = _taxonomy_depth($term->depth, '-') . $term->name;
+ }
+ }
+ }
+ return $options;
+}
+
+/**
* Return an array of all vocabulary objects.
*
* @param $type