]> git.mxchange.org Git - friendica.git/commitdiff
create URL for categories
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Sun, 3 Nov 2019 15:34:58 +0000 (16:34 +0100)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Sun, 3 Nov 2019 15:34:58 +0000 (16:34 +0100)
src/Content/Item.php

index ed6ec9c877bb729126bb1ed5a00d0805946d0b2b..f086fbe19cc1b6e50706d052c948af35faa5150d 100644 (file)
@@ -42,10 +42,16 @@ final class Item
                $folders = [];
                $first = true;
 
+               if (!empty($item['author-link'])) {
+                       $url = $item['author-link'] . "?category=" . rawurlencode($savedFolderName);
+               } else {
+                       $url = '#';
+               }
+
                foreach (FileTag::fileToArray($item['file'] ?? '', 'category') as $savedFolderName) {
                        $categories[] = [
                                'name' => $savedFolderName,
-                               'url' => "#",
+                               'url' => $url,
                                'removeurl' => ((local_user() == $item['uid']) ? 'filerm/' . $item['id'] . '?f=&cat=' . rawurlencode($savedFolderName) : ""),
                                'first' => $first,
                                'last' => false