From: Matthias Schmidt Date: Mon, 7 Aug 2017 17:01:17 +0000 (+0200) Subject: Add template scripting support for permission ACP search results X-Git-Tag: 3.1.0_Alpha_1~67 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b3948fa119c39bf723657ef63bf985edf886c62b;p=GitHub%2FWoltLab%2FWCF.git Add template scripting support for permission ACP search results --- diff --git a/wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php index 4e6855de9d..647183a972 100644 --- a/wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php @@ -33,21 +33,21 @@ class UserGroupOptionACPSearchResultProvider extends AbstractCategorizedACPSearc $conditions->add("languageItem LIKE ?", ['wcf.acp.group.option.%']); $conditions->add("languageItemValue LIKE ?", ['%'.$query.'%']); - $sql = "SELECT languageItem, languageItemValue + $sql = "SELECT languageItem FROM wcf".WCF_N."_language_item ".$conditions." ORDER BY languageItemValue ASC"; $statement = WCF::getDB()->prepareStatement($sql); // don't use a limit here $statement->execute($conditions->getParameters()); $languageItems = []; - while ($row = $statement->fetchArray()) { + while ($languageItem = $statement->fetchColumn()) { // ignore descriptions - if (substr($row['languageItem'], -12) == '.description') { + if (substr($languageItem, -12) == '.description') { continue; } - $itemName = preg_replace('~^([a-z]+)\.acp\.group\.option\.~', '', $row['languageItem']); - $languageItems[$itemName] = $row['languageItemValue']; + $itemName = preg_replace('~^([a-z]+)\.acp\.group\.option\.~', '', $languageItem); + $languageItems[$itemName] = $languageItem; } if (empty($languageItems)) { @@ -85,9 +85,11 @@ class UserGroupOptionACPSearchResultProvider extends AbstractCategorizedACPSearc $categoryName = $optionCategories[$categoryName]->parentCategoryName; } - $results[] = new ACPSearchResult($languageItems[$userGroupOption->optionName], $link, WCF::getLanguage()->getDynamicVariable('wcf.acp.search.result.subtitle', [ - 'pieces' => $parentCategories - ])); + $results[] = new ACPSearchResult( + WCF::getLanguage()->getDynamicVariable($languageItems[$userGroupOption->optionName]), + $link, + WCF::getLanguage()->getDynamicVariable('wcf.acp.search.result.subtitle', ['pieces' => $parentCategories]) + ); } return $results;