From: Michael Date: Wed, 28 Aug 2019 14:07:21 +0000 (+0000) Subject: Moved array to the top X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1c4b96ae2649230386bd9c4d190ea053aaad2fc0;p=friendica.git Moved array to the top --- diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index ac14926920..478cfdbbe8 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -191,10 +191,16 @@ class ContactSelector Protocol::PNUT => 'file-text-o', /// @todo ]; + $platform_icons = ['diaspora' => 'diaspora', 'friendica' => 'friendica', 'friendika' => 'friendica', + 'GNU Social' => 'gnu-social', 'gnusocial' => 'gnu-social', 'hubzilla' => 'hubzilla', + 'mastodon' => 'mastodon', 'peertube' => 'peertube', 'pixelfed' => 'pixelfed', + 'pleroma' => 'pleroma', 'red' => 'hubzilla', 'redmatrix' => 'hubzilla', + 'socialhome' => 'social-home', 'wordpress' => 'wordpress']; + $search = array_keys($nets); $replace = array_values($nets); - $networkicon = str_replace($search, $replace, $network); + $network_icon = str_replace($search, $replace, $network); if ((in_array($network, Protocol::FEDERATED)) && ($profile != "")) { $server_url = self::getServerURLForProfile($profile); @@ -203,16 +209,11 @@ class ContactSelector $gserver = DBA::selectFirst('gserver', ['platform'], ['nurl' => $server_url]); if (DBA::isResult($gserver) && !empty($gserver['platform'])) { - $icons = ['diaspora' => 'diaspora', 'friendica' => 'friendica', 'friendika' => 'friendica', - 'GNU Social' => 'gnu-social', 'gnusocial' => 'gnu-social', 'hubzilla' => 'hubzilla', - 'mastodon' => 'mastodon', 'peertube' => 'peertube', 'pixelfed' => 'pixelfed', - 'pleroma' => 'pleroma', 'red' => 'hubzilla', 'redmatrix' => 'hubzilla', - 'socialhome' => 'social-home', 'wordpress' => 'wordpress']; - $networkicon = $icons[strtolower($gserver['platform'])] ?? $networkicon; + $network_icon = $platform_icons[strtolower($gserver['platform'])] ?? $network_icon; } } - return $networkicon; + return $network_icon; } /**