]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Widget.php
Change parameter to PostMedias in Item::makeImageGrid
[friendica.git] / src / Content / Widget.php
index c8c0230c688dd7bafc136127ff05afdf88e92fc4..1f73f0449591d1fc8746e4b662dfcf2e1965a705 100644 (file)
@@ -102,7 +102,7 @@ class Widget
        public static function unavailableNetworks(): array
        {
                // Always hide content from these networks
-               $networks = [Protocol::PHANTOM, Protocol::FACEBOOK, Protocol::APPNET, Protocol::ZOT];
+               $networks = [Protocol::PHANTOM, Protocol::FACEBOOK, Protocol::APPNET, Protocol::TWITTER, Protocol::ZOT];
 
                if (!Addon::isEnabled("discourse")) {
                        $networks[] = Protocol::DISCOURSE;
@@ -116,10 +116,6 @@ class Widget
                        $networks[] = Protocol::PUMPIO;
                }
 
-               if (!Addon::isEnabled("twitter")) {
-                       $networks[] = Protocol::TWITTER;
-               }
-
                if (!Addon::isEnabled("tumblr")) {
                        $networks[] = Protocol::TUMBLR;
                }
@@ -551,4 +547,35 @@ class Widget
                        $accounttype
                );
        }
+
+       /**
+        * Get a list of all channels
+        *
+        * @param string $base
+        * @param string $channelname
+        * @param integer $uid
+        * @return string
+        */
+       public static function channels(string $base, string $channelname, int $uid): string
+       {
+               $channels = [];
+
+               foreach (DI::TimelineFactory()->getChannelsForUser($uid) as $channel) {
+                       $channels[] = ['ref' => $channel->code, 'name' => $channel->label];
+               }
+
+               foreach (DI::TimelineFactory()->getCommunities(true) as $community) {
+                       $channels[] = ['ref' => $community->code, 'name' => $community->label];
+               }
+
+               return self::filter(
+                       'channel',
+                       DI::l10n()->t('Channels'),
+                       '',
+                       '',
+                       $base,
+                       $channels,
+                       $channelname
+               );
+       }
 }