Current type is now carried over to the extended search
authorMarcel Werk <burntime@woltlab.com>
Mon, 29 Aug 2016 09:43:05 +0000 (11:43 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 29 Aug 2016 09:43:05 +0000 (11:43 +0200)
com.woltlab.wcf/templates/pageHeaderSearch.tpl
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Page.js

index 9948a5599af2a67d9d299b506a36d85cd9f71597..739d783b1829cf038c35213c42afe5a3a8c8e231 100644 (file)
@@ -13,7 +13,7 @@
        {assign var='__searchObjectTypeName' value='com.woltlab.wcf.article'}
        
        {capture assign='__searchTypesScoped'}
-               {if $category|isset}<li><a href="#" data-object-type="com.woltlab.wcf.article" data-parameters='{ "articleCategoryIDs[]": {@$category->categoryID} }'>{$category->getTitle()}</a></li>{/if}
+               {if $category|isset}<li><a href="#" data-extended-link="{link controller='Search'}types[]=com.woltlab.wcf.article{/link}" data-object-type="com.woltlab.wcf.article" data-parameters='{ "articleCategoryIDs[]": {@$category->categoryID} }'>{$category->getTitle()}</a></li>{/if}
        {/capture}
        {assign var='__searchAreaInitialized' value=true}
 {/if}
@@ -32,7 +32,7 @@
                        <div class="pageHeaderSearchType dropdown">
                                <a href="#" class="button dropdownToggle">{@$__searchTypeLabel}</a>
                                <ul class="dropdownMenu">
-                                       <li><a href="#" data-object-type="everywhere">{lang}wcf.search.type.everywhere{/lang}</a></li>
+                                       <li><a href="#" data-extended-link="{link controller='Search'}{/link}" data-object-type="everywhere">{lang}wcf.search.type.everywhere{/lang}</a></li>
                                        <li class="dropdownDivider"></li>
                                        
                                        {hascontent}
                                        
                                        {foreach from=$__wcf->getSearchEngine()->getAvailableObjectTypes() key=_searchObjectTypeName item=_searchObjectType}
                                                {if $_searchObjectType->isAccessible()}
-                                                       <li><a href="#" data-object-type="{@$_searchObjectTypeName}">{lang}wcf.search.type.{@$_searchObjectTypeName}{/lang}</a></li>
+                                                       <li><a href="#" data-extended-link="{link controller='Search'}types[]={@$_searchObjectTypeName}{/link}" data-object-type="{@$_searchObjectTypeName}">{lang}wcf.search.type.{@$_searchObjectTypeName}{/lang}</a></li>
                                                {/if}
                                        {/foreach}
                                        
                                        <li class="dropdownDivider"></li>
-                                       <li><a href="{@$__searchLink}">{lang}wcf.search.extended{/lang}</a></li>
+                                       <li><a class="pageHeaderSearchExtendedLink" href="{@$__searchLink}">{lang}wcf.search.extended{/lang}</a></li>
                                </ul>
                        </div>
                        
index 70ae1b6d811860e96308fa5003235a842bae3ea2..26659ee010ec18db5745b547396014059defbf35 100644 (file)
@@ -51,6 +51,11 @@ define(['Core', 'Dom/Traverse', 'Dom/Util', 'Ui/SimpleDropdown', './Input'], fun
                        var container = elById('pageHeaderSearchParameters');
                        container.innerHTML = '';
                        
+                       var extendedLink = elData(event.currentTarget, 'extended-link');
+                       if (extendedLink) {
+                               elBySel('.pageHeaderSearchExtendedLink').href = extendedLink;
+                       }
+                       
                        var parameters = elData(event.currentTarget, 'parameters');
                        if (parameters) {
                                parameters = JSON.parse(parameters);