You are here

public function FormBuilderPropertyBase::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 FormBuilderPropertyInterface::form

1 method overrides FormBuilderPropertyBase::form()
FormBuilderWebformProperty::form in modules/webform/form_builder_webform.classes.inc
Generate form-API elements for editing this property.

File

./form_builder.classes.inc, line 978

Class

FormBuilderPropertyBase

Code

public function form(&$form_state, $element) {
  $e = $element
    ->render();
  if (isset($this->params['form']) && function_exists($this->params['form'])) {
    $function = $this->params['form'];
    $p = $this->property;

    // Set a default value on the property to avoid notices.
    $e['#' . $p] = isset($e['#' . $p]) ? $e['#' . $p] : NULL;
    return $function($form_state, $this->formTypeName, $e, $p);
  }
  return array();
}