You are here

function form_builder_active_form in Form Builder 6

Same name and namespace in other branches
  1. 7.2 form_builder.module \form_builder_active_form()
  2. 7 form_builder.module \form_builder_active_form()

Static storage of the current type of form being edited (if any).

Parameters

$new_type_name: The name of the type being edited. If this value is passed in, the static variable is set. If this parameter is ommited, the current type is returned. Pass in FALSE to reset current type.

4 calls to form_builder_active_form()
form_builder_block_view in ./form_builder.module
Implements hook_block_view().
form_builder_field_palette in includes/form_builder.admin.inc
Render the palette of fields to add to a form.
form_builder_interface in includes/form_builder.admin.inc
Main form building interface. Can be used as a menu callback.
form_builder_property_key_form_validate in includes/form_builder.properties.inc
Element validate function for the "key" property. Ensure safe characters.

File

./form_builder.module, line 319
form_builder.module Generic form building framework and user interface.

Code

function form_builder_active_form($new_type = NULL, $new_id = NULL) {
  static $active_form = FALSE;
  if (isset($new_type) && isset($new_id)) {
    if (!$new_type && !$new_id) {
      $active_form = FALSE;
    }
    else {
      $active_form['form_type'] = $new_type;
      $active_form['form_id'] = $new_id;
    }
  }
  return $active_form;
}