FieldInfo::prepareInstanceDisplay
public function FieldInfo::prepareInstanceDisplay
public FieldInfo::prepareInstanceDisplay($display, $field_type)
Adapts display specifications to the current run-time context.
Parameters
$display: Display specifications as found in $instance['display']['a_view_mode'].
$field_type: The field type.
Return value
The display properties completed for the current runtime context.
File
- modules/field/field.info.class.inc, line 609
Class
- FieldInfo
- Provides field and instance definitions for the current runtime environment.
Code
public function prepareInstanceDisplay($display, $field_type) { $field_type_info = field_info_field_types($field_type); // Fill in default values. $display += array( 'label' => 'above', 'settings' => array(), 'weight' => 0, ); if (empty($display['type'])) { $display['type'] = $field_type_info['default_formatter']; } if ($display['type'] != 'hidden') { $formatter_type_info = field_info_formatter_types($display['type']); // Fall back to default formatter if formatter type is not available. if (!$formatter_type_info) { $display['type'] = $field_type_info['default_formatter']; $formatter_type_info = field_info_formatter_types($display['type']); } $display['module'] = $formatter_type_info['module']; // Fill in default settings for the formatter. $display['settings'] += field_info_formatter_settings($display['type']); } return $display; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field!field.info.class.inc/function/FieldInfo::prepareInstanceDisplay/7.x