You are here

public function FormBuilderWebformProperty::form in Form Builder 7

Generate form-API elements for editing this property.

Parameters

array $form_state: Form API form_state of the field configure form.

FormBuilderFormElement $element: The currently stored element. Use this to get the "current" values.

Return value

array Form-API array that will be merged into the field configure form.

Overrides FormBuilderPropertyBase::form

File

modules/webform/form_builder_webform.classes.inc, line 226

Class

FormBuilderWebformProperty

Code

public function form(&$form_state, $element) {

  // We use the rendered element here to re-use the form-API functions.
  $e = $element
    ->render();
  $e += array(
    "#{$this->property}" => $this
      ->getValue($e['#webform_component']),
  );

  // Set weight to just anything. Element positions aren't configured in
  // this way in form_builder.
  $e['#webform_component']['weight'] = 0;
  if (isset($this->params['form']) && function_exists($this->params['form'])) {
    $function = $this->params['form'];
    return $function($form_state, $this->formTypeName, $e, $this->property);
  }
  return array();
}