$helpEntry the help entry that is to be displayed. */ function displayHelp(array $helpEntry): void { echoHTMLHead(); echo "

" . $helpEntry['Headline'] . "

\n"; $format = "

" . $helpEntry['Text'] . "

\n"; if (isset($helpEntry['attr'])) { $format .= '

' . _('Technical name') . ': ' . $helpEntry['attr'] . ''; } echo $format; if (isset($helpEntry['SeeAlso']) && is_array($helpEntry['SeeAlso'])) { echo '

' . _('See also') . ': ' . $helpEntry['SeeAlso']['text'] . '

'; } echoHTMLFoot(); } /* If no help number was submitted print error message */ if (!isset($_GET['HelpNumber'])) { $errorMessage = "Sorry no help number submitted."; echoHTMLHead(); statusMessage("ERROR", "", $errorMessage); echoHTMLFoot(); exit; } $helpEntry = []; // module help if (isset($_GET['module']) && ($_GET['module'] != 'main') && ($_GET['module'] != '')) { include_once(__DIR__ . "/../lib/modules.inc"); $moduleName = $_GET['module']; if (!ScopeAndModuleValidation::isValidModuleName($moduleName)) { logNewMessage(LOG_ERR, 'Invalid module name: ' . $moduleName); die(); } $scope = empty($_GET['scope']) ? 'user' : $_GET['scope']; if (!ScopeAndModuleValidation::isValidScopeName($scope)) { logNewMessage(LOG_ERR, 'Invalid scope name: ' . $scope); die(); } $helpEntry = getHelp($moduleName, $_GET['HelpNumber'], $scope); if (!$helpEntry) { $variables = [htmlspecialchars((string) $_GET['HelpNumber']), htmlspecialchars((string) $moduleName)]; $errorMessage = _("Sorry, the help id '%s' is not available for the module '%s'."); echoHTMLHead(); statusMessage("ERROR", "", $errorMessage, $variables); echoHTMLFoot(); exit; } } elseif (!array_key_exists($_GET['HelpNumber'], $helpArray)) { /* If submitted help number is not in help/help.inc print error message */ $variables = [htmlspecialchars((string) $_GET['HelpNumber'])]; $errorMessage = _("Sorry, the help number %s is not available."); echoHTMLHead(); statusMessage("ERROR", "", $errorMessage, $variables); echoHTMLFoot(); exit; } else { $helpEntry = $helpArray[$_GET['HelpNumber']]; } displayHelp($helpEntry);