From: cajus Date: Mon, 15 May 2006 06:33:39 +0000 (+0000) Subject: Proove of concept for print_red implementation inside a new div X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b3a4e5f5d7b3b3a25ca1405defe9e23f8de6f965;p=gosa.git 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 --- 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); }