]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Directory.php
Add new frio.always_open_compose setting
[friendica.git] / src / Module / Directory.php
index a81780a28014f5b89af0ec3f5cb423e1d42c1a7d..9fac9db302c72fe4ba54969de63d41a58fb5c9b9 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,6 +28,7 @@ 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;
@@ -38,7 +39,7 @@ use Friendica\Network\HTTPException;
  */
 class Directory extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $app = DI::app();
                $config = DI::config();
@@ -61,7 +62,7 @@ class Directory extends BaseModule
                $search = trim(rawurldecode($_REQUEST['search'] ?? ''));
 
                $gDirPath = '';
-               $dirURL = $config->get('system', 'directory');
+               $dirURL = Search::getGlobalDirectory();
                if (strlen($dirURL)) {
                        $gDirPath = Profile::zrl($dirURL, true);
                }
@@ -111,7 +112,7 @@ class Directory extends BaseModule
         *
         * @throws \Exception
         */
-       public static function formatEntry(array $contact, $photo_size = 'photo')
+       public static function formatEntry(array $contact, string $photo_size = 'photo'): array
        {
                $itemurl = (($contact['addr'] != "") ? $contact['addr'] : $contact['url']);
 
@@ -165,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'] ?? 0),
                        'profile'      => $profile,
                        'location'     => $location_e,
                        'tags'         => $contact['pub_keywords'],