diff --git a/html/main.php b/html/main.php
index cdce202383b86132ef30f0cf83969dc3a710cdf4..af4f52d67c42fbc4dc41aa406a0f3046be658fae 100644 (file)
--- a/html/main.php
+++ b/html/main.php
} else {
$smarty->assign ("plug", "");
}
-$mtmp= $smarty->fetch(get_template_path('headers.tpl'));
+$header= "<!-- headers.tpl-->".$smarty->fetch(get_template_path('headers.tpl'));
+
/* React on clicks */
if ($_SERVER["REQUEST_METHOD"] == "POST"){
/* Load plugin */
if (is_file("$plugin_dir/main.inc")){
require_once ("$plugin_dir/main.inc");
- print $plugin_dir;
+if(file_exists("dow3ccheck.chk"))
+ print $plugin_dir."/main.inc";
} else {
print_red(sprintf(_("Can't find any plugin definitions for plugin '%s'!"), $plug));
echo $_SESSION['errors'];
} else {
$smarty->assign("php_errors", "");
}
-$display = $mtmp.$smarty->fetch(get_template_path('framework.tpl'));
-print $display;
+$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'));
+ }
+}
-$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 ");
-print $str;
+/* Show page... */
+echo $display;
+/* Save plist */
$_SESSION['plist']= $plist;
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: