You are here

public function FlexiformElementCustomHtml::form in Flexiform 7

Returns the custom html that is defined in the configure form.

Overrides FlexiformElement::form

File

includes/element/custom_html.element.inc, line 12
Contains class for the Custom HTML form element.

Class

FlexiformElementCustomHtml
@file Contains class for the Custom HTML form element.

Code

public function form($form, &$form_state, $entity) {
  $parents = $form['#parents'];
  $parents[] = 'custom_html';
  $value = $form['#flexiform']->elements[$this
    ->getElementNamespace()]['custom_html']['value'];
  $format = $form['#flexiform']->elements[$this
    ->getElementNamespace()]['custom_html']['format'];

  // Perform some keyword substitution.
  $value = $this
    ->replaceCtoolsSubstitutions($value, $form['#flexiform_entities']);
  $form[$this->element_namespace] = array(
    '#type' => 'item',
    '#support_flexiform_conditional_fields' => TRUE,
    '#markup' => check_markup($value, $format),
    '#parents' => $parents,
  );
  $form = parent::form($form, $form_state, $entity);
  return $form;
}