diff options
Diffstat (limited to 'modules/field/field.module')
-rw-r--r-- | modules/field/field.module | 66 |
1 files changed, 2 insertions, 64 deletions
diff --git a/modules/field/field.module b/modules/field/field.module index 7d9e55edb..19d30540d 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -448,68 +448,6 @@ function field_view_mode_settings($entity_type, $bundle) { } /** - * Returns a list and settings of pseudo-field elements in a given bundle. - * - * If $context is 'form', an array with the following structure: - * @code - * array( - * 'name_of_pseudo_field_component' => array( - * 'label' => The human readable name of the component, - * 'description' => A short description of the component content, - * 'weight' => The weight of the component in edit forms, - * ), - * 'name_of_other_pseudo_field_component' => array( - * // ... - * ), - * ); - * @endcode - * - * If $context is 'display', an array with the following structure: - * @code - * array( - * 'name_of_pseudo_field_component' => array( - * 'label' => The human readable name of the component, - * 'description' => A short description of the component content, - * // One entry per view mode, including the 'default' mode: - * 'display' => array( - * 'default' => array( - * 'weight' => The weight of the component in displayed entities in - * this view mode, - * 'visibility' => Whether the component is visible or hidden in - * displayed entities in this view mode, - * ), - * 'teaser' => array( - * // ... - * ), - * ), - * ), - * 'name_of_other_pseudo_field_component' => array( - * // ... - * ), - * ); - * @endcode - * - * @param $entity_type - * The type of entity; e.g. 'node' or 'user'. - * @param $bundle - * The bundle name. - * @param $context - * The context for which the list of pseudo-fields is requested. Either - * 'form' or 'display'. - * - * @return - * The array of pseudo-field elements in the bundle. - */ -function field_extra_fields($entity_type, $bundle, $context) { - $info = _field_info_collate_fields(); - if (isset($info['extra_fields'][$entity_type][$bundle][$context])) { - return $info['extra_fields'][$entity_type][$bundle][$context]; - } - return array(); -} - - -/** * Returns the display settings to use for an instance in a given view mode. * * @param $instance @@ -557,7 +495,7 @@ function field_extra_fields_get_display($entity_type, $bundle, $view_mode) { // mode. $view_mode_settings = field_view_mode_settings($entity_type, $bundle); $actual_mode = (!empty($view_mode_settings[$view_mode]['custom_settings'])) ? $view_mode : 'default'; - $extra_fields = field_extra_fields($entity_type, $bundle, 'display'); + $extra_fields = field_info_extra_fields($entity_type, $bundle, 'display'); $displays = array(); foreach ($extra_fields as $name => $value) { @@ -583,7 +521,7 @@ function _field_extra_fields_pre_render($elements) { $bundle = $elements['#bundle']; if (isset($elements['#type']) && $elements['#type'] == 'form') { - $extra_fields = field_extra_fields($entity_type, $bundle, 'form'); + $extra_fields = field_info_extra_fields($entity_type, $bundle, 'form'); foreach ($extra_fields as $name => $settings) { if (isset($elements[$name])) { $elements[$name]['#weight'] = $settings['weight']; |