X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=html%2Fmain.php;h=8743d378c3ce95928156212ba1c7d0ef2c08fd71;hb=4a5b8eaea2416e1ce48f6253499ffae3b4967884;hp=1376ea2a694feb30165b2034305aab5104ba443d;hpb=3889493e30503f2a351b9f85c85af66c4cbfecc1;p=gosa.git diff --git a/html/main.php b/html/main.php index 1376ea2a6..8743d378c 100644 --- a/html/main.php +++ b/html/main.php @@ -24,10 +24,6 @@ require_once ("../include/php_setup.inc"); require_once ("functions.inc"); header("Content-type: text/html; charset=UTF-8"); -/* Reset error handler */ -$error_collector= ""; -set_error_handler('gosaRaiseError'); - /* Find all class files and include them */ get_dir_list("$BASE_DIR/plugins"); @@ -202,11 +198,19 @@ if(isset($_SESSION['POST'])){ /* show web frontend */ $smarty->assign ("date", date("l, dS F Y H:i:s O")); $smarty->assign ("must", "*"); +if (isset($plug)){ + $plug= "?plug=$plug"; +} else { + $plug= ""; +} if ($_SESSION['js']==FALSE){ $smarty->assign("javascript", "false"); + $smarty->assign("help_method", "href='helpviewer.php$plug' target='_new'"); } else { $smarty->assign("javascript", "true"); + $smarty->assign("help_method"," onclick=\"return popup('helpviewer.php$plug','GOsa help');\""); } + $smarty->assign ("username", $ui->username); $smarty->assign ("go_logo", get_template_path('images/go_logo.png')); $smarty->assign ("go_base", get_template_path('images/dtree.png')); @@ -218,12 +222,9 @@ $smarty->assign ("go_left", get_template_path('images/go_left.png')); $smarty->assign ("go_help", get_template_path('images/help.png')); $plist->gen_menu(); $smarty->assign ("menu", $plist->menu); -if (isset($plug)){ - $smarty->assign ("plug", "?plug=$plug"); -} else { - $smarty->assign ("plug", ""); -} -$mtmp="".$smarty->fetch(get_template_path('headers.tpl')); +$smarty->assign ("plug", "$plug"); + +$header= "".$smarty->fetch(get_template_path('headers.tpl')); /* React on clicks */ @@ -258,8 +259,6 @@ if (isset ($_SESSION['post_cnt'])){ /* Load plugin */ if (is_file("$plugin_dir/main.inc")){ require_once ("$plugin_dir/main.inc"); -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']; @@ -276,24 +275,31 @@ 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 '

- \"\" -

'; +$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']) && preg_match('/true/i', $config->data['MAIN']['W3CTEST'])) { + + /* Use PHP tidy for debugging */ + $tidy = new tidy(); + $config = array('indent' => TRUE, + 'output-xhtml' => TRUE, + 'wrap' => 200); + $display = tidy_parse_string($display, $config, 'UTF8'); + tidy_clean_repair($display); + $cnt = (tidy_error_count($display))+(tidy_warning_count($display)); + if($cnt != 0){ + echo "
\"\" "._("Generating this page caused the W3C conformance checker to raise some errors!")."
"; } + tidy_clean_repair($display); +} + +/* Show page... */ +echo $display; +/* Save plist */ $_SESSION['plist']= $plist; // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: