From: Alexander Ebert Date: Mon, 22 Aug 2022 14:30:29 +0000 (+0200) Subject: Removed custom icons from search result items X-Git-Tag: 6.0.0_Alpha_1~1024^2~2^2~23 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3616f5d90ce4fb95e940a94fa2354d2fa2421de8;p=GitHub%2FWoltLab%2FWCF.git Removed custom icons from search result items This feature was entirely unused. --- diff --git a/com.woltlab.wcf/templates/searchResultList.tpl b/com.woltlab.wcf/templates/searchResultList.tpl index 43007535c9..d8c6aa06b1 100644 --- a/com.woltlab.wcf/templates/searchResultList.tpl +++ b/com.woltlab.wcf/templates/searchResultList.tpl @@ -3,17 +3,10 @@ {foreach from=$objects item=message}
  • - {assign var=_messageCustomIcon value=$customIcons[$message]} - {if $_messageCustomIcon === ''} - {if $message->getUserProfile()} - {user object=$message->getUserProfile() type='avatar48' ariaHidden='true' tabindex='-1'} - {else} - {icon size=48 name='file'} - {/if} - {elseif $_messageCustomIcon|strpos:'fa-' === 0} - + {if $message->getUserProfile()} + {user object=$message->getUserProfile() type='avatar48' ariaHidden='true' tabindex='-1'} {else} - + {icon size=48 name='file'} {/if}
    diff --git a/wcfsetup/install/files/lib/data/search/ICustomIconSearchResultObject.class.php b/wcfsetup/install/files/lib/data/search/ICustomIconSearchResultObject.class.php deleted file mode 100644 index 3aa7164343..0000000000 --- a/wcfsetup/install/files/lib/data/search/ICustomIconSearchResultObject.class.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @package WoltLabSuite\Core\Data\Search - * @since 5.2 - */ -interface ICustomIconSearchResultObject extends ISearchResultObject -{ - /** - * Returns either a FontAwesome icon name including the `fa-` prefix or - * a string that is interpreted as an URL to an image that can be scaled - * to 48x48. Returning an empty string will trigger the default behavior. - * - * @return string - */ - public function getCustomSearchResultIcon(); -} diff --git a/wcfsetup/install/files/lib/data/search/SearchAction.class.php b/wcfsetup/install/files/lib/data/search/SearchAction.class.php index 4016205ae2..4b8ba540d3 100644 --- a/wcfsetup/install/files/lib/data/search/SearchAction.class.php +++ b/wcfsetup/install/files/lib/data/search/SearchAction.class.php @@ -123,7 +123,6 @@ class SearchAction extends AbstractDatabaseObjectAction WCF::getTPL()->assign([ 'objects' => $resultHandler->getSearchResults(), - 'customIcons' => $resultHandler->getCustomIcons(), 'query' => $resultHandler->getQuery(), ]); @@ -169,7 +168,6 @@ class SearchAction extends AbstractDatabaseObjectAction WCF::getTPL()->assign([ 'objects' => $resultHandler->getSearchResults(), - 'customIcons' => $resultHandler->getCustomIcons(), 'query' => $resultHandler->getQuery(), ]); diff --git a/wcfsetup/install/files/lib/page/SearchResultPage.class.php b/wcfsetup/install/files/lib/page/SearchResultPage.class.php index e33e0e22b2..c402fe1dd3 100644 --- a/wcfsetup/install/files/lib/page/SearchResultPage.class.php +++ b/wcfsetup/install/files/lib/page/SearchResultPage.class.php @@ -2,7 +2,6 @@ namespace wcf\page; -use wcf\data\search\ICustomIconSearchResultObject; use wcf\data\search\ISearchResultObject; use wcf\data\search\Search; use wcf\system\event\EventHandler; @@ -25,12 +24,6 @@ use wcf\util\HeaderUtil; */ class SearchResultPage extends MultipleLinkPage { - /** - * list of custom icons per message - * @var string[] - */ - public $customIcons = []; - /** * @inheritDoc */ @@ -182,13 +175,7 @@ class SearchResultPage extends MultipleLinkPage throw new ImplementationException(\get_class($message), ISearchResultObject::class); } - $customIcon = ''; - if ($message instanceof ICustomIconSearchResultObject) { - $customIcon = $message->getCustomSearchResultIcon(); - } - $this->messages[] = $message; - $this->customIcons[\spl_object_hash($message)] = $customIcon; } } } diff --git a/wcfsetup/install/files/lib/system/search/SearchResultHandler.class.php b/wcfsetup/install/files/lib/system/search/SearchResultHandler.class.php index 15c1f9972b..6dd200fe97 100644 --- a/wcfsetup/install/files/lib/system/search/SearchResultHandler.class.php +++ b/wcfsetup/install/files/lib/system/search/SearchResultHandler.class.php @@ -2,7 +2,6 @@ namespace wcf\system\search; -use wcf\data\search\ICustomIconSearchResultObject; use wcf\data\search\ISearchResultObject; use wcf\data\search\Search; use wcf\page\SearchResultPage; @@ -34,11 +33,6 @@ final class SearchResultHandler */ private $messages = []; - /** - * @var \SplObjectStorage - */ - private $customIcons; - /** * @var int */ @@ -60,7 +54,6 @@ final class SearchResultHandler $this->startIndex = $startIndex; $this->limit = $limit; $this->searchData = \unserialize($this->search->searchData); - $this->customIcons = new \SplObjectStorage(); } public function countSearchResults(): int @@ -87,11 +80,6 @@ final class SearchResultHandler return $this->messages; } - public function getCustomIcons(): \SplObjectStorage - { - return $this->customIcons; - } - private function cacheMessageData(): void { $types = []; @@ -124,13 +112,7 @@ final class SearchResultHandler throw new ImplementationException(\get_class($message), ISearchResultObject::class); } - $customIcon = ''; - if ($message instanceof ICustomIconSearchResultObject) { - $customIcon = $message->getCustomSearchResultIcon(); - } - $this->messages[] = $message; - $this->customIcons[$message] = $customIcon; } } }