From b3a4e5f5d7b3b3a25ca1405defe9e23f8de6f965 Mon Sep 17 00:00:00 2001 From: cajus Date: Mon, 15 May 2006 06:33:39 +0000 Subject: [PATCH] Proove of concept for print_red implementation inside a new div git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3326 594d385d-05f5-0310-b6e9-bd551577e9d8 --- ihtml/themes/default/framework.tpl | 1 - include/functions.inc | 64 ++++++++++++++++-------------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/ihtml/themes/default/framework.tpl b/ihtml/themes/default/framework.tpl index 5fdfa2a9d..aecd63b3b 100644 --- a/ihtml/themes/default/framework.tpl +++ b/ihtml/themes/default/framework.tpl @@ -48,7 +48,6 @@ diff --git a/include/functions.inc b/include/functions.inc index 2da2847f4..cee7bf691 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -960,42 +960,45 @@ function print_red() $_SESSION['errorsAlreadyPosted'][$string] ++; }else{ - if((!empty($_SESSION['LastError'])) && ($_SESSION['errorsAlreadyPosted'][$_SESSION['LastError']]>1)){ - $_SESSION['errors'].= "
- {$errors} {$contents}
". - "
\"\"". - "".sprintf(_("Last message repeated %s times."),$_SESSION['errorsAlreadyPosted'][$_SESSION['LastError']])."". - "\"\"src=\"".get_template_path('images/warning.png').
\n"; - } - +# if((!empty($_SESSION['LastError'])) && ($_SESSION['errorsAlreadyPosted'][$_SESSION['LastError']]>1)){ +# $_SESSION['errors'].= "
". +# "
\"\"". +# "".sprintf(_("Last message repeated %s times."),$_SESSION['errorsAlreadyPosted'][$_SESSION['LastError']])."". +# "\"\"src=\"".get_template_path('images/warning.png').
\n"; +# } + +# if($string != NULL){ +# $_SESSION['errors'].= "
". +# "
\"\"". +# "$string". +# "\"\"src=\"".get_template_path('images/warning.png').
\n"; +######### Test ######### if($string != NULL){ - $_SESSION['errors'].= "
". - "
\"\"". - "$string". - "\"\"src=\"".get_template_path('images/warning.png').
\n"; + if (!preg_match('/[.!?]$/', $string)){ + $string.= "."; + } + $string= preg_replace('/
/', ' ', $string); + $_SESSION['errors'].= "
". + "". + "". + "

"._("An error occured while checking the formular input")."

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

"; + ######################### + }else{ return; } $_SESSION['errorsAlreadyPosted'] = array(); $_SESSION['errorsAlreadyPosted'][$string] = 1; -#Test -if (!preg_match('/[.!?]$/', $string)){ - $string.= "."; -} -$_SESSION['errors'].= "
". -"". -"". -"

"._("An error occured while checking the formular input")."

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

"; - } } else { @@ -1227,6 +1230,9 @@ function print_header($image, $headline, $info= "") $display.= " "; $display.= "\n"; } + if (isset($_SESSION['errors'])){ + $display.= $_SESSION['errors']; + } return ($display); } -- 2.30.2