| 1 field_group.field_ui.inc | field_group_format_type_form(array $form, array &$form_state, $group) |
Form constructor for the format type edit page.
Parameters
array $form: An associative array containing the structure of the form.
array $form_state: An associative array containing the current state of the form, which is passed by reference.
object $group: Group object.
See also
field_group_format_type_form_submit()
Related topics
File
- core/
modules/ field_group/ field_group.field_ui.inc, line 1065 - Field_group.field_ui.inc is a file that contains most functions needed on the Fields UI Manage forms (display and fields).
Code
function field_group_format_type_form(array $form, array &$form_state, $group) {
$form = array(
'#bundle' => $group->bundle,
'#entity_type' => $group->entity_type,
'#group' => $group,
);
$form['field_group'] = array(
'#type' => 'fieldset',
'#title' => t('Change format type'),
);
$form['field_group']['type'] = array(
'#type' => 'select',
'#title' => t('Format type'),
'#required' => TRUE,
'#options' => field_group_field_formatter_options('form'),
'#default_value' => $group->format_type,
'#description' => t('Select a new format type for %field_group field group on the form. Each format type has its own settings which can be configured afterwards.', array('%field_group' => $group->label)),
'#attributes' => array('class' => array('field-group-type')),
);
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit', '#value' => t('Continue'),
);
$form['#validate'] = array();
$form['#submit'] = array('field_group_format_type_form_submit');
return $form;
}