You are here

function _sheetnode_field_ui_field_edit_form_submit in Sheetnode 7

Same name and namespace in other branches
  1. 7.2 sheetnode.module \_sheetnode_field_ui_field_edit_form_submit()

Submit function for field_ui_field_edit_form form.

1 string reference to '_sheetnode_field_ui_field_edit_form_submit'
sheetnode_form_alter in ./sheetnode.module
Implements hook_form_alter().

File

./sheetnode.module, line 912
Module file for the sheetnode module.

Code

function _sheetnode_field_ui_field_edit_form_submit($form, &$form_state) {
  if (!empty($form_state['values']['sheetfield_template'])) {
    $template = _sheetnode_template_load($form_state['values']['sheetfield_template']);
    if (!empty($template)) {

      // WARNING: LANGUAGE_NONE is an assumption.
      $form_state['values'][$form['#field']['field_name']][LANGUAGE_NONE][0]['value'] = $template->value;
    }
  }
  variable_set('sheetfield_template_' . $form['#field']['field_name'], $form_state['values']['sheetfield_template']);
}