You are here

function form_builder_interface in Form Builder 6

Same name and namespace in other branches
  1. 7.2 includes/form_builder.admin.inc \form_builder_interface()
  2. 7 includes/form_builder.admin.inc \form_builder_interface()

Main form building interface. Can be used as a menu callback.

Parameters

$form_type: The type of form being edited. Usually the name of the providing module.

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

1 call to form_builder_interface()
form_builder_webform_components_page in modules/webform/form_builder_webform.module
Menu callback; display a form builder interface to edit webform components.
1 string reference to 'form_builder_interface'
form_builder_examples_menu in examples/form_builder_examples.module
Implementation of hook_menu().

File

includes/form_builder.admin.inc, line 16
form_builder.admin.inc Administrative interface for editing forms.

Code

function form_builder_interface($form_type, $form_id) {
  module_load_include('inc', 'form_builder', 'includes/form_builder.api');
  module_load_include('inc', 'form_builder', 'includes/form_builder.cache');

  // Set the current form type (used for display of the sidebar block).
  form_builder_active_form($form_type, $form_id);

  // Load the current state of the form, or create a new cache if needed.
  $form = form_builder_cache_load($form_type, $form_id);
  if (!$form) {
    $form = form_builder_load_form($form_type, $form_id);
    form_builder_cache_save($form_type, $form_id, $form);
  }
  $output = '';
  $output .= drupal_get_form('form_builder_preview', $form, $form_type, $form_id);
  $output .= drupal_get_form('form_builder_positions', $form, $form_type, $form_id);
  return $output;
}