You are here

function _webform_render_markup in Webform 6.3

Same name and namespace in other branches
  1. 5.2 components/markup.inc \_webform_render_markup()
  2. 5 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()

Implements _webform_render_component().

File

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

Code

function _webform_render_markup($component, $value = NULL, $filter = TRUE) {
  $node = isset($component['nid']) ? node_load($component['nid']) : NULL;
  $element = array(
    '#type' => 'markup',
    '#title' => $filter ? NULL : $component['name'],
    '#weight' => $component['weight'],
    '#markup' => $filter ? _webform_filter_values(check_markup($component['value'], $component['extra']['format'], FALSE), $node, NULL, NULL, FALSE) : $component['value'],
    '#format' => $component['extra']['format'],
    '#theme_wrappers' => array(
      'webform_element_wrapper',
    ),
    '#post_render' => array(
      'webform_element_wrapper',
    ),
    '#translatable' => array(
      'title',
      'markup',
    ),
  );

  // TODO: Remove when #markup becomes available in D7.
  $element['#value'] = $element['#markup'];
  return $element;
}