From bbd31ef092a5be7cfa6c6626f209e71d9d59a0a0 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Mon, 8 Mar 2010 18:21:52 -0500 Subject: [PATCH] Shout: I think this is the last of the context -> account break-fix work --- shout/lib/Forms/DeviceForm.php | 8 +++++--- shout/lib/Forms/ExtensionForm.php | 9 ++++++--- shout/lib/Shout.php | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/shout/lib/Forms/DeviceForm.php b/shout/lib/Forms/DeviceForm.php index c24d93a98..97d32e4e2 100644 --- a/shout/lib/Forms/DeviceForm.php +++ b/shout/lib/Forms/DeviceForm.php @@ -26,8 +26,10 @@ class DeviceDetailsForm extends Horde_Form { $edit = false; } - $account = $vars->get('account'); - parent::__construct($vars, _("$formtitle - Account: $account")); + $accountname = $_SESSION['shout']['accounts'][$curaccount]; + $title = sprintf(_("$formtitle - Account: %s"), $accountname); + parent::__construct($vars, $title); + $this->addHidden('', 'action', 'text', true); if ($edit) { $this->addHidden('', 'devid', 'text', true); @@ -100,7 +102,7 @@ class DeviceDeleteForm extends Horde_Form $account = $vars->get('account'); $title = _("Delete Device %s - Account: %s"); - $title = sprintf($title, $devid, $account); + $title = sprintf($title, $devid, $_SESSION['shout']['accounts'][$account]); parent::__construct($vars, $title); $this->addHidden('', 'account', 'text', true); diff --git a/shout/lib/Forms/ExtensionForm.php b/shout/lib/Forms/ExtensionForm.php index eb97dbdd0..5fa67978c 100644 --- a/shout/lib/Forms/ExtensionForm.php +++ b/shout/lib/Forms/ExtensionForm.php @@ -25,7 +25,7 @@ class ExtensionDetailsForm extends Horde_Form { { global $shout; - $account = $_SESSION['shout']['account']; + $account = $_SESSION['shout']['curaccount']; $action = $vars->get('action'); if ($action == 'edit') { $formtitle = "Edit User"; @@ -33,7 +33,10 @@ class ExtensionDetailsForm extends Horde_Form { $formtitle = "Add User"; } - parent::__construct($vars, _("$formtitle - Account: $account")); + $accountname = $_SESSION['shout']['accounts'][$curaccount]; + $title = sprintf(_("$formtitle - Account: %s"), $accountname); + parent::__construct($vars, $title); + $extension = $vars->get('extension'); @@ -83,7 +86,7 @@ class ExtensionDeleteForm extends Horde_Form $account = $vars->get('account'); $title = _("Delete Extension %s - Account: %s"); - $title = sprintf($title, $extension, $account); + $title = sprintf($title, $extension, $_SESSION['shout']['accounts'][$account]); parent::__construct($vars, $title); $this->addHidden('', 'account', 'text', true); diff --git a/shout/lib/Shout.php b/shout/lib/Shout.php index aa78d6cda..626dc3a88 100644 --- a/shout/lib/Shout.php +++ b/shout/lib/Shout.php @@ -140,7 +140,7 @@ class Shout static public function getMenuActions() { global $shout; - $account = $_SESSION['shout']['account']; + $account = $_SESSION['shout']['curaccount']; return array( 'jump' => array( -- 2.11.0