You are here

class HiddenElement in Form Builder 7.2

Special behaviour for hidden elements.

Hierarchy

Expanded class hierarchy of HiddenElement

1 file declares its use of HiddenElement
form_builder_webform.components.inc in modules/webform/form_builder_webform.components.inc
Default webform component callbacks for functionality related to the Form Builder.

File

modules/webform/src/HiddenElement.php, line 8

Namespace

Drupal\form_builder_webform
View source
class HiddenElement extends Element {

  /**
   * {@inheritdoc}
   */
  public function configurationForm($form, &$form_state) {
    $form = parent::configurationForm($form, $form_state);

    // Configure default value as textarea to allow for more data.
    $form['default_value']['#type'] = 'textarea';

    // Add configuration for $component['extra']['hidden_type'].
    $display['#form_builder']['property_group'] = 'display';
    $e = webform_component_invoke('hidden', 'edit', $this->element['#webform_component']);
    $form['hidden_type'] = $e['display']['hidden_type'] + $display;
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function configurationSubmit(&$form, &$form_state) {
    parent::configurationSubmit($form, $form_state);
    $this->element['#webform_component']['extra']['hidden_type'] = $form_state['values']['extra']['hidden_type'];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Element::componentEditForm protected function Generate the component edit form for this component.
Element::key public function Get the element’s form key. Overrides ElementBase::key
Element::render public function (Re-)Render an element. Overrides ElementBase::render
Element::setProperty protected function Set the value of a property. Overrides ElementBase::setProperty
Element::title public function Get a human-readable title for this form element. Overrides ElementBase::title
ElementBase::$element protected property
ElementBase::$form protected property
ElementBase::$loader protected property
ElementBase::$params protected property
ElementBase::addPreRender protected function Add our pre-render function to the element-array.
ElementBase::getProperties public function Get a list of properties available for this element. Overrides ElementInterface::getProperties
ElementBase::getSaveableProperties public function Get a list of properties that are supported in any way by this element. Overrides ElementInterface::getSaveableProperties
ElementBase::parentId public function
ElementBase::__construct public function Overrides ElementInterface::__construct
HiddenElement::configurationForm public function Get the configuration form for this element. Overrides Element::configurationForm
HiddenElement::configurationSubmit public function Submit handler for the configuration form. Overrides ElementBase::configurationSubmit