From f6ccf978f6fc256ca1f17bd8e6b1ae5be4fe8df2 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Fri, 10 Jul 2009 05:58:13 +0000 Subject: #488542 by yched: Allow field UI to be attached to any fieldable entity. --- modules/taxonomy/taxonomy.module | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'modules/taxonomy/taxonomy.module') diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index a8996514d..4c9b0988f 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -24,12 +24,28 @@ function taxonomy_permission() { function taxonomy_fieldable_info() { $return = array( 'taxonomy_term' => array( - 'name' => t('Taxonomy term'), - 'id key' => 'tid', - 'bundle key' => 'vocabulary_machine_name', - 'bundles' => taxonomy_vocabulary_get_names(), + 'label' => t('Taxonomy term'), + 'object keys' => array( + 'id' => 'tid', + 'bundle' => 'vocabulary_machine_name', + ), + 'bundle keys' => array( + 'bundle' => 'machine_name', + ), + 'bundles' => array(), ), ); + foreach (taxonomy_get_vocabularies() as $vocabulary) { + $return['taxonomy_term']['bundles'][$vocabulary->machine_name] = array( + 'label' => $vocabulary->name, + 'admin' => array( + 'path' => 'admin/content/taxonomy/%taxonomy_vocabulary', + 'real path' => 'admin/content/taxonomy/' . $vocabulary->vid, + 'bundle argument' => 3, + 'access arguments' => array('administer taxonomy'), + ), + ); + } return $return; } -- cgit v1.2.3