refactor: introduce http Request object (#3926)

This commit is contained in:
Dag 2024-01-25 16:06:24 +01:00 committed by GitHub
parent 9574c17ddc
commit d08d13f2c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 125 additions and 94 deletions

View file

@ -12,20 +12,21 @@ class HtmlFormat extends FormatAbstract
$formatFactory = new FormatFactory();
$buttons = [];
$linkTags = [];
foreach ($formatFactory->getFormatNames() as $format) {
foreach ($formatFactory->getFormatNames() as $formatName) {
// Dynamically build buttons for all formats (except HTML)
if ($format === 'Html') {
if ($formatName === 'Html') {
continue;
}
$formatUrl = '?' . str_ireplace('format=Html', 'format=' . $format, htmlentities($queryString));
$formatUrl = '?' . str_ireplace('format=Html', 'format=' . $formatName, htmlentities($queryString));
$buttons[] = [
'href' => $formatUrl,
'value' => $format,
'value' => $formatName,
];
$format = $formatFactory->create($formatName);
$linkTags[] = [
'href' => $formatUrl,
'title' => $format,
'type' => $formatFactory->create($format)->getMimeType(),
'title' => $formatName,
'type' => $format->getMimeType(),
];
}