From ebfedbc449f9d33cb4bdd60da6d70ec96517d324 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 3 Nov 2019 15:55:58 +0100 Subject: [PATCH 1/2] add links to cat.url --- view/templates/wall_thread.tpl | 2 +- view/theme/frio/templates/wall_thread.tpl | 2 +- view/theme/quattro/templates/wall_thread.tpl | 2 +- view/theme/smoothly/templates/wall_thread.tpl | 2 +- view/theme/vier/templates/wall_thread.tpl | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/view/templates/wall_thread.tpl b/view/templates/wall_thread.tpl index 01cd7559f1..a4834062c0 100644 --- a/view/templates/wall_thread.tpl +++ b/view/templates/wall_thread.tpl @@ -64,7 +64,7 @@ {{/if}} {{if $item.has_cats}} -
{{$item.txt_cats}} {{foreach $item.categories as $cat}}{{$cat.name}}{{if $cat.removeurl}} [{{$remove}}]{{/if}} {{if $cat.last}}{{else}}, {{/if}}{{/foreach}} +
{{$item.txt_cats}} {{foreach $item.categories as $cat}}{{$cat.name}}{{if $cat.removeurl}} [{{$remove}}]{{/if}} {{if $cat.last}}{{else}}, {{/if}}{{/foreach}}
{{/if}} diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl index 631aad3be2..9d8d47355c 100644 --- a/view/theme/frio/templates/wall_thread.tpl +++ b/view/theme/frio/templates/wall_thread.tpl @@ -313,7 +313,7 @@ as the value of $top_child_total (this is done at the end of this file) {{/foreach}} {{foreach $item.categories as $cat}} - {{$cat.name}}{{if $cat.removeurl}} (x) {{/if}} + {{$cat.name}}{{if $cat.removeurl}} (x) {{/if}} {{/foreach}}
{{if $item.edited}}
{{$item.edited['label']}} ({{$item.edited['relative']}})
{{/if}} diff --git a/view/theme/quattro/templates/wall_thread.tpl b/view/theme/quattro/templates/wall_thread.tpl index a80aabf4b4..bfb903c7b8 100644 --- a/view/theme/quattro/templates/wall_thread.tpl +++ b/view/theme/quattro/templates/wall_thread.tpl @@ -72,7 +72,7 @@ {{$cat.name}}{{if $cat.removeurl}} (x) {{/if}} {{/foreach}} {{foreach $item.categories as $cat}} - {{$cat.name}}{{if $cat.removeurl}} (x) {{/if}} + {{$cat.name}}{{if $cat.removeurl}} (x) {{/if}} {{/foreach}} {{/if}} diff --git a/view/theme/smoothly/templates/wall_thread.tpl b/view/theme/smoothly/templates/wall_thread.tpl index 08ff557670..a4616d9c4c 100644 --- a/view/theme/smoothly/templates/wall_thread.tpl +++ b/view/theme/smoothly/templates/wall_thread.tpl @@ -72,7 +72,7 @@ {{if $item.has_cats}} -
{{$item.txt_cats}} {{foreach $item.categories as $cat}}{{$cat.name}} +
{{$item.txt_cats}} {{foreach $item.categories as $cat}}{{$cat.name}} [{{$remove}}] {{if $cat.last}}{{else}}, {{/if}}{{/foreach}}
diff --git a/view/theme/vier/templates/wall_thread.tpl b/view/theme/vier/templates/wall_thread.tpl index 37e01f75a4..eb9c2fe575 100644 --- a/view/theme/vier/templates/wall_thread.tpl +++ b/view/theme/vier/templates/wall_thread.tpl @@ -89,7 +89,7 @@ {{$cat.name}}{{if $cat.removeurl}} (x) {{/if}} {{/foreach}} {{foreach $item.categories as $cat}} - {{$cat.name}}{{if $cat.removeurl}} (x) {{/if}} + {{$cat.name}}{{if $cat.removeurl}} (x) {{/if}} {{/foreach}}
From f45d39c05ba54b1414bd6387eca046a004764133 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 3 Nov 2019 16:34:58 +0100 Subject: [PATCH 2/2] create URL for categories --- src/Content/Item.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index ed6ec9c877..f086fbe19c 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -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