You are here

public function WebformConditionals::componentMarkup in Webform 7.4

Returns the calculated markup as set by conditional logic.

Assumes that the conditionals have already been executed on the given page.

Parameters

int $cid: The component id of the component whose set state is being sought.

int $page_num: The page number that the component is on.

Return value

string The conditional markup, or NULL if none.

File

includes/webform.webformconditionals.inc, line 628
Conditional engine to process dependencies within the webform's conditionals.

Class

WebformConditionals
Performs analysis and topological sorting on the conditionals.

Code

public function componentMarkup($cid, $page_num) {
  if (!$this->markupMap) {

    // The conditionals have not yet been executed on a submission.
    $this
      ->executeConditionals(array(), 0);
    watchdog('webform', 'WebformConditionals::componentMarkup called prior to evaluating a submission.', array(), WATCHDOG_ERROR);
  }
  return isset($this->markupMap[$page_num][$cid]) ? $this->markupMap[$page_num][$cid] : NULL;
}