Shout: Begin to rough in the destinations
authorBen Klang <ben@alkaloid.net>
Sat, 2 Jan 2010 19:08:23 +0000 (14:08 -0500)
committerBen Klang <ben@alkaloid.net>
Sat, 2 Jan 2010 19:08:23 +0000 (14:08 -0500)
shout/lib/Forms/ExtensionForm.php
shout/templates/extensions/list.inc

index 05aacb4..83efbe2 100644 (file)
@@ -14,14 +14,15 @@ class ExtensionDetailsForm extends Horde_Form {
 
     /**
      * ExtensionDetailsForm constructor.
-     * 
+     *
      * @global <type> $shout_extensions
      * @param <type> $vars
-     * @return <type> 
+     * @return <type>
      */
     function __construct(&$vars)
     {
         global $shout_extensions;
+
         $context = $_SESSION['shout']['context'];
         $action = $vars->get('action');
         if ($action == 'edit') {
@@ -30,10 +31,10 @@ class ExtensionDetailsForm extends Horde_Form {
             $formtitle = "Add User";
         }
 
+        parent::__construct($vars, _("$formtitle - Context: $context"));
+
         $extension = $vars->get('extension');
 
-        parent::__construct($vars, _("$formtitle - Context: $context"));
-        
         $this->addHidden('', 'action', 'text', true);
         $this->addHidden('', 'oldextension', 'text', false);
         $this->addVariable(_("Full Name"), 'name', 'text', true);
@@ -96,4 +97,4 @@ class ExtensionDeleteForm extends Horde_Form
         $extension = $this->_vars->get('extension');
         $shout_extensions->deleteExtension($context, $extension);
     }
-}
\ No newline at end of file
+}
index 61cfa96..aa403a2 100644 (file)
             <td class="uheader">E-Mail Address</td>
         </tr>
         <?php
+            $expandAttrs = array('onclick' => 'javascript:alert(this.getNode().parent);',
+                'id' => 'myid');
+            $expandButton = Horde::img('tree/plusonly.png', _("Expand"), $expandAttrs,
+                                       $registry->getImageDir('horde'));
             foreach ($extensions as $extension => $info) {
 
                 $url = Horde::applicationUrl("extensions.php");
             <td style="width: 20%">
                 <?php echo Horde::link($editurl); echo $extension; ?></a>
             </td>
-            <td style="width: 35%;" id="myid">
+            <td style="width: 35%;">
+                <?php echo $expandButton; ?>
                 <?php echo Horde::link($editurl); echo $info['name']; ?></a>
+                <span id="destX<?php echo $extension; ?>summary">
                 <?php
                 foreach ($info['devices'] as $device) {
                     echo Horde::img('shout.png');
                     echo Horde::img('telephone-pole.png');
                 }
                 ?>
+                </span>
+
+                <form>
+                <div class="extensionDestinations" id="destX<?php echo $extension; ?>">
+                    <input type="hidden" name="extension" value="<?php echo $extension; ?>">
+                    <?php
+                    foreach ($info['devices'] as $device) {
+                        echo Horde::img('shout.png') . "&nbsp;" . $device . "<br>\n";
+                    }
+                    foreach ($info['numbers'] as $number) {
+                        echo Horde::img('telephone-pole.png') . "&nbsp;" . $number . "<br>\n";
+                    }
+                    ?>
+                </div>
+                </form>
             </td>
             <td style="width: 45%">
                 <?php echo $info['email']; ?>