summaryrefslogtreecommitdiff
path: root/modules/field/field.api.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/field/field.api.php')
-rw-r--r--modules/field/field.api.php94
1 files changed, 0 insertions, 94 deletions
diff --git a/modules/field/field.api.php b/modules/field/field.api.php
index 64174560b..d6f29609d 100644
--- a/modules/field/field.api.php
+++ b/modules/field/field.api.php
@@ -7,100 +7,6 @@
*/
/**
- * Expose fieldable object types.
- *
- * Inform the Field API about object types to which fields can be attached.
- * @see hook_fieldable_info_alter().
- *
- * @return
- * An array whose keys are fieldable object type names and whose values are
- * arrays with the following key/value pairs:
- * - label: The human-readable name of the type.
- * - object keys: An array describing how the Field API can extract the
- * informations it needs from the objects of the type.
- * - id: The name of the property that contains the primary id of the
- * object. Every object passed to the Field API must have this property
- * and its value must be numeric.
- * - revision: The name of the property that contains the revision id of
- * the object. The Field API assumes that all revision ids are unique
- * across all objects of a type.
- * This element can be omitted if the objects of this type are not
- * versionable.
- * - bundle: The name of the property that contains the bundle name for the
- * object. The bundle name defines which set of fields are attached to
- * the object (e.g. what nodes call "content type").
- * This element can be omitted if this type has no bundles (all objects
- * have the same fields).
- * - bundle keys: An array describing how the Field API can extract the
- * informations it needs from the bundle objects for this type (e.g
- * $vocabulary objects for terms; not applicable for nodes).
- * This element can be omitted if this type's bundles do not exist as
- * standalone objects.
- * - bundle: The name of the property that contains the name of the bundle
- * object.
- * - cacheable: A boolean indicating whether Field API should cache
- * loaded fields for each object, reducing the cost of
- * field_attach_load().
- * - bundles: An array describing all bundles for this object type.
- * Keys are bundles machine names, as found in the objects' 'bundle'
- * property (defined in the 'object keys' entry above).
- * - label: The human-readable name of the bundle.
- * - admin: An array of informations that allow Field UI pages (currently
- * implemented in a contributed module) to attach themselves to the
- * existing administration pages for the bundle.
- * - path: the path of the bundle's main administration page, as defined
- * in hook_menu(). If the path includes a placeholder for the bundle,
- * the 'bundle argument', 'bundle helper' and 'real path' keys below
- * are required.
- * - bundle argument: The position of the placeholder in 'path', if any.
- * - real path: The actual path (no placeholder) of the bundle's main
- * administration page. This will be used to generate links.
- * - access callback: As in hook_menu(). 'user_access' will be assumed if
- * no value is provided.
- * - access arguments: As in hook_menu().
- */
-function hook_fieldable_info() {
- $return = array(
- 'taxonomy_term' => array(
- '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/structure/taxonomy/%taxonomy_vocabulary',
- 'real path' => 'admin/structure/taxonomy/' . $vocabulary->vid,
- 'bundle argument' => 3,
- 'access arguments' => array('administer taxonomy'),
- ),
- );
- }
- return $return;
-}
-
-/**
- * Perform alterations on fieldable types.
- *
- * @param $info
- * Array of informations on fieldable types exposed by hook_fieldable_info()
- * implementations.
- */
-function hook_fieldable_info_alter(&$info) {
- // A contributed module handling node-level caching would want to disable
- // field cache for nodes.
- $info['node']['cacheable'] = FALSE;
-}
-
-/**
* Expose "pseudo-field" components on fieldable objects.
*
* Field UI's 'Manage fields' page lets users re-order fields, but also