From: Marcel Werk Date: Mon, 20 May 2013 23:00:09 +0000 (+0200) Subject: Merged com.woltlab.wcf.search into WCF X-Git-Tag: 2.0.0_Beta_1~119 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=749cca086ee11d039d96f9d96edf5be9ca6e5c39;p=GitHub%2FWoltLab%2FWCF.git Merged com.woltlab.wcf.search into WCF --- diff --git a/com.woltlab.wcf/objectTypeDefinition.xml b/com.woltlab.wcf/objectTypeDefinition.xml index 2596592e8c..2a5d72bfb4 100644 --- a/com.woltlab.wcf/objectTypeDefinition.xml +++ b/com.woltlab.wcf/objectTypeDefinition.xml @@ -114,5 +114,10 @@ com.woltlab.wcf.tagging.taggableObject wcf\system\tagging\ITaggable + + + com.woltlab.wcf.searchableObjectType + wcf\system\search\ISearchableObjectType + diff --git a/com.woltlab.wcf/option.xml b/com.woltlab.wcf/option.xml index e9a602c187..fe2fd27934 100644 --- a/com.woltlab.wcf/option.xml +++ b/com.woltlab.wcf/option.xml @@ -177,6 +177,10 @@ message + + + message + @@ -1023,6 +1027,35 @@ DESC:wcf.global.sortOrder.descending]]> 255 + + + + + + diff --git a/com.woltlab.wcf/template/header.tpl b/com.woltlab.wcf/template/header.tpl index 63cdb2585a..322f5df1b2 100644 --- a/com.woltlab.wcf/template/header.tpl +++ b/com.woltlab.wcf/template/header.tpl @@ -13,7 +13,7 @@ {/hascontent} - {event name='searchArea'} + {include file='searchArea'} diff --git a/com.woltlab.wcf/template/search.tpl b/com.woltlab.wcf/template/search.tpl new file mode 100644 index 0000000000..86e58b73fb --- /dev/null +++ b/com.woltlab.wcf/template/search.tpl @@ -0,0 +1,147 @@ +{include file='documentHeader'} + + + {lang}wcf.search.title{/lang} - {PAGE_TITLE|language} + + {include file='headInclude'} + + + + +{include file='header'} + +
+

{lang}wcf.search.title{/lang}

+
+ +{include file='userNotice'} + +{if $errorField} +

{lang}wcf.global.form.error{/lang}

+{/if} + +{if $errorMessage|isset} +

{@$errorMessage}

+{/if} + +
+
+
+ {lang}wcf.search.general{/lang} + + +
+
+ + {if $errorField == 'q'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.search.query.error.{@$errorType}{/lang} + {/if} + + {/if} + + {event name='queryOptions'} + +

{lang}wcf.search.query.description{/lang}

+
+ + +
+
+
+ + + {event name='authorOptions'} +
+
+ +
+
+
+ + + {event name='periodOptions'} +
+
+ +
+
+
+ + + + {event name='displayOptions'} +
+
+ + {event name='generalFields'} + +
+
{lang}wcf.search.type{/lang}
+
+ {foreach from=$objectTypes key=objectTypeName item=objectType} + {if $objectType->isAccessible()} + + {/if} + {/foreach} +
+
+
+ + {event name='fieldsets'} + {if $useCaptcha}{include file='recaptcha'}{/if} + + {foreach from=$objectTypes key=objectTypeName item=objectType} + {if $objectType->isAccessible() && $objectType->getFormTemplateName()} + {assign var='__jsID' value='.'|str_replace:'_':$objectTypeName} +
+ {lang}wcf.search.type.{@$objectTypeName}{/lang} + + {include file=$objectType->getFormTemplateName() application=$objectType->getApplication()} + + +
+ {/if} + {/foreach} +
+ +
+ +
+
+ +{include file='footer'} + + + + + \ No newline at end of file diff --git a/com.woltlab.wcf/template/searchArea.tpl b/com.woltlab.wcf/template/searchArea.tpl new file mode 100644 index 0000000000..8cd2752e44 --- /dev/null +++ b/com.woltlab.wcf/template/searchArea.tpl @@ -0,0 +1,35 @@ +{capture assign='__searchFormLink'}{link controller='Search'}{/link}{/capture} +{capture assign='__searchInputPlaceholder'}{lang}wcf.global.search.enterSearchTerm{/lang}{/capture} +{capture assign='__searchDropdownOptions'}{/capture} +{assign var='__searchHiddenInputFields' value=''} + +{event name='settings'} + + + + + \ No newline at end of file diff --git a/com.woltlab.wcf/template/searchResult.tpl b/com.woltlab.wcf/template/searchResult.tpl new file mode 100644 index 0000000000..aca7cf64c1 --- /dev/null +++ b/com.woltlab.wcf/template/searchResult.tpl @@ -0,0 +1,60 @@ +{include file='documentHeader'} + + + {lang}wcf.search.results{/lang} - {PAGE_TITLE|language} + + {include file='headInclude'} + + + + +{include file='header'} + +
+

{if $query}{lang}wcf.search.results{/lang}{else}{lang}wcf.search.results{/lang}{/if}

+

{lang}wcf.search.results.description{/lang}

+
+ +{include file='userNotice'} + +
+ {assign var=encodedHighlight value=$highlight|urlencode} + {pages print=true assign=pagesLinks controller='SearchResult' id=$searchID link="pageNo=%d&highlight=$encodedHighlight"} + + {hascontent} + + {/hascontent} +
+ +{include file=$resultListTemplateName application=$resultListApplication} + +
+ {@$pagesLinks} + + {hascontent} + + {/hascontent} +
+ +{include file='footer'} + + + \ No newline at end of file diff --git a/com.woltlab.wcf/template/searchResultList.tpl b/com.woltlab.wcf/template/searchResultList.tpl new file mode 100644 index 0000000000..162a53837c --- /dev/null +++ b/com.woltlab.wcf/template/searchResultList.tpl @@ -0,0 +1,25 @@ +
+ +
\ No newline at end of file diff --git a/wcfsetup/install/files/js/WCF.Search.Message.js b/wcfsetup/install/files/js/WCF.Search.Message.js new file mode 100644 index 0000000000..98eac69bf0 --- /dev/null +++ b/wcfsetup/install/files/js/WCF.Search.Message.js @@ -0,0 +1,124 @@ +/** + * Namespace + */ +WCF.Search.Message = {}; + +/** + * Provides quick search for search keywords. + * + * @see WCF.Search.Base + */ +WCF.Search.Message.KeywordList = WCF.Search.Base.extend({ + /** + * @see WCF.Search.Base._className + */ + _className: 'wcf\\data\\search\\keyword\\SearchKeywordAction', + + /** + * dropdown divider + * @var jQuery + */ + _divider: null, + + /** + * true, if submit should be forced + * @var boolean + */ + _forceSubmit: false, + + /** + * @see WCF.Search.Base.init() + */ + init: function(searchInput, callback, excludedSearchValues) { + if (!$.isFunction(callback)) { + console.debug("[WCF.Search.Message.KeywordList] The given callback is invalid, aborting."); + return; + } + + this._callback = callback; + this._excludedSearchValues = []; + if (excludedSearchValues) { + this._excludedSearchValues = excludedSearchValues; + } + this._searchInput = $(searchInput).keyup($.proxy(this._keyUp, this)).keydown($.proxy(function(event) { + // block form submit + if (event.which === 13) { + // ... unless there are no suggestions + if (this._itemCount) { + event.preventDefault(); + } + } + }, this)); + + var $dropdownMenu = this._searchInput.next('.dropdownMenu'); + var $lastDivider = $dropdownMenu.find('li.dropdownDivider').last(); + this._divider = $('