Merge pull request #7813 from tobiasd/20191103-cats
move link generation into the loop
This commit is contained in:
commit
4e6dcf537d
1 changed files with 5 additions and 6 deletions
|
@ -42,13 +42,12 @@ final class Item
|
||||||
$folders = [];
|
$folders = [];
|
||||||
$first = true;
|
$first = true;
|
||||||
|
|
||||||
|
foreach (FileTag::fileToArray($item['file'] ?? '', 'category') as $savedFolderName) {
|
||||||
if (!empty($item['author-link'])) {
|
if (!empty($item['author-link'])) {
|
||||||
$url = $item['author-link'] . "?category=" . rawurlencode($savedFolderName);
|
$url = $item['author-link'] . "?category=" . rawurlencode($savedFolderName);
|
||||||
} else {
|
} else {
|
||||||
$url = '#';
|
$url = '#';
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (FileTag::fileToArray($item['file'] ?? '', 'category') as $savedFolderName) {
|
|
||||||
$categories[] = [
|
$categories[] = [
|
||||||
'name' => $savedFolderName,
|
'name' => $savedFolderName,
|
||||||
'url' => $url,
|
'url' => $url,
|
||||||
|
|
Loading…
Reference in a new issue