summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-05-16 06:50:21 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-05-16 06:50:21 +0000
commit9d8799f6c4e92ec62133e0ed3aab7b0378e13ee7 (patch)
tree6f98a6d233b2174a65adee003031012dc23c5603 /modules
parent0652e5b5ccc076f35effc748d7bd5b1f07146461 (diff)
downloadbrdo-9d8799f6c4e92ec62133e0ed3aab7b0378e13ee7.tar.gz
brdo-9d8799f6c4e92ec62133e0ed3aab7b0378e13ee7.tar.bz2
Reverting #53653, that function actually is called via a module_invoke() in node.module.
Diffstat (limited to 'modules')
-rw-r--r--modules/taxonomy.module20
-rw-r--r--modules/taxonomy/taxonomy.module20
2 files changed, 40 insertions, 0 deletions
diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index dc0600f96..29ccd3ae0 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -549,6 +549,26 @@ 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($free_tags = 0) {
+ $vocabularies = taxonomy_get_vocabularies();
+ $options = array();
+ foreach ($vocabularies as $vid => $vocabulary) {
+ if ($vocabulary->tags && !$free_tags) { continue; }
+ $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
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index dc0600f96..29ccd3ae0 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -549,6 +549,26 @@ 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($free_tags = 0) {
+ $vocabularies = taxonomy_get_vocabularies();
+ $options = array();
+ foreach ($vocabularies as $vid => $vocabulary) {
+ if ($vocabulary->tags && !$free_tags) { continue; }
+ $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