function linkimagefield_form_content_field_overview_submit in Link Image Field 6
Submit handler to set a new field's formatter to "linkimage_urllink".
1 string reference to 'linkimagefield_form_content_field_overview_submit'
- linkimagefield_form_content_field_overview_form_alter in ./
linkimagefield.module - Implementation of hook_form_[form_id]_alter().
File
- ./
linkimagefield.module, line 245 - Defines a link image field type.
Code
function linkimagefield_form_content_field_overview_submit(&$form, &$form_state) {
if (isset($form_state['fields_added']['_add_new_field']) && isset($form['#type_name'])) {
$new_field = $form_state['fields_added']['_add_new_field'];
$node_type = $form['#type_name'];
$field = content_fields($new_field, $node_type);
if ($field['widget']['module'] == 'linkimagefield') {
foreach ($field['display_settings'] as $display_type => $display_settings) {
if ($field['display_settings'][$display_type]['format'] == 'default') {
$field['display_settings'][$display_type]['format'] = 'linkimage_urllink';
}
}
content_field_instance_update($field);
}
}
}