From: Ben Klang Date: Fri, 26 Mar 2010 02:03:13 +0000 (-0400) Subject: Shout: Revamp menu selection and editing screens X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=dae5c269c9176e318512a1b25bca19d3511acc2c;p=horde.git Shout: Revamp menu selection and editing screens --- diff --git a/shout/dialplan.php b/shout/dialplan.php index f4b8c063e..eaeebade0 100644 --- a/shout/dialplan.php +++ b/shout/dialplan.php @@ -53,6 +53,7 @@ default: $action = 'edit'; try { $destinations = $shout->extensions->getExtensions($curaccount); + $soundfiles = $shout->getRecordings(); } catch (Exception $e) { $notification->push(_("Problem getting destination information.")); } diff --git a/shout/lib/Ajax/Application.php b/shout/lib/Ajax/Application.php index 34161634c..dda90d8da 100644 --- a/shout/lib/Ajax/Application.php +++ b/shout/lib/Ajax/Application.php @@ -126,24 +126,6 @@ class Shout_Ajax_Application extends Horde_Ajax_Application_Base return true; } - /** - * TODO - */ - public function getMenuActions() - { - try { - $vars = $this->_vars; - $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $account = $_SESSION['shout']['curaccount']; - $actions = Shout::getMenuActions(); - return $actions; - } catch (Exception $e) { - //FIXME: Create a way to notify the user of the failure. - Horde::logMessage($e, 'ERR'); - return false; - } - } - public function getActionForm() { try { @@ -213,17 +195,6 @@ class Shout_Ajax_Application extends Horde_Ajax_Application_Base } } - public function getRecordings() - { - try { - return Shout::getRecordings($_SESSION['shout']['curaccount']); - } catch (Exception $e) { - //FIXME: Create a way to notify the user of the failure. - Horde::logMessage($e->getMessage(), 'ERR'); - return false; - } - } - public function responseType() { return $this->_responseType; diff --git a/shout/lib/Application.php b/shout/lib/Application.php index dc7e5c1d2..c94fb70c6 100644 --- a/shout/lib/Application.php +++ b/shout/lib/Application.php @@ -157,4 +157,24 @@ class Shout_Application extends Horde_Registry_Application return self::$_perms; } + + public function getRecordings() + { + $account = $_SESSION['shout']['curaccount']; + $rlist = $this->vfs->listFolder($account); + + // In Asterisk, filenames the same basename and different extension are + // functionally equivalent. Asterisk chooses the file based on the least cost + // to transcode. For that reason, we will drop the filename extension when + // handling files. + $recordings = array(); + foreach ($rlist as $name => $info) { + $name = substr($name, 0, strrpos($name, '.')); + $info['name'] = $name; + $recordings[$name] = $info; + } + + return $recordings; + } + } diff --git a/shout/lib/Shout.php b/shout/lib/Shout.php index fef60c66c..30a40aa48 100644 --- a/shout/lib/Shout.php +++ b/shout/lib/Shout.php @@ -218,23 +218,4 @@ class Shout return $res; } - static public function getRecordings($account) - { - $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $rlist = $shout->vfs->listFolder($account); - - // In Asterisk, filenames the same basename and different extension are - // functionally equivalent. Asterisk chooses the file based on the least cost - // to transcode. For that reason, we will drop the filename extension when - // handling files. - $recordings = array(); - foreach ($rlist as $name => $info) { - $name = substr($name, 0, strrpos($name, '.')); - $info['name'] = $name; - $recordings[$name] = $info; - } - - return $recordings; - } - } diff --git a/shout/templates/dialplan/edit.inc b/shout/templates/dialplan/edit.inc index 1296c74ad..7b6a603f9 100644 --- a/shout/templates/dialplan/edit.inc +++ b/shout/templates/dialplan/edit.inc @@ -14,17 +14,39 @@ +
+ + + + + + + + + + + + + + + + + +
Menu Name
Description
Sound File
+

@@ -49,18 +71,18 @@
*
0
#
-
-
Default Action