$zones[$zonename] = array(); $zones[$zonename]["description"] = ""; if (isset($entry[1]["tXTRecord"])) { foreach ($entry[1]["tXTRecord"] as $value) { $zones[$zonename]["description"] .= $value . " "; } } } ksort($zones); $descriptions = array(); $reverses = array(); $count = array(); foreach ($zones as $zone => $infos) { $count[] = '<span style="font-weight: normal;">(' . getZoneObjectsCount($zone) . ')</span>'; $descriptions[] = $infos["description"]; $reverse = getZoneNetworkAddress($zone); if (!$reverse) { $reverses[] = "None"; } else { $reverses[] = $reverse[0] . "."; } } $n = new ListInfos(array_keys($zones), _T("DNS zones", "network")); $n->setNavBar(new AjaxNavBar(count($zones), $filter)); $n->setAdditionalInfo($count); $n->first_elt_padding = 1; $n->addExtraInfo($reverses, _T("Network prefix", "network")); $n->addExtraInfo($descriptions, _T("Description", "network")); $n->setName(_T("DNS zones", "network")); $n->addActionItem(new ActionItem(_T("View zone members", "network"), "zonemembers", "zonemembers", "zone", "network", "network")); $n->addActionItem(new ActionItem(_T("View zone records", "network"), "zonerecords", "display", "zone", "network", "network"));
$cnames[] = str_replace('.' . $zone, '', $cname[1]["associatedDomain"][0]); } else { $cnames[] = $cname[1]["relativeDomainName"][0]; } } } else { die("Only A record edition is supported."); } } } $f = new ValidatingForm(); $f->push(new Table()); /* Prepare hostname input field content */ if ($_GET["action"] == "addhost") { $hostname = ""; $zoneaddress = getZoneNetworkAddress($zone); if (count($zoneaddress)) { $f->add(new TrFormElement(_T("A reverse DNS record will be automatically created for this host."), new HiddenTpl(""))); } } $a = array("value" => $hostname, "extra" => "." . $zone); if ($_GET["action"] == "addhost") { $formElt = new HostnameInputTpl("hostname"); $a["required"] = True; if (isset($_GET["host"])) { $a["value"] = $_GET["host"]; } /* pre-fill hostname field when adding a host */ } else { $formElt = new HiddenTpl("hostname"); }