* Creates a redirect to another page; constructs the header and footer
* (therefore execution stops)
*
- * @param string Controller
- * @param string Action
+ * @param string Location
* @param string Redirect message to be shown
* @param array An aray of POST variables to send through on the redirect
*/
- public static function redirect($controller, $action, $message = null, $postvars = array())
+ public static function redirect($location, $message = null, $postvars = array())
{
if (!defined('ISSO_PRINTER_NO_NAVIGATION'))
{
function redirect()
{
- ' . ($postvars ? 'document.forms.postvars.submit();' : 'window.location = "' . "$controller.php?action=$action" . '";') . '
+ ' . ($postvars ? 'document.forms.postvars.submit();' : 'window.location = "' . $location . '";') . '
}
//-->
if ($postvars)
{
- $vars = new BSPrinterRootForm($controller, $action, 'postvars');
+ $vars = new BSPrinterRootForm($location, $postvars['do'], 'postvars');
+ unset($postvars['do']);
foreach ($postvars as $key => $value)
{
}
$redir = _('Please wait to be redirected. This page will load in a few seconds.');
- $override = false;
if ($message == null)
{
$showmessage = $redir;
{
$showmessage = '<blockquote>' . $message . '</blockquote>';
$showmessage .= "\n<p>" . $redir . "</p>";
- $override = true;
}
$page->addChild(BSPrinterRootPage::message(_('Redirect'), $showmessage));
* action
*
* @param string Message that asks if they want to do X
- * @param string Controller to go for YES
- * @param string Action to pass
+ * @param string Location to go to if the user confirms
+ * @param string Form 'do' value
* @param array Hidden parameters to pass to the next page
*/
- public static function confirm($message, $controller, $action, $params)
+ public static function confirm($message, $action, $do, $params)
{
if (!defined('ISSO_PRINTER_NO_NAVIGATION'))
{
$page = new BSPrinterRootPage(_('Confirm'));
- $form = new BSPrinterRootForm($controller, $action);
+ $form = new BSPrinterRootForm($action, $do);
foreach ($params as $key => $value)
{
$form->addChild(new BSPrinterElement('hidden', $key, $value));