[med-svn] r579 - trunk/community/website/inc

hanska-guest at alioth.debian.org hanska-guest at alioth.debian.org
Thu Oct 4 20:24:35 UTC 2007


Author: hanska-guest
Date: 2007-10-04 20:24:35 +0000 (Thu, 04 Oct 2007)
New Revision: 579

Modified:
   trunk/community/website/inc/header.inc.php
Log:
Working for Markup validation. Step 3: switching to
newer XHTML 1.1.


Modified: trunk/community/website/inc/header.inc.php
===================================================================
--- trunk/community/website/inc/header.inc.php	2007-10-04 20:16:54 UTC (rev 578)
+++ trunk/community/website/inc/header.inc.php	2007-10-04 20:24:35 UTC (rev 579)
@@ -1,10 +1,23 @@
 <?php
 	require_once("locale.inc.php");
-?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$lang?>" lang="<?=$lang?>">
+	
+	if (isset($_SERVER['HTTP_ACCEPT'])) {
+		if (stristr($_SERVER['HTTP_ACCEPT'], "application/xhtml+xml")) {
+			$type = "application/xhtml+xml; charset=UTF-8";
+			$xml = '<?xml version="1.0" encoding="UTF-8"?>'."\n";
+		} else {
+			$type = "text/html; charset=UTF-8";
+			$xml = '';
+		}
+	}
+
+	header("content-type: $type");
+
+?><?=$xml?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/2001/REC-xhtml11-20010531/DTD/xhtml11-flat.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$lang?>">
 <head>
 <title>Debian-Med Project</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Content-Type" content="<?=$type?>" />
 <link href="/inc/style.css" type="text/css" rel="stylesheet" />
 </head>
 <body>




More information about the debian-med-commit mailing list