dynamically load dns-record help-text for selected dns-type; fixes #719
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -83,6 +83,8 @@ class Ajax
|
||||
return $this->getConfigDetails();
|
||||
case 'getConfigJsonExport':
|
||||
return $this->getConfigJsonExport();
|
||||
case 'loadLanguageString':
|
||||
return $this->loadLanguageString();
|
||||
default:
|
||||
return $this->errorResponse('Action not found!');
|
||||
}
|
||||
@@ -344,4 +346,16 @@ class Ajax
|
||||
}
|
||||
return $this->errorResponse('Not allowed', 403);
|
||||
}
|
||||
|
||||
/**
|
||||
* loads a given language string by its identifier
|
||||
*/
|
||||
private function loadLanguageString()
|
||||
{
|
||||
$langid = isset($_POST['langid']) ? $_POST['langid'] : "";
|
||||
if (preg_match('/^([a-zA-Z\.]+)$/', $langid)) {
|
||||
return $this->jsonResponse(lng($langid));
|
||||
}
|
||||
return $this->errorResponse('Invalid identifier: ' . $langid, 406);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,8 @@ return [
|
||||
'dns_content' => [
|
||||
'label' => 'Content',
|
||||
'type' => 'text',
|
||||
'value' => $content
|
||||
'value' => $content,
|
||||
'note' => lng('dnseditor.notes.A')
|
||||
],
|
||||
'dns_ttl' => [
|
||||
'label' => 'TTL',
|
||||
|
||||
Reference in New Issue
Block a user