From a30d0f624c0eed78841b440d33600b6710107156 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 10 Jun 2005 07:38:00 +0000 Subject: [PATCH] Added error handler git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@645 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/helpviewer.php | 64 +++++++++++++++++++++-------------- ihtml/themes/default/help.tpl | 1 + 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/html/helpviewer.php b/html/helpviewer.php index a9a26825a..741ce53a6 100644 --- a/html/helpviewer.php +++ b/html/helpviewer.php @@ -70,7 +70,6 @@ My PART ^^ ################## */ -set_error_handler("myone"); $helpdir = HELP_BASEDIR."/en/manual_gosa_en/"; // Folder to use for help files $defaultpage = "index.html"; // alternative file, shown on error, or on first call $prefix = "node"; // Prefix of the generated help files @@ -81,31 +80,27 @@ $allowed_chars_in_searchword = "'[^a-z0-9 %_-]'i"; // Remove al $pre_mark = "" ; // Sign words with this $suf_mark = ""; // and this -// Only for testing delete this if everything works fine -function myone($par1,$par2,$par3,$par3) -{ - print "
Seite : ".$par1."
Name : ".$par2."
Seite : ".$par3."
Zeile : ".$par3; -} - +$error_collector= ""; +set_error_handler('gosaRaiseError'); /* Define which tags musst be delete, header, navigation, banner */ $replacements=array(); $replacements['from']=array("@@si", - "@]*?>.*?DIV>@si", - "''", - "/
/", - "@]*?>.*?ADDRESS>@si", - "@<\/BODY[^>]*?>.*?HTML>@si", - "''", - "/

/"); + "@]*?>.*?DIV>@si", + "''", + "/
/", + "@]*?>.*?ADDRESS>@si", + "@<\/BODY[^>]*?>.*?HTML>@si", + "''", + "/

/"); $replacements['to']=array("", - "", - "", - "", - "", - "", - "", - "

"); + "", + "", + "", + "", + "", + "

", + "

"); /* Default pages */ @@ -124,15 +119,14 @@ if(!file_exists(HELP_BASEDIR."/en/manual_gosa_en/")){ $smarty->assign("forward" ,""); $smarty->assign("search_string",""); $smarty->assign("help_contents","
".sprintf(_("Can't read any helpfiles from ' %s ', possibly there is no help available."),HELP_BASEDIR."/en/manual_gosa_en/")); - + /* Output html ...*/ $header= "".$smarty->fetch(get_template_path('headers.tpl')); $display= $header.$smarty->fetch(get_template_path('help.tpl')); echo $display; - }else{ - + /* We prepare to search, all Document for the given keyword */ if(isset($_POST['search'])){ @@ -164,6 +158,16 @@ if(!file_exists(HELP_BASEDIR."/en/manual_gosa_en/")){ /* Create result list */ $smarty->assign("help_contents",searchlist($arr,$res,$maxresults)); + /* show some errors */ + if (isset($_SESSION['errors'])){ + $smarty->assign("errors", $_SESSION['errors']); + } + if ($error_collector != ""){ + $smarty->assign("php_errors", $error_collector.""); + } else { + $smarty->assign("php_errors", ""); + } + /* Output html ...*/ $header= "".$smarty->fetch(get_template_path('headers.tpl')); $display= $header.$smarty->fetch(get_template_path('help.tpl')); @@ -178,7 +182,7 @@ if(!file_exists(HELP_BASEDIR."/en/manual_gosa_en/")){ if(!isset($_SESSION['search_string'])){ $_SESSION['search_string']=""; } - + $smarty->assign("search_string",$_SESSION['search_string']); @@ -238,6 +242,16 @@ if(!file_exists(HELP_BASEDIR."/en/manual_gosa_en/")){ $smarty->assign("index" ,$index); $smarty->assign("forward" ,$forward); + /* show some errors */ + if (isset($_SESSION['errors'])){ + $smarty->assign("errors", $_SESSION['errors']); + } + if ($error_collector != ""){ + $smarty->assign("php_errors", $error_collector.""); + } else { + $smarty->assign("php_errors", ""); + } + /* Fill page */ $header= "".$smarty->fetch(get_template_path('headers.tpl')); $display= $header.$smarty->fetch(get_template_path('help.tpl')); diff --git a/ihtml/themes/default/help.tpl b/ihtml/themes/default/help.tpl index f009f8e1b..f1c188fef 100644 --- a/ihtml/themes/default/help.tpl +++ b/ihtml/themes/default/help.tpl @@ -1,4 +1,5 @@ +{$php_errors}

-- 2.30.2