You are here

function content_inactive_message in Content Construction Kit (CCK) 6.2

Same name and namespace in other branches
  1. 6.3 includes/content.admin.inc \content_inactive_message()

Helper function to display a message about inactive fields.

2 calls to content_inactive_message()
content_display_overview_form in includes/content.admin.inc
Menu callback; presents a listing of fields display settings for a content type.
content_field_overview_form in includes/content.admin.inc
Menu callback; listing of fields for a content type.

File

includes/content.admin.inc, line 106
Administrative interface for content type creation.

Code

function content_inactive_message($type_name) {
  $inactive_fields = content_inactive_fields($type_name);
  if (!empty($inactive_fields)) {
    $field_types = _content_field_types();
    $widget_types = _content_widget_types($type_name);
    drupal_set_message(t('This content type has inactive fields. Inactive fields are not included in lists of available fields until their modules are enabled.'), 'error');
    foreach ($inactive_fields as $field_name => $field) {
      drupal_set_message(t('!field (!field_name) is an inactive !field_type field that uses a !widget_type widget.', array(
        '!field' => $field['widget']['label'],
        '!field_name' => $field['field_name'],
        '!field_type' => array_key_exists($field['type'], $field_types) ? $field_types[$field['type']]['label'] : $field['type'],
        '!widget_type' => array_key_exists($field['widget']['type'], $widget_types) ? $widget_types[$field['widget']['type']]['label'] : $field['widget']['type'],
      )));
    }
  }
}