Code

Added W3C conformance check
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 25 May 2005 22:30:40 +0000 (22:30 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 25 May 2005 22:30:40 +0000 (22:30 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@459 594d385d-05f5-0310-b6e9-bd551577e9d8

html/main.php
ihtml/themes/altlinux/framework.tpl

index 1376ea2a694feb30165b2034305aab5104ba443d..af4f52d67c42fbc4dc41aa406a0f3046be658fae 100644 (file)
@@ -223,7 +223,7 @@ if (isset($plug)){
 } else {
   $smarty->assign ("plug", "");
 }
-$mtmp="<!-- headers.tpl-->".$smarty->fetch(get_template_path('headers.tpl'));
+$header= "<!-- headers.tpl-->".$smarty->fetch(get_template_path('headers.tpl'));
 
 
 /* React on clicks */
@@ -276,24 +276,29 @@ if ($error_collector != ""){
 } else {
   $smarty->assign("php_errors", "");
 }
-$display = $mtmp.$smarty->fetch(get_template_path('framework.tpl'));
-print $display;
-
-if(file_exists("dow3ccheck.chk"))
-  {
-  $fp = fopen("/tmp/current.html","w+");
-  fwrite($fp,$display,strlen($display));
-  $str = shell_exec( "curl -F uploaded_file=@/tmp/current.html http://127.0.0.1/w3c-markup-validator/check ");
-  if(!preg_match("/This Page Is Valid/",$str ))
-    print $str;
-  else
-    print '<p>
-      <a href="http://dyn-209/w3c-markup-validator/check?uri=referer"><img alt=\"\" border="0"
-          src="http://dyn-209/w3c-markup-validator/images/vh401.png"
-          alt="Valid HTML 4.01!" height="31" width="88"></a>
-    </p>';
+$smarty->assign("w3c", "");
+$display= $header.$smarty->fetch(get_template_path('framework.tpl'));
+
+/* For development, perform a W3C conformance check if specified in gosa.conf */
+if (isset($config->data['MAIN']['W3CTEST'])) {
+  $fp = fopen("/tmp/gosa.html","w+");
+  fwrite($fp, $display, strlen($display));
+  $url= $config->data['MAIN']['W3CTEST'];
+  $str = shell_exec( "curl -F uploaded_file=@/tmp/gosa.html $url/check");
+  if(!preg_match("/This Page Is Valid/i",$str )){
+    /* Show errors */
+    echo $str;
+  } else {
+    /* Re-render page with W3C logo */
+    $smarty->assign("w3c", "<a href=\"$url/check?uri=referer\"><img alt=\"\" border=\"0\" src=\"$url/images/vh401.png\" alt=\"Valid HTML 4.01!\" height=\"31\" width=\"88\"></a>");
+    $display= $header.$smarty->fetch(get_template_path('framework.tpl'));
   }
+}
+
+/* Show page... */
+echo $display;
 
+/* Save plist */
 $_SESSION['plist']= $plist;
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index fce13251ea82808a2a72b169e11876ca1383cbb0..b8ed5da13f605c7786c43484428c7632e522515e 100644 (file)
@@ -39,6 +39,8 @@
     <td style="background-color:#5353ad; vertical-align:top;">
       <div style="background-color:#5353ad; height:12px; width:100%;">&nbsp;</div>
       {$menu}
+         <br>
+         <center>{$w3c}</center>
       <div style="height:100px; width:140px;"></div>
     </td>