You are here

function hook_form_builder_load in Form Builder 6

Same name and namespace in other branches
  1. 7.2 form_builder.api.php \hook_form_builder_load()
  2. 7 form_builder.api.php \hook_form_builder_load()

Take a Form API array and save settings for changed elements.

Parameters

$form_type: The type of form being loaded.

$form_id: The unique identifier for the form being edited.

2 functions implement hook_form_builder_load()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

form_builder_examples_form_builder_load in examples/form_builder_examples.module
Implementation of hook_form_builder_load().
form_builder_webform_form_builder_load in modules/webform/form_builder_webform.module
Implements hook_form_builder_load().
1 invocation of hook_form_builder_load()
form_builder_load_form in includes/form_builder.api.inc
Loader function to retrieve a form builder configuration array.

File

./form_builder.api.php, line 229
These are the hooks that are invoked by Form Builder.

Code

function hook_form_builder_load($form_type, $form_id) {
  if ($form_type == 'node') {
    $node = (object) array(
      'type' => preg_replace('/_node_form/', '', $form_id),
    );

    // Load the form, usually by calling it's function directly.
    $form = node_form(array(), $node);

    // Allow other modules to extend the form.
    drupal_alter('form', $form, array(), $form_id);

    // Loop through the form and add #form_builder properties to each element
    // that is configurable.
    foreach (element_children($form) as $key) {
      $form[$key]['#form_builder'] = array(
        'configurable' => TRUE,
        'removable' => TRUE,
      );
    }
    return $form;
  }
}