You are here

function _webform_render_markup in Webform 5.2

Same name and namespace in other branches
  1. 5 components/markup.inc \_webform_render_markup()
  2. 6.3 components/markup.inc \_webform_render_markup()
  3. 6.2 components/markup.inc \_webform_render_markup()
  4. 7.4 components/markup.inc \_webform_render_markup()
  5. 7.3 components/markup.inc \_webform_render_markup()

Build a form item array containing all the properties of this component.

Parameters

$component: An array of information describing the component, directly correlating to the webform_component database schema.

Return value

An array of a form item to be displayed on the client-side webform.

1 call to _webform_render_markup()
_webform_submission_display_markup in components/markup.inc
Display the markup in the results. The output of this function will be displayed under the "results" tab then "submissions".

File

components/markup.inc, line 61
Webform module markup component.

Code

function _webform_render_markup($component) {

  // We don't want users to be able to execute filters outside of their permissions on preview.
  if ($_POST['op'] == t('Preview')) {
    $check_filter = TRUE;
  }
  else {
    $check_filter = FALSE;
  }
  $form_item = array(
    '#type' => 'markup',
    '#weight' => $component['weight'],
    '#value' => _webform_filter_values(check_markup($component['value'], $component['extra']['format'], $check_filter), NULL, NULL, FALSE),
    '#prefix' => '<div class="webform-component-' . $component['type'] . '" id="webform-component-' . $component['form_key'] . '">',
    '#suffix' => '</div>',
  );
  return $form_item;
}