From f39b27af0ccf858d036da9ad17772aa2c4c0644a Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 25 Jan 2008 12:21:19 -0500 Subject: [PATCH] Fixing some references to controller/action that we used back when we were going to have a controller module * 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 | 16 ++++++++-------- PrinterRootPage.php | 20 +++++++++----------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/PrinterRootForm.php b/PrinterRootForm.php index c04dacf..8c0deb8 100644 --- a/PrinterRootForm.php +++ b/PrinterRootForm.php @@ -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
name . "\" action=\"" . $this->controller . "\" method=\"post\"" . ($this->upload ? ' enctype="mime/multi-part"' : '') . ">\n" . $this->_paintChildren() . "\n
"; + return "\n
name . "\" action=\"" . $this->action . "\" method=\"post\"" . ($this->upload ? ' enctype="mime/multi-part"' : '') . ">\n" . $this->_paintChildren() . "\n
"; } } diff --git a/PrinterRootPage.php b/PrinterRootPage.php index f236594..ed54f95 100644 --- a/PrinterRootPage.php +++ b/PrinterRootPage.php @@ -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 = '
' . $message . '
'; $showmessage .= "\n

" . $redir . "

"; - $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)); -- 2.43.5