// Copyright: Copyright (C) 2004-2007 Pristine Communications // Set the include path if (!defined("INCPATH_SET")) { require_once dirname(__FILE__) . "/incpath.inc.php"; } // Referenced subroutines require_once "monica/addget.inc.php"; require_once "monica/cgiemu.inc.php"; require_once "monica/gettext.inc.php"; require_once "monica/htmlchar.inc.php"; require_once "monica/https.inc.php"; require_once "monica/ipv4addr.inc.php"; require_once "monica/pagefunc.inc.php"; require_once "monica/requri.inc.php"; // html_validator: Print the HTML validator buttons function html_validator($args = null) { // Obtain page parameters $args = page_param($args); // This is only for the preview and development website if ( !(!is_null($args["preview"]) || (defined("IS_PROD") && !IS_PROD))) { return; } // Non-static or preview pages - use the validator in the client network if (!$args["static"] || !is_null($args["preview"])) { // The client is in the Pristine Network if ( ipv4_in_network("172.16.168.0/24", $_SERVER["REMOTE_ADDR"]) || ipv4_in_network("211.78.169.160/29", $_SERVER["REMOTE_ADDR"])) { $html_validator = "html-validator.pristine.com.tw"; // The client is in imacat's Network } elseif ( ipv4_in_network("10.0.0.0/24", $_SERVER["REMOTE_ADDR"]) || ipv4_in_network("211.20.30.96/29", $_SERVER["REMOTE_ADDR"])) { $html_validator = "html-validator.imacat.idv.tw"; // Elsewhere } else { $html_validator = "validator.w3.org"; } // Static pages on the development site - use the validator in the server network } elseif (defined("IS_PROD") && !IS_PROD) { // The server is in the Pristine Network if ( ipv4_in_network("172.16.168.0/24", $_SERVER["SERVER_ADDR"]) || ipv4_in_network("211.78.169.160/29", $_SERVER["SERVER_ADDR"])) { $html_validator = "html-validator.pristine.com.tw"; // The server is in imacat's Network } elseif ( ipv4_in_network("10.0.0.0/24", $_SERVER["SERVER_ADDR"]) || ipv4_in_network("211.20.30.96/29", $_SERVER["SERVER_ADDR"])) { $html_validator = "html-validator.imacat.idv.tw"; // Elsewhere } else { $html_validator = "validator.w3.org"; } } // Set the picture host to our same host $pic_host = REQUEST_SCHEME . "://" . REQUEST_HOST; if (is_https()) { if ($_SERVER["SERVER_PORT"] != 443) { $pic_host .= ":" . $_SERVER["SERVER_PORT"]; } } else { if ($_SERVER["SERVER_PORT"] != 80) { $pic_host .= ":" . $_SERVER["SERVER_PORT"]; } } // The HTML version $htmlver = "XHTML 1.1"; if (defined("HTML_VERSION")) { $htmlver = HTML_VERSION; } switch ($htmlver) { // Default to XHTML 1.1 case "XHTML 1.1": default: $htmlbut = "http://$html_validator/images/vxhtml10"; $htmlver = "XHTML 1.1"; break; case "XHTML 1.1": $htmlbut = "http://$html_validator/images/vxhtml11"; break; case "HTML 4.01": $htmlbut = "http://$html_validator/images/vh401"; break; case "HTML 4.0": $htmlbut = "http://$html_validator/images/vh40"; break; case "HTML 3.2": $htmlbut = "http://$html_validator/images/vh32"; break; case "HTML 3.0": $htmlbut = "http://$html_validator/images/vh30"; break; case "HTML 2.0": $htmlbut = "http://$html_validator/images/vh20"; break; } if ($args["static"] && is_null($args["preview"])) { $hvurl = "http://$html_validator/check/referer"; } else { $url = REQUEST_FULLURI; if (isset($_SESSION)) { $url = add_get_arg($url, session_name(), session_id()); } $hvurl = "http://$html_validator/check?uri=" . urlencode($url); } $areatitle = C_("HTML Validatior Logo Area"); $vhtmltitle = C_("HTML validation result of this page"); $vhtmlalt = sprintf(C_("Valid %s!"), $htmlver); $vcsstitle = C_("CSS validation result of this page"); $vcssalt = C_("Valid CSS!"); $wcag1title = C_("Explanation of Level Triple-A Conformance"); $wcag1alt = C_("Level Triple-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0"); ?>
hreflang="en"><?php echo h($vhtmlalt); ?>| hreflang="en"><?php echo h($vcssalt); ?>| hreflang="en"><?php echo h($wcag1alt); ?>