From 54ff978f115e63b0dd3d446dc58e038f837430dc Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 17 Dec 2005 20:51:20 +0000 Subject: [PATCH] Added POST redirect to pass POST variables through --- printer.php | 60 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 7 deletions(-) diff --git a/printer.php b/printer.php index ad9e0d2..8f4ae4d 100644 --- a/printer.php +++ b/printer.php @@ -85,13 +85,40 @@ class Printer * * @param string Location to redirect to * @param integer Time to wait before the redirect + * @param array An aray of POST variables to send through on the redirect */ - function redirect($location, $timeout = 10) + function redirect($location, $timeout = 10, $postvars = array()) { $timeout = $timeout * 200; - $js = -<< + + +JS; + } + else + { + $js = << + //--> -EOD; +JS; + } - $this->page_start($this->registry->modules['localize']->string('Redirect'), ':default:', 15, $js); + $this->page_start($this->registry->modules['localize']->string('Redirect')); + + if ($postvars) + { + $this->form_start($location, null, false, 'postvars'); + + foreach ($postvars AS $key => $value) + { + $this->form_hidden_field($key, $value); + } + + $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)); + $this->page_code($js); + $this->page_end(); } @@ -524,7 +566,11 @@ EOD; function form_start($action, $do, $enctype = false, $name = 'inputform', $submitmethod = 'post') { echo "\n\n
\n"; - $this->form_hidden_field('do', $do); + + if ($do !== null) + { + $this->form_hidden_field('do', $do); + } } // ################################################################### -- 2.43.5