From bb41defae4016d4298b6193831c2e12f0037b22c Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Wed, 24 Mar 2010 16:45:43 -0400 Subject: [PATCH] Shout: Use injector to get app instance --- shout/lib/Forms/DeviceForm.php | 8 ++------ shout/lib/Forms/ExtensionForm.php | 9 ++++----- shout/lib/Forms/MenuForm.php | 9 +++------ 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/shout/lib/Forms/DeviceForm.php b/shout/lib/Forms/DeviceForm.php index 2099d42cc..df4317f97 100644 --- a/shout/lib/Forms/DeviceForm.php +++ b/shout/lib/Forms/DeviceForm.php @@ -1,7 +1,5 @@ exists('devid')) { $formtitle = "Edit Device"; $devid = $vars->get('devid'); @@ -48,7 +44,7 @@ class DeviceDetailsForm extends Horde_Form { public function execute() { - global $shout; + $shout = $GLOBALS['injector']->getInstance('shout', 'application'); $action = $this->_vars->get('action'); $account = $this->_vars->get('account'); @@ -114,7 +110,7 @@ class DeviceDeleteForm extends Horde_Form function execute() { - global $shout; + $shout = $GLOBALS['injector']->getInstance('shout', 'application'); $account = $this->_vars->get('account'); $devid = $this->_vars->get('devid'); $shout->devices->deleteDevice($account, $devid); diff --git a/shout/lib/Forms/ExtensionForm.php b/shout/lib/Forms/ExtensionForm.php index 5fa67978c..4c3acbaec 100644 --- a/shout/lib/Forms/ExtensionForm.php +++ b/shout/lib/Forms/ExtensionForm.php @@ -1,7 +1,5 @@ getInstance('shout', 'application'); + $account = $_SESSION['shout']['curaccount']; $action = $vars->get('action'); @@ -59,7 +58,7 @@ class ExtensionDetailsForm extends Horde_Form { */ function execute() { - global $shout; + $shout = $GLOBALS['injector']->getInstance('shout', 'application'); $extension = $this->_vars->get('extension'); $account = $this->_vars->get('account'); @@ -97,7 +96,7 @@ class ExtensionDeleteForm extends Horde_Form function execute() { - global $shout; + $shout = $GLOBALS['injector']->getInstance('shout', 'application'); $account = $this->_vars->get('account'); $extension = $this->_vars->get('extension'); $shout->extensions->deleteExtension($account, $extension); diff --git a/shout/lib/Forms/MenuForm.php b/shout/lib/Forms/MenuForm.php index cf61346b3..f23e6e205 100644 --- a/shout/lib/Forms/MenuForm.php +++ b/shout/lib/Forms/MenuForm.php @@ -1,7 +1,5 @@ exists('menu')) { $formtitle = _("Edit Menu"); $menu = $vars->get('menu'); @@ -46,7 +42,8 @@ class MenuForm extends Horde_Form { public function execute() { - global $shout; + $shout = $GLOBALS['injector']->getInstance('shout', 'application'); + $account = $_SESSION['shout']['curaccount']; $details = array( @@ -82,7 +79,7 @@ class DeviceMenuForm extends Horde_Form function execute() { - global $shout; + $shout = $GLOBALS['injector']->getInstance('shout', 'application'); $account = $this->_vars->get('account'); $menu = $this->_vars->get('menu'); $shout->devices->deleteMenu($account, $menu); -- 2.11.0