Shout: Continue fixes from conversion to new H_R#appInit()
authorBen Klang <ben@alkaloid.net>
Tue, 26 Jan 2010 22:21:08 +0000 (17:21 -0500)
committerBen Klang <ben@alkaloid.net>
Tue, 26 Jan 2010 22:28:31 +0000 (17:28 -0500)
shout/lib/Ajax/Application.php
shout/templates/extensions/list.inc
shout/themes/screen.css

index 5c3e5e4..f8b93d5 100644 (file)
@@ -21,7 +21,9 @@ class Shout_Ajax_Application extends Horde_Ajax_Application_Base
      */
     public function notificationHandler()
     {
-        return $GLOBALS['kronolith_notify'];
+        // FIXME: Create Shout notification handler
+        //return $GLOBALS['kronolith_notify'];
+        return null;
     }
 
     /**
@@ -29,6 +31,7 @@ class Shout_Ajax_Application extends Horde_Ajax_Application_Base
      */
     public function addDestination($vars)
     {
+        $shout = Horde_Registry::appInit('shout');
         $context = $_SESSION['shout']['context'];
         try {
             // FIXME: Use Form?
@@ -48,6 +51,7 @@ class Shout_Ajax_Application extends Horde_Ajax_Application_Base
      */
     public function deleteDestination($vars)
     {
+        $shout = Horde_Registry::appInit('shout');
         $context = $_SESSION['shout']['context'];
         try {
             // FIXME: Use Form?
@@ -67,6 +71,8 @@ class Shout_Ajax_Application extends Horde_Ajax_Application_Base
      */
     public function getDestinations($vars)
     {
+        $shout = Horde_Registry::appInit('shout');
+        Horde::logMessage(print_r($vars, true), __FILE__, __LINE__, PEAR_LOG_ERR);
         $context = $_SESSION['shout']['context'];
         try {
             return $shout->extensions->getExtensions($context);
index b3488c6..cf35bd9 100644 (file)
@@ -84,6 +84,14 @@ function resetExtenDest(exten)
         dest.numbers = [];
     }
 
+    if (dest.devices.size() == 0 && dest.numbers.size() == 0) {
+        var span = document.createElement('span');
+        span.className = 'informational';
+        var text = document.createTextNode("No destinations configured");
+        span.appendChild(text);
+        $('destX' + exten + 'summary').appendChild(span);
+    }
+
     dest.devices.each(function (s) {
         // Fill in detail block
         var img = document.createElement('img');
index b967817..c936348 100644 (file)
@@ -64,4 +64,8 @@ ul {
     float: left;
 }
 
+.informational {
+    font-style: italic;
+}
+