You are here

function theme_form_builder_wrapper in Form Builder 7.2

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

Output the wrapper around the form_builder preview.

Optionally outputs the field palette if it is not already available as a block.

File

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

Code

function theme_form_builder_wrapper($variables) {
  $element = $variables['element'];
  $output = '';
  $output .= '<div id="form-builder-wrapper" class="' . ($element['#show_palette'] ? 'with-palette' : 'no-palette') . '">';
  if ($element['#show_palette']) {
    $output .= '<div id="form-builder-fields">';
    $output .= '<div class="block">';
    $output .= form_builder_field_palette();
    $output .= '</div>';
    $output .= '</div>';
  }
  $output .= '<div id="form-builder">';
  if (isset($element['#title'])) {
    $output .= '<h3 class="form-builder-title">' . $element['#title'] . '</h3>';
  }

  // Add the contents of the form and close the wrappers.
  $output .= $element['#children'];
  $output .= '</div>';

  // #form-builder.
  $output .= '</div>';

  // #form-builder-wrapper.
  return $output;
}