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:
Michael Kaufmann
2022-05-15 11:45:50 +02:00
parent ed7faae947
commit dd896659ae
6 changed files with 55 additions and 4 deletions

View File

@@ -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);
}
}