Added sorted list of search providers
authorMarcel Werk <burntime@woltlab.com>
Wed, 1 Jun 2016 14:34:14 +0000 (16:34 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 1 Jun 2016 14:34:14 +0000 (16:34 +0200)
wcfsetup/install/files/acp/templates/pageHeaderSearch.tpl
wcfsetup/install/files/lib/system/WCFACP.class.php

index 7268bec2af4a51e76df3a2f41e9c5dab99c30b4b..35f8ffa94525408ac26dfe225b6aee22909d2789 100644 (file)
@@ -6,8 +6,8 @@
                                <li><a href="#" data-provider-name="everywhere">{lang}wcf.search.type.everywhere{/lang}</a></li>
                                <li class="dropdownDivider"></li>
                                
-                               {foreach from=$availableAcpSearchProviders item='availableAcpSearchProvider'}
-                                       <li><a href="#" data-provider-name="{@$availableAcpSearchProvider->providerName}">{lang}wcf.acp.search.provider.{@$availableAcpSearchProvider->providerName}{/lang}</a></li>
+                               {foreach from=$availableAcpSearchProviders key='availableAcpSearchProviderName' item='availableAcpSearchProviderLabel'}
+                                       <li><a href="#" data-provider-name="{@$availableAcpSearchProviderName}">{@$availableAcpSearchProviderLabel}</a></li>
                                {/foreach}
                        </ul>
                </div>
index 41ceec09b9ff7525158c2405b539ea600af0396e..e7d0ab2726050551bca68557e11e598dc467187b 100644 (file)
@@ -212,9 +212,16 @@ class WCFACP extends WCF {
                $host = RouteHandler::getHost();
                $path = RouteHandler::getPath();
                
+               // available acp search providers
+               $availableAcpSearchProviders = [];
+               foreach (ACPSearchProviderCacheBuilder::getInstance()->getData() as $searchProvider) {
+                       $availableAcpSearchProviders[$searchProvider->providerName] = self::getLanguage()->get('wcf.acp.search.provider.'.$searchProvider->providerName);
+               }
+               asort($availableAcpSearchProviders);
+               
                self::getTPL()->assign([
                        'baseHref' => $host . $path,
-                       'availableAcpSearchProviders' => ACPSearchProviderCacheBuilder::getInstance()->getData()
+                       'availableAcpSearchProviders' => $availableAcpSearchProviders
                ]);
        }