From 1550d033643f0ab31912a22c0b69b569017d1ebb Mon Sep 17 00:00:00 2001 From: janw Date: Mon, 15 May 2006 13:30:24 +0000 Subject: [PATCH] Updated error displaying. Only shows first error. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3341 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/include/focus.js | 11 +++++++---- include/functions.inc | 21 +++++++++++---------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/html/include/focus.js b/html/include/focus.js index 3768f4995..18bca2140 100644 --- a/html/include/focus.js +++ b/html/include/focus.js @@ -152,7 +152,7 @@ function hide(element) { document.poppedLayer = document.all[element]; else document.poppedLayer = document.layers[element]; - document.poppedLayer.style.visibility = "hidden"; + document.poppedLayer.style.visibility = "hidden"; } function show(element) { @@ -173,11 +173,11 @@ function toggle(element) { else document.poppedLayer = document.layers[element]; - if (document.poppedLayer.style.visibility == "visible") + if (document.poppedLayer.style.visibility == "visible") { hide (element); - else + } else { show (element); - + } } function popup(target, name) { @@ -207,6 +207,9 @@ function adjust(e) { function adjust_height(e) { if (!e) e=window.event; var px_height= window.innerHeight-230; + if(document.defaultView) { + var div_width=parseInt(document.defaultView.getComputedStyle(document.getElementById("t_scrolltable"),"").getPropertyValue('height')); + } if(px_height >= 480) { document.getElementById("d_scrollbody").style.height=px_height+"px"; } diff --git a/include/functions.inc b/include/functions.inc index 0bee05f49..00f891454 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -953,11 +953,11 @@ function print_red() if (isset($_SESSION['DEBUGLEVEL'])){ if($_SESSION['LastError'] == $string){ - + if((!isset($_SESSION['errorsAlreadyPosted'][$string]))){ $_SESSION['errorsAlreadyPosted'][$string] = 1; } - $_SESSION['errorsAlreadyPosted'][$string] ++; + $_SESSION['errorsAlreadyPosted'][$string]++; }else{ # if((!empty($_SESSION['LastError'])) && ($_SESSION['errorsAlreadyPosted'][$_SESSION['LastError']]>1)){ @@ -986,17 +986,19 @@ function print_red() $string.= "."; } $string= preg_replace('/
/', ' ', $string); - $_SESSION['errors'].= "
". - "". - "". - "

"._("An error occured while processing your request")."

". - "$string "._("Please check your input and fix the contents of the highlighted field. Pess 'OK' to close this message box.")."

"; + + if(isset($_SESSION['errors']) && strlen($_SESSION['errors'])==0) { + $_SESSION['errors'].= "
". + "". + "". + "

"._("An error occured while processing your request")."

". + "$string "._("Please check your input and fix the contents of the highlighted field. Press 'OK' to close this message box.")."

"; + } ######################### - }else{ return; } - $_SESSION['errorsAlreadyPosted'] = array(); + #$_SESSION['errorsAlreadyPosted'] = array(); $_SESSION['errorsAlreadyPosted'][$string] = 1; } @@ -1005,7 +1007,6 @@ function print_red() echo "Error: $string\n"; } $_SESSION['LastError'] = $string; - } -- 2.30.2