public function WebformConditionals::pageVisibility in Webform 7.4
Returns whether a given page should be displayed.
This requires any conditional for the page itself to be shown, plus at least one component within the page must be shown too. The first and preview pages are always shown, however.
Parameters
int $page_num: The page number that the component is on.
Return value
int self::componentHidden or ...Shown.
File
- includes/
webform.webformconditionals.inc, line 552 - Conditional engine to process dependencies within the webform's conditionals.
Class
- WebformConditionals
- Performs analysis and topological sorting on the conditionals.
Code
public function pageVisibility($page_num) {
$result = self::componentHidden;
if ($page_num == 1 || empty($this->visibilityMap[$page_num])) {
$result = self::componentShown;
}
elseif (($page_map = $this->pageMap[$page_num]) && $this
->componentVisibility(reset($page_map), $page_num)) {
while ($cid = next($page_map)) {
if ($this
->componentVisibility($cid, $page_num) != self::componentHidden) {
$result = self::componentShown;
break;
}
}
}
return $result;
}