1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-14 20:50:30 +01:00

Merge pull request #6163 from marc1706/ticket/16730

[ticket/16730] Don't do additional sorting or output without any tickets
This commit is contained in:
Marc Alexander 2021-03-24 21:31:22 +01:00
commit 7d48254cc9
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -38,6 +38,7 @@ else
$xml = simplexml_load_string(file_get_contents($url)); $xml = simplexml_load_string(file_get_contents($url));
} }
$types = [];
foreach ($xml->xpath('//item') as $item) foreach ($xml->xpath('//item') as $item)
{ {
$key = (string) $item->key; $key = (string) $item->key;
@ -51,9 +52,11 @@ foreach ($xml->xpath('//item') as $item)
$types[(string) $item->type][$key] = $value; $types[(string) $item->type][$key] = $value;
} }
ksort($types); if (count($types))
foreach ($types as $type => $tickets)
{ {
ksort($types);
foreach ($types as $type => $tickets)
{
echo "<h4>$type</h4>\n"; echo "<h4>$type</h4>\n";
echo "<ul>\n"; echo "<ul>\n";
@ -64,4 +67,5 @@ foreach ($types as $type => $tickets)
echo "<li>$ticket</li>\n"; echo "<li>$ticket</li>\n";
} }
echo "</ul>\n"; echo "</ul>\n";
}
} }