You are here

function _webform_display_markup in Webform 7.4

Same name and namespace in other branches
  1. 6.3 components/markup.inc \_webform_display_markup()
  2. 7.3 components/markup.inc \_webform_display_markup()

Implements _webform_display_component().

File

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

Code

function _webform_display_markup($component, $value, $format = 'html', $submission = array()) {
  $node = isset($component['nid']) ? node_load($component['nid']) : NULL;
  $value = webform_replace_tokens($component['value'], $node, $submission, NULL, $component['extra']['format']);

  // If the markup value has been set by a conditional, display that value.
  if ($node && is_string($conditional_value = webform_get_conditional_sorter($node)
    ->componentMarkup($component['cid'], $component['page_num']))) {
    $value = check_markup($conditional_value, $component['extra']['format']);
  }
  return array(
    '#weight' => $component['weight'],
    '#theme' => 'webform_display_markup',
    '#format' => $format,
    '#value' => $value,
    '#translatable' => array(
      'title',
    ),
    '#access' => $component['extra']['display_on'] != 'form',
  );
}