Fixing some references to controller/action that we used back when we were going...
authorRobert Sesek <rsesek@bluestatic.org>
Fri, 25 Jan 2008 17:21:19 +0000 (12:21 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Fri, 25 Jan 2008 17:21:19 +0000 (12:21 -0500)
* PrinterRootForm.php: Renamed BSPrinterRootForm->controller to be ->action and BSPrinterRootForm->action to be ->do
(BSPrinterRootForm::__construct): Changes to ivar assignment
(BSPrinterRootForm::paint): Changes for ivar names
* PrinterRootPage.php: ditto
(BSPrinterRootPage::redirect): Take a location instead of a controller/action pair; additionally, make changes for postvars
(BSPrinterRootPage::confirm): Rename parameters to match BSPrinterRootForm ivars

PrinterRootForm.php
PrinterRootPage.php

index c04dacf0b30f596c0781fdff7108564d0bdd36de..8c0deb8416dc3f69f10e1884081ff1e34854db01 100644 (file)
@@ -41,16 +41,16 @@ require_once(ISSO . '/PrinterRootAbstract.php');
 class BSPrinterRootForm extends BSPrinterRootAbstract
 {
        /**
-       * The form's action (or the controller to respond to)
+       * The form's action
        * @var string
        */
-       private $controller;
+       private $action;
        
        /**
-       * Method to use
+       * "Do" parameter
        * @var string
        */
-       private $action;
+       private $do;
        
        /**
        * The form's name
@@ -68,10 +68,10 @@ class BSPrinterRootForm extends BSPrinterRootAbstract
        /**
        * Constructor
        */
-       public function __construct($controller, $action, $name = 'issoform')
+       public function __construct($action, $do, $name = 'issoform')
        {
-               $this->controller = $controller;
                $this->action = $action;
+               $this->do = $do;
                $this->name = $name;
        }
        
@@ -141,9 +141,9 @@ class BSPrinterRootForm extends BSPrinterRootAbstract
        */
        public function paint()
        {
-               array_push($this->children, new BSPrinterElement('hidden', 'action', $this->action));
+               array_push($this->children, new BSPrinterElement('hidden', 'do', $this->do));
                
-               return "\n<form name=\"" . $this->name . "\" action=\"" . $this->controller . "\" method=\"post\"" . ($this->upload ? ' enctype="mime/multi-part"' : '') . ">\n" . $this->_paintChildren() . "\n</form>";
+               return "\n<form name=\"" . $this->name . "\" action=\"" . $this->action . "\" method=\"post\"" . ($this->upload ? ' enctype="mime/multi-part"' : '') . ">\n" . $this->_paintChildren() . "\n</form>";
        }
 }
 
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));