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/node/node.module | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'modules/node/node.module') diff --git a/modules/node/node.module b/modules/node/node.module index 4c3141b25..639d6f98c 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -124,17 +124,28 @@ function node_cron() { function node_fieldable_info() { $return = array( 'node' => array( - 'name' => t('Node'), - 'id key' => 'nid', - 'revision key' => 'vid', - 'bundle key' => 'type', + 'label' => t('Node'), + 'object keys' => array( + 'id' => 'nid', + 'revision' => 'vid', + 'bundle' => 'type', + ), // Node.module handles its own caching. // 'cacheable' => FALSE, - // Bundles must provide human readable name so - // we can create help and error messages about them. - 'bundles' => node_type_get_names(), + 'bundles' => array(), ), ); + // Bundles must provide a human readable name so we can create help and error + // messages, and the path to attach Field admin pages to. + foreach (node_type_get_names() as $type => $name) { + $return['node']['bundles'][$type] = array( + 'label' => $name, + 'admin' => array( + 'path' => 'admin/build/node-type/' . str_replace('_', '-', $type), + 'access arguments' => array('administer content types'), + ), + ); + } return $return; } -- cgit v1.2.3