Adapter Class for XHTML Validator.
More...
Adapter Class for XHTML Validator.
This service is used in developer mode to validate the current screen against XHTML and Accessibility standards. In developer mode a corresponding link will appear in the footer of the page.
/
Definition at line 26 of file class.ilValidatorAdapter.php.
◆ validate()
ilValidatorAdapter::validate |
( |
|
$a_html, |
|
|
|
$a_mode |
|
) |
| |
Definition at line 29 of file class.ilValidatorAdapter.php.
References $_REQUEST, $errors, $lang, $options, and $result.
Referenced by ilTemplate\addILIASFooter().
32 if (!defined(
'UPLOAD_ERR_CANT_WRITE'))
33 define(
'UPLOAD_ERR_CANT_WRITE', 7);
40 define(
'MOZILLA', (isset($_SERVER[
'HTTP_USER_AGENT']) && strpos($_SERVER[
'HTTP_USER_AGENT'],
'Mozilla/') !==
false && strpos($_SERVER[
'HTTP_USER_AGENT'],
'Gecko/') !==
false));
60 require
'./Services/XHTMLValidator/validator/local/en.inc';
73 if ($a_mode ==
"accessibility")
78 $validator =
new validator(
$options);
81 $result = $validator->parse_string($a_html);
86 if ($validator->internal_error()) {
87 $answer.=
"<p>$message[13]:<br />\n";
88 $answer.= nl2br($validator->internal_errors_string()) .
"</p>\n";
95 if ($detected_version = $validator->detected_version()) {
96 $answer.=
"<strong>$message[14]</strong>: $detected_version<br />\n";
100 $answer.=
"<strong>$message[20]</strong>: {$validator->readable_charset()}";
103 if ($validator->lang)
104 $answer.=
"<br />\n<strong>$message[24]</strong>: {$langs[$validator->lang]}";
108 if (
$errors = $validator->error()) {
110 $answer.=
"<br />\n<strong>$message[21]</strong>: $errors</p>\n".
111 "<h2>$message[16]</h2>\n";
114 $answer.=
'<code>' . $validator->errors_source() .
"</code>\n\n";
117 $answer.=
'<p>' . $validator->errors_string() .
"</p>\n\n";
122 $answer.=
"</p><p>$message[15]</p>\n";
128 $html = strtr(nl2br(htmlspecialchars($validator->repaired_source(), ENT_QUOTES,
'UTF-8')), array(
' ' =>
' '));
130 $answer.=
"\n<p> </p>\n<h2>$message[17]</h2>\n";
131 $answer.=
'<div class="code"><code>' . $html .
"</code></div>\n";
146 $answer.=
"<p>$message[13]:<br />\n";
147 $answer.= nl2br($validator->internal_errors_string()) .
"</p>\n";
if(!is_array($argv)) $options
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
The documentation for this class was generated from the following file: