From a6d249f70d36f188bf24652d456978ce5d66a2d0 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 25 May 2005 22:30:40 +0000 Subject: [PATCH] Added W3C conformance check git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@459 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/main.php | 39 ++++++++++++++++------------- ihtml/themes/altlinux/framework.tpl | 2 ++ 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/html/main.php b/html/main.php index 1376ea2a6..af4f52d67 100644 --- a/html/main.php +++ b/html/main.php @@ -223,7 +223,7 @@ if (isset($plug)){ } else { $smarty->assign ("plug", ""); } -$mtmp="".$smarty->fetch(get_template_path('headers.tpl')); +$header= "".$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 '

- \"\" -

'; +$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", "\"\""); + $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: diff --git a/ihtml/themes/altlinux/framework.tpl b/ihtml/themes/altlinux/framework.tpl index fce13251e..b8ed5da13 100644 --- a/ihtml/themes/altlinux/framework.tpl +++ b/ihtml/themes/altlinux/framework.tpl @@ -39,6 +39,8 @@
 
{$menu} +
+
{$w3c}
-- 2.30.2