]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Directory.php
Merge pull request #11503 from annando/bulk-delivery
[friendica.git] / src / Module / Directory.php
index b5c8e254f4c6abb4c0e935b8d860b62a94cb4cf0..b79e7b1495a3c89ac99b60f2e26a6b4938499ed3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -28,18 +28,18 @@ use Friendica\Content\Widget;
 use Friendica\Core\Hook;
 use Friendica\Core\Session;
 use Friendica\Core\Renderer;
+use Friendica\Core\Search;
 use Friendica\DI;
 use Friendica\Model;
 use Friendica\Model\Profile;
 use Friendica\Network\HTTPException;
-use Friendica\Util\Strings;
 
 /**
  * Shows the local directory of this node
  */
 class Directory extends BaseModule
 {
-       public static function content(array $parameters = [])
+       protected function content(array $request = []): string
        {
                $app = DI::app();
                $config = DI::config();
@@ -59,12 +59,10 @@ class Directory extends BaseModule
 
                Nav::setSelected('directory');
 
-               $search = (!empty($_REQUEST['search']) ?
-                       Strings::escapeTags(trim(rawurldecode($_REQUEST['search']))) :
-                       '');
+               $search = trim(rawurldecode($_REQUEST['search'] ?? ''));
 
                $gDirPath = '';
-               $dirURL = $config->get('system', 'directory');
+               $dirURL = Search::getGlobalDirectory();
                if (strlen($dirURL)) {
                        $gDirPath = Profile::zrl($dirURL, true);
                }
@@ -76,12 +74,6 @@ class Directory extends BaseModule
                if ($profiles['total'] === 0) {
                        notice(DI::l10n()->t('No entries (some entries may be hidden).'));
                } else {
-                       if (in_array('small', $app->argv)) {
-                               $photo = 'thumb';
-                       } else {
-                               $photo = 'photo';
-                       }
-
                        foreach ($profiles['entries'] as $entry) {
                                $contact = Model\Contact::getByURLForUser($entry['url'], local_user());
                                if (!empty($contact)) {
@@ -174,7 +166,7 @@ class Directory extends BaseModule
                        'img_hover'    => $contact['name'],
                        'name'         => $contact['name'],
                        'details'      => $details,
-                       'account_type' => Model\Contact::getAccountType($contact),
+                       'account_type' => Model\Contact::getAccountType($contact['contact-type']),
                        'profile'      => $profile,
                        'location'     => $location_e,
                        'tags'         => $contact['pub_keywords'],