function ds_field_row_form_format_construct in Display Suite 7.2
Same name and namespace in other branches
- 8.4 includes/field_ui.inc \ds_field_row_form_format_construct()
- 8.2 includes/field_ui.inc \ds_field_row_form_format_construct()
- 8.3 includes/field_ui.inc \ds_field_row_form_format_construct()
Helper function for building the formatter settings.
1 call to ds_field_row_form_format_construct()
- _ds_field_ui_fields in includes/
ds.field_ui.inc - Add the fields to the Field UI form.
File
- includes/
ds.field_ui.inc, line 2433 - Field UI functions for Display Suite.
Code
function ds_field_row_form_format_construct(&$table, $key, $settings_form) {
$base_button = array(
'#submit' => array(
'field_ui_display_overview_multistep_submit',
),
'#validate' => array(
'ds_field_ui_fields_validate',
),
'#ajax' => array(
'callback' => 'field_ui_display_overview_multistep_js',
'wrapper' => 'field-display-overview-wrapper',
'effect' => 'fade',
),
'#field_name' => $key,
);
$table[$key]['format']['settings_edit'] = array(
'#type' => 'container',
'#attributes' => array(
'class' => array(
'field-formatter-settings-edit-form',
),
),
'#parents' => array(
'fields',
$key,
'settings_edit_form',
),
'#weight' => -5,
// Create a settings form where hooks can pick in.
'settings' => $settings_form,
'actions' => array(
'#type' => 'actions',
'save_settings' => $base_button + array(
'#type' => 'submit',
'#name' => $key . '_formatter_settings_update',
'#value' => t('Update'),
'#op' => 'update',
),
'cancel_settings' => $base_button + array(
'#type' => 'submit',
'#name' => $key . '_formatter_settings_cancel',
'#value' => t('Cancel'),
'#op' => 'cancel',
// Do not check errors for the 'Cancel' button.
'#limit_validation_errors' => array(),
),
),
);
$table[$key]['#attributes']['class'][] = 'field-formatter-settings-editing';
$table[$key]['format']['type']['#attributes']['class'] = array(
'element-invisible',
);
}