From c9613f130106f74853fbe9a50f06c00208106b8c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 4 Jan 2019 12:43:07 +0100 Subject: [PATCH] Search for content by tags See #2689 --- com.woltlab.wcf/page.xml | 13 +++ com.woltlab.wcf/templates/combinedTagged.tpl | 80 +++++++++++++++++++ com.woltlab.wcf/templates/search.tpl | 2 +- .../data/article/TaggedArticleList.class.php | 21 ++++- .../files/lib/form/TagSearchForm.class.php | 15 +++- .../lib/page/CombinedTaggedPage.class.php | 66 ++++++++++++--- .../AbstractCombinedTaggable.class.php | 2 +- .../lib/system/tagging/TagEngine.class.php | 28 ++++++- wcfsetup/install/lang/de.xml | 5 ++ wcfsetup/install/lang/en.xml | 7 +- 10 files changed, 217 insertions(+), 22 deletions(-) create mode 100644 com.woltlab.wcf/templates/combinedTagged.tpl diff --git a/com.woltlab.wcf/page.xml b/com.woltlab.wcf/page.xml index 3e76e8a798..9107dc0e88 100644 --- a/com.woltlab.wcf/page.xml +++ b/com.woltlab.wcf/page.xml @@ -270,6 +270,19 @@ Suche + + system + wcf\form\TagSearchForm + Suche nach Tags + Search by Tags + user.tag.canViewTag + + Search by Tags + + + Suche nach Tags + + system wcf\form\SettingsForm diff --git a/com.woltlab.wcf/templates/combinedTagged.tpl b/com.woltlab.wcf/templates/combinedTagged.tpl new file mode 100644 index 0000000000..3e890a5084 --- /dev/null +++ b/com.woltlab.wcf/templates/combinedTagged.tpl @@ -0,0 +1,80 @@ +{capture assign='pageTitle'}{lang}wcf.tagging.combinedTaggedObjects.{@$objectType}{/lang}{if $pageNo > 1} - {lang}wcf.page.pageNo{/lang}{/if}{/capture} + +{capture assign='contentHeader'} +
+
+

{lang}wcf.tagging.combinedTaggedObjects.{@$objectType}{/lang}

+
    + {foreach from=$combinedTags item=tag} +
  • {$tag->name}
  • + {/foreach} +
+
+
+{/capture} + +{capture assign='linkParameters'}{implode from=$combinedTags item=tag glue='&'}tagIDs[]={@$tag->tagID}{/implode}{/capture} + +{capture assign='headContent'} + {if $pageNo < $pages} + + {/if} + {if $pageNo > 1} + + {/if} + +{/capture} + +{capture assign='sidebarLeft'} +
+

{lang}wcf.tagging.objectTypes{/lang}

+ + +
+ +
+

{lang}wcf.tagging.tags{/lang}

+ +
+ {include file='tagCloudBox' taggableObjectType=$objectType} +
+
+{/capture} + +{include file='header'} + +{hascontent} +
+ {content}{pages print=true assign=pagesLinks controller='CombinedTagged' link="$linkParameters&objectType=$objectType&pageNo=%d"}{/content} +
+{/hascontent} + +{if $items} + {include file=$resultListTemplateName application=$resultListApplication} +{else} +

{lang}wcf.tagging.taggedObjects.noResults{/lang}

+{/if} + +
+ {hascontent} +
+ {content}{@$pagesLinks}{/content} +
+ {/hascontent} + + {hascontent} + + {/hascontent} +
+ +{include file='footer'} diff --git a/com.woltlab.wcf/templates/search.tpl b/com.woltlab.wcf/templates/search.tpl index 20472ee81c..307600bd03 100644 --- a/com.woltlab.wcf/templates/search.tpl +++ b/com.woltlab.wcf/templates/search.tpl @@ -11,7 +11,7 @@