You are here

function custom_formatters_form_builder_submit in Custom Formatters 7.2

Submit callback for Custom Formatters form builder integration.

Parameters

array $form: The form api array.

array $form_state: The form state array.

1 string reference to 'custom_formatters_form_builder_submit'
form_builder_custom_formatters_form_alter_alter in includes/form_builder.inc
Implements hook_custom_formatters_form_alter_alter().

File

includes/form_builder.inc, line 51
Form Builder module integration.

Code

function custom_formatters_form_builder_submit($form, &$form_state) {
  module_load_include('inc', 'form_builder', 'includes/form_builder.admin');
  module_load_include('inc', 'form_builder', 'includes/form_builder.api');
  module_load_include('inc', 'form_builder', 'includes/form_builder.cache');

  // @TODO - Reproduce this functionality or require form_builder_examples.module.
  include drupal_get_path('module', 'form_builder') . '/examples/form_builder_examples.module';
  $form_id = drupal_substr($form['form_build_id']['#value'], 0, 32);
  $form_cache = form_builder_cache_load('custom_formatters', $form_id);
  if (is_array($form_cache)) {
    $form_state['item']->fapi = form_builder_examples_export_recurse($form_cache);
  }

  // Remove the cached form_builder form.
  form_builder_cache_delete('custom_formatters', $form_id);
}