From 117db2d8e82a716a08b4b8ebdc7cdd55c3bdea23 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Tue, 23 Mar 2010 22:51:35 -0400 Subject: [PATCH] Shout: Allow selecting devices by name --- shout/lib/Ajax/Application.php | 22 ++++- shout/templates/extensions/list.inc | 166 +++++++++++++++++++++++------------- shout/themes/screen.css | 7 +- 3 files changed, 133 insertions(+), 62 deletions(-) diff --git a/shout/lib/Ajax/Application.php b/shout/lib/Ajax/Application.php index 092106131..df8eba9c3 100644 --- a/shout/lib/Ajax/Application.php +++ b/shout/lib/Ajax/Application.php @@ -60,7 +60,7 @@ class Shout_Ajax_Application extends Horde_Ajax_Application_Base $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); $shout->extensions->deleteDestination($account, $vars->extension, $vars->type, $vars->destination); - return $shout->extensions->getExtensions($account); + return $this->getDestinations(); } catch (Exception $e) { //FIXME: Create a way to notify the user of the failure. Horde::logMessage($e, 'ERR'); @@ -73,10 +73,10 @@ class Shout_Ajax_Application extends Horde_Ajax_Application_Base */ public function getDestinations() { - $vars = $this->_vars; - $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $account = $_SESSION['shout']['curaccount']; try { + $vars = $this->_vars; + $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); + $account = $_SESSION['shout']['curaccount']; return $shout->extensions->getExtensions($account); } catch (Exception $e) { //FIXME: Create a way to notify the user of the failure. @@ -85,6 +85,20 @@ class Shout_Ajax_Application extends Horde_Ajax_Application_Base } } + public function getDevices() + { + try { + $vars = $this->_vars; + $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); + $account = $_SESSION['shout']['curaccount']; + return $shout->devices->getDevices($account); + } catch (Exception $e) { + //FIXME: Create a way to notify the user of the failure. + Horde::logMessage($e, 'ERR'); + return false; + } + } + /** * TODO */ diff --git a/shout/templates/extensions/list.inc b/shout/templates/extensions/list.inc index 9cd09632b..f6630d931 100644 --- a/shout/templates/extensions/list.inc +++ b/shout/templates/extensions/list.inc @@ -16,7 +16,7 @@ - + $info) { @@ -52,7 +52,8 @@
ExtensionDestinationsDestinations