<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");
$editurl = Horde_Util::addParameter($url, 'action', 'edit');
$deleteurl = Horde_Util::addParameter($url, 'action', 'delete');
?>
- <tr class="item">
+ <tr class="item" style="vertical-align: top">
<td style="width: 20%">
<?php echo Horde::link($editurl); echo $extension; ?></a>
</td>
<td style="width: 35%;">
- <?php echo $expandButton; ?>
- <?php echo Horde::link($editurl); echo $info['name']; ?></a>
+ <?php
+ $attrs = array('onclick' => 'javascript:destinations("' . $extension . '");',
+ 'id' => 'destX' . $extension . 'toggle');
+ echo Horde::img('tree/plusonly.png', _("Destinations"), $attrs,
+ $registry->getImageDir('horde'));
+ echo Horde::link($editurl);
+ echo $info['name']; ?>
+ </a>
<span id="destX<?php echo $extension; ?>summary">
<?php
foreach ($info['devices'] as $device) {
?>
</span>
- <form>
+ <form method="post"
+ action="<?php echo Horde::applicationUrl('extensions.php'); ?>">
<div class="extensionDestinations" id="destX<?php echo $extension; ?>">
<input type="hidden" name="extension" value="<?php echo $extension; ?>">
<?php
?>
</table>
</div>
+
+<script type="text/javascript">
+<!--
+
+<?php
+foreach ($extensions as $extension => $info)
+{
+ echo "contract('${extension}');\n";
+}
+?>
+
+function destinations(exten)
+{
+ // Use the summary icons span as our state key
+ if ($("destX" + exten + "summary").style.display == 'none') {
+ // Icons hidden, we are expanded
+ contract(exten);
+ } else {
+ expand(exten);
+ }
+}
+
+function expand(exten)
+{
+ $('destX'+exten+'summary').hide();
+ $('destX'+exten).show();
+ $("destX" + exten + "toggle").src = '<?php echo $registry->getImageDir('horde') . '/tree/minusonly.png'; ?>';
+}
+
+function contract(exten)
+{
+ $('destX'+exten+'summary').show();
+ $('destX'+exten).hide();
+ $("destX" + exten + "toggle").src = '<?php echo $registry->getImageDir('horde') . '/tree/plusonly.png'; ?>';
+}
+// -->
+</script>