function _mail_baseGroupEdit($ldapArr, $postArr) { if (!isset($ldapArr["cn"][0])) { return; } print "<div class=\"formblock\" style=\"background-color: #FFD;\">"; print "<h3>" . _T("Mail plugin", "mail") . "</h3>\n"; $mail = ""; $maildomain = ""; if (hasGroupMailObjectClass($ldapArr['cn'][0])) { $hasMail = "checked"; if (isset($ldapArr["mail"])) { $mail = $ldapArr["mail"][0]; } if (hasVDomainSupport()) { $tmparr = explode("@", $mail); $mail = $tmparr[0]; $maildomain = $tmparr[1]; } } else { $mail = computeMailGroupAlias($ldapArr['cn'][0]); $hasMail = ""; if (hasVDomainSupport()) { $vdomains = getVDomains(""); if (count($vdomains) == 1) { $maildomain = $vdomains[0][1]["virtualdomain"][0]; } } } if ($hasMail == "" && $mail == "") { print _T("No mail alias can be set for this group", "mail"); } else { print '<table cellspacing="0">'; if (hasZarafaSupport()) { $trz = new TrFormElement(_T("Zarafa group", "mail"), new CheckboxTpl("zarafaGroup")); $trz->display(array("value" => isZarafaGroup($ldapArr['cn'][0]) ? "checked" : "")); } $test = new TrFormElement(_T("Enable mail alias for users of this group ", "mail"), new CheckboxTpl("mailgroupaccess")); $param = array("value" => $hasMail, "extraArg" => 'onclick="toggleVisibility(\'maildiv\');"'); $test->display($param); print "</table>"; if (!$hasMail) { $style = 'style =" display: none;"'; } print '<div id="maildiv" ' . $style . '>'; print '<table cellspacing="0">'; if (!hasVDomainSupport()) { $m = new TrFormElement(_T("Mail alias", "mail"), new InputTpl("mailgroupalias")); $m->displayRo(array("value" => $mail)); } else { print '<tr><td width="40%" style="text-align: right;">' . _T("Mail alias", "mail") . '</td><td>' . $mail . '<input type="hidden" value="' . $mail . '" name="mailgroupalias"> @ '; print '<input type="text" id="autocomplete" name="maildomain" value="' . $maildomain . '" /><div id="autocomplete_choices" class="autocomplete"></div>'; print '<script type="text/javascript">new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "' . urlStrRedirect('mail/domains/ajaxMailDomainFilter') . '", {paramName: "value"});</script>'; print '</td></tr>'; } print "</table>"; print "</div>"; } print "</div>"; }
<?php $domains = array(); foreach (getVDomains($filter) as $dn => $entry) { $domains[$entry[1]["virtualdomain"][0]] = $entry[1]["virtualdomaindescription"][0]; } ksort($domains); print "<ul>"; foreach ($domains as $domain => $desc) { print "<li>{$domain}<br/><span class=\"informal\">{$desc}</span></li>"; } print "</ul>";