field_ui_inactive_message

  1. drupal
    1. 8
    2. 7
Versions
8 – 7 field_ui_inactive_message($entity_type, $bundle)

Helper function to display a message about inactive fields.

▾ 2 functions call field_ui_inactive_message()

field_ui_display_overview_form in modules/field_ui/field_ui.admin.inc
Menu callback; presents field display settings for a given view mode.
field_ui_field_overview_form in modules/field_ui/field_ui.admin.inc
Menu callback; listing of fields for a bundle.

Code

modules/field_ui/field_ui.admin.inc, line 56

<?php
function field_ui_inactive_message($entity_type, $bundle) {
  $inactive_instances = field_ui_inactive_instances($entity_type, $bundle);
  if (!empty($inactive_instances)) {
    $field_types = field_info_field_types();
    $widget_types = field_info_widget_types();

    foreach ($inactive_instances as $field_name => $instance) {
      $list[] = t('%field (@field_name) field requires the %widget_type widget provided by %widget_module module', array(
        '%field' => $instance['label'], 
        '@field_name' => $instance['field_name'], 
        '%widget_type' => isset($widget_types[$instance['widget']['type']]) ? $widget_types[$instance['widget']['type']]['label'] : $instance['widget']['type'], 
        '%widget_module' => $instance['widget']['module'],
      ));
    }
    drupal_set_message(t('Inactive fields are not shown unless their providing modules are enabled. The following fields are not enabled: !list', array('!list' => theme('item_list', array('items' => $list)))), 'error');
  }
}
?>