From 6f907f4b5426c739f26c0158189a7d1e66a66b82 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 12 Mar 2006 23:39:57 +0000 Subject: [PATCH] Allow specifying of redirect message text; means removing the redirect time parameter --- printer.php | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/printer.php b/printer.php index 9d9a487..093b286 100644 --- a/printer.php +++ b/printer.php @@ -142,12 +142,12 @@ class Printer * @access public * * @param string Location to redirect to - * @param integer Time to wait before the redirect + * @param string Redirect message to be shown * @param array An aray of POST variables to send through on the redirect */ - function redirect($location, $timeout = 10, $postvars = array()) + function redirect($location, $message = null, $postvars = array()) { - $timeout = $timeout * 200; + $timeout = 10 * 200; if ($postvars) { @@ -213,7 +213,20 @@ JS; $this->form_end(); } - $this->page_message($this->registry->modules['localize']->string('Redirect'), sprintf($this->registry->modules['localize']->string('Please wait to be redirected. If you are not redirected in a few seconds, click here.'), $location)); + $redir = sprintf($this->registry->modules['localize']->string('Please wait to be redirected. If you are not redirected in a few seconds, click here.'), $location); + $override = false; + if ($message == null) + { + $showmessage = $redir; + } + else + { + $showmessage = '
' . $message . '
'; + $showmessage .= "\n

" . $redir . "

"; + $override = true; + } + + $this->page_message($this->registry->modules['localize']->string('Redirect'), $showmessage, $override); $this->page_code($js); @@ -353,12 +366,13 @@ JS; * * @param string The title of the message (appears at the top of the block) * @param string Content of the message + * @param bool Override the message: control the entire output (no
)? */ - function page_message($title, $message) + function page_message($title, $message, $overridemessage = false) { $this->table_start(true, '75%'); $this->table_head($title, 1); - $this->row_span("
$message
", ':swap:', 'left', 1); + $this->row_span(($overridemessage ? $message : "
$message
"), ':swap:', 'left', 1); $this->table_end(); } -- 2.22.5