Fixing some references to controller/action that we used back when we were going...
[isso.git] / PrinterRootPage.php
index f236594c40c3912277509aeb0b7d7427a2476747..ed54f9567c8ad9a9e58f13826a2173d0918e8490 100644 (file)
@@ -103,12 +103,11 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
        * 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'))
                {
@@ -133,7 +132,7 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
 
                function redirect()
                {
-                       ' . ($postvars ? 'document.forms.postvars.submit();' : 'window.location = "' . "$controller.php?action=$action"  . '";')  . '
+                       ' . ($postvars ? 'document.forms.postvars.submit();' : 'window.location = "' . $location  . '";')  . '
                }
                
        //-->
@@ -141,7 +140,8 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
                
                if ($postvars)
                {
-                       $vars = new BSPrinterRootForm($controller, $action, 'postvars');
+                       $vars = new BSPrinterRootForm($location, $postvars['do'], 'postvars');
+                       unset($postvars['do']);
                        
                        foreach ($postvars as $key => $value)
                        {
@@ -152,7 +152,6 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
                }
                
                $redir = _('Please wait to be redirected. This page will load in a few seconds.');
-               $override = false;
                if ($message == null)
                {
                        $showmessage = $redir;
@@ -161,7 +160,6 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
                {
                        $showmessage = '<blockquote>' . $message . '</blockquote>';
                        $showmessage .= "\n<p>" . $redir . "</p>";
-                       $override = true;
                }
 
                $page->addChild(BSPrinterRootPage::message(_('Redirect'), $showmessage));
@@ -202,11 +200,11 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
        * 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'))
                {
@@ -215,7 +213,7 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
                
                $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));