You are here

function form_builder_webform_form_builder_properties in Form Builder 6

Same name and namespace in other branches
  1. 7.2 modules/webform/form_builder_webform.module \form_builder_webform_form_builder_properties()
  2. 7 modules/webform/form_builder_webform.module \form_builder_webform_form_builder_properties()

Implements hook_form_builder_properties().

File

modules/webform/form_builder_webform.module, line 249
Form Builder integration for the Webform module.

Code

function form_builder_webform_form_builder_properties($form_type) {
  $properties = array();
  if ($form_type == 'webform') {
    $components = webform_components();
    foreach ($components as $component_type => $component) {

      // Components providing a map to automatically list properties.
      if ($map = _form_builder_webform_property_map($component_type)) {
        foreach ($map['properties'] as $property_name => $property_map) {
          if (isset($property_map['form_parents'])) {
            $properties[$property_name] = array(
              'form' => '_form_builder_webform_mapped_form',
            );
          }
        }
      }

      // Individual components manually providing properties.
      if ($additional_properties = form_builder_webform_component_invoke($component_type, 'form_builder_properties')) {
        $properties = array_merge($properties, $additional_properties);
      }
    }
  }
  return $properties;
}