Fix typo and move function to correct class

This commit is contained in:
Mark Schouten 2016-08-03 14:19:31 +02:00
parent 6fd7087dc9
commit a7d3e6e6eb
2 changed files with 16 additions and 16 deletions

View file

@ -144,6 +144,21 @@ class Zone {
}
}
public function rrsets2records() {
$ret = Array();
foreach ($this->rrsets as $rrset) {
foreach ($rrset->export_records() as $record) {
$record['name'] = $rrset['name'];
$record['ttl'] = $rrset['ttl'];
$record['type'] = $rrset['type'];
}
array_push($ret, $record);
}
return $ret;
}
public function export() {
$ret = Array();
$ret['account'] = $this->account;
@ -215,21 +230,6 @@ class RRSet {
array_push($this->comments, $comment);
}
public function rrsets2records() {
$ret = Array();
foreach ($this->rrsets as $rrset) {
foreach ($rrset->export_records() as $record) {
$record['name'] = $rrset['name'];
$record['ttl'] = $rrset['ttl'];
$record['type'] = $rrset['type'];
}
array_push($ret, $record);
}
return $ret;
}
public function export() {
$ret = Array();
$ret['comments'] = $this->export_comments();

View file

@ -307,7 +307,7 @@ case "listslaves":
case "listrecords":
$zonedata = $api->loadzone($_GET['zoneid']);
$zone = new Zone()
$zone = new Zone();
$zone->parse($zonedata);
$records = $zone->rrsets2records();
foreach ($records as &$record) {