From 59f31d7cb4d83ae8dfbbb08d6e99ecbc36cbd71c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Fri, 13 Jul 2001 14:52:33 +0000 Subject: [PATCH] Rewritten the 'show_message' function --- lib.inc.php3 | 82 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 27 deletions(-) diff --git a/lib.inc.php3 b/lib.inc.php3 index f4eea5b34..f4a2c6021 100755 --- a/lib.inc.php3 +++ b/lib.inc.php3 @@ -781,42 +781,70 @@ function show_docu($link) { return("[$strDocu]"); } -function show_message($message) { - if(!empty($GLOBALS['reload']) && ($GLOBALS['reload'] == "true")) - { - // Reload the navigation frame via JavaScript + +/** + * Displays a message at the top of the "main" (right) frame + * + * @param string the message to display + */ +function show_message($message) +{ + // Reloads the navigation frame via JavaScript if required + if (!empty($GLOBALS['reload']) && ($GLOBALS['reload'] == 'true')) { + echo "\n"; ?> - + -
- - - - - - -
-
-
- ", nl2br(htmlspecialchars($GLOBALS['sql_query'])); - if (isset($GLOBALS["sql_order"])) echo " $GLOBALS[sql_order]"; - if (isset($GLOBALS["pos"])) echo " LIMIT $GLOBALS[pos], $GLOBALS[cfgMaxRows]";?> +
+ + + - + + + + + +
+
\n"; + // The nl2br function isn't used because its result isn't a valid + // xhtml1.0 statement before php4.0.5 ("
" and not "
") + $new_line = '
' . "\n" . ' '; + $query_base = htmlspecialchars($GLOBALS['sql_query']); + $query_base = ereg_replace("(\015\012)|(\015)|(\012)", $new_line, $query_base); + echo ' ' . $query_base; + if (isset($GLOBALS['sql_order'])) { + echo ' ' . $GLOBALS['sql_order']; + } + // If a 'LIMIT' clause has been programatically added to the query + // displays it + $is_append_limit = (isset($GLOBALS['pos']) + && eregi('^SELECT', $GLOBALS['sql_query']) + && !eregi('LIMIT[ 0-9,]+$', $GLOBALS['sql_query'])); + if ($is_append_limit) { + echo ' LIMIT ' . $GLOBALS['pos'] . ', ' . $GLOBALS['cfgMaxRows']; + } + echo "\n"; + ?> +
-
+