Shout: Use injector to get app instance
authorBen Klang <ben@alkaloid.net>
Wed, 24 Mar 2010 20:45:43 +0000 (16:45 -0400)
committerBen Klang <ben@alkaloid.net>
Wed, 24 Mar 2010 21:11:01 +0000 (17:11 -0400)
shout/lib/Forms/DeviceForm.php
shout/lib/Forms/ExtensionForm.php
shout/lib/Forms/MenuForm.php

index 2099d42..df4317f 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Id: ExtensionForm.php 502 2009-12-21 04:01:12Z bklang $
- *
  * Copyright 2005-2010 Alkaloid Networks LLC (http://projects.alkaloid.net)
  *
  * See the enclosed file LICENSE for license information (BSD). If you
@@ -15,8 +13,6 @@ class DeviceDetailsForm extends Horde_Form {
 
     function __construct(&$vars)
     {
-        global $shout_extensions;
-
         if ($vars->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);
index 5fa6797..4c3acba 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Id$
- *
  * Copyright 2005-2009 Alkaloid Networks LLC (http://projects.alkaloid.net)
  *
  * See the enclosed file LICENSE for license information (BSD). If you
@@ -23,7 +21,8 @@ class ExtensionDetailsForm extends Horde_Form {
      */
     function __construct(&$vars)
     {
-        global $shout;
+        $shout = $GLOBALS['injector']->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);
index cf61346..f23e6e2 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Id: ExtensionForm.php 502 2009-12-21 04:01:12Z bklang $
- *
  * Copyright 2005-2010 Alkaloid Networks LLC (http://projects.alkaloid.net)
  *
  * See the enclosed file LICENSE for license information (BSD). If you
@@ -15,8 +13,6 @@ class MenuForm extends Horde_Form {
 
     function __construct(&$vars)
     {
-        global $shout_extensions;
-
         if ($vars->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);