Removed custom icons from search result items
authorAlexander Ebert <ebert@woltlab.com>
Mon, 22 Aug 2022 14:30:29 +0000 (16:30 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 22 Aug 2022 14:30:29 +0000 (16:30 +0200)
This feature was entirely unused.

com.woltlab.wcf/templates/searchResultList.tpl
wcfsetup/install/files/lib/data/search/ICustomIconSearchResultObject.class.php [deleted file]
wcfsetup/install/files/lib/data/search/SearchAction.class.php
wcfsetup/install/files/lib/page/SearchResultPage.class.php
wcfsetup/install/files/lib/system/search/SearchResultHandler.class.php

index 43007535c94212acf1d12482afa2ebdfc7de496d..d8c6aa06b174c0b0d524b4f6236111922baeba69 100644 (file)
@@ -3,17 +3,10 @@
                {foreach from=$objects item=message}
                        <li class="gridListItem gridListItemMessage">
                                <div class="gridListItemImage">
-                                       {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}
-                                               <span class="icon icon48 {$_messageCustomIcon}"></span>
+                                       {if $message->getUserProfile()}
+                                               {user object=$message->getUserProfile() type='avatar48' ariaHidden='true' tabindex='-1'}
                                        {else}
-                                               <img src="{$_messageCustomIcon}" height="48" width="48" alt="">
+                                               {icon size=48 name='file'}
                                        {/if}
                                </div>
                                
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 (file)
index 3aa7164..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-namespace wcf\data\search;
-
-/**
- * Extends the base search result objects with the ability to provide a custom image or icon
- * class name instead of the default avatar/icon.
- *
- * @author      Alexander Ebert
- * @copyright   2001-2019 WoltLab GmbH
- * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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();
-}
index 4016205ae2cdb56b1448f19c73a06c8e9cb365ed..4b8ba540d36858a4597a201e79cdf1f4f33b0ae7 100644 (file)
@@ -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(),
         ]);
 
index e33e0e22b250ca51b0c820cb355879d96258f6a6..c402fe1dd3461184b0b4ee7ad4846e94281de9dc 100644 (file)
@@ -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;
             }
         }
     }
index 15c1f9972b80cea154a026ede5bea23dd8130514..6dd200fe97c5dc9ace26d7c5696f6e80dac34297 100644 (file)
@@ -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;
             }
         }
     }