]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Widget.php
Merge pull request #9675 from MrPetovan/bug/9656-purify-video-embed
[friendica.git] / src / Content / Widget.php
index 3e5af2251f1cfc88db5dbe03b4de9e5edaf3a972..f4a9fbe1f1b33eddf02422c16b8270e2c367fd80 100644 (file)
@@ -24,17 +24,13 @@ namespace Friendica\Content;
 use Friendica\Core\Addon;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
-use Friendica\Core\Session;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\FileTag;
-use Friendica\Model\GContact;
 use Friendica\Model\Group;
 use Friendica\Model\Item;
-use Friendica\Model\Profile;
 use Friendica\Util\DateTimeFormat;
-use Friendica\Util\Strings;
 use Friendica\Util\Temporal;
 
 class Widget
@@ -520,6 +516,7 @@ class Widget
                        '$cutoff' => $cutoff,
                        '$url' => $url,
                        '$dates' => $ret,
+                       '$showless' => DI::l10n()->t('show less'),
                        '$showmore' => DI::l10n()->t('show more')
                ]);
 
@@ -527,23 +524,23 @@ class Widget
        }
 
        /**
-        * Display the accounts sidebar
-        *
+        * Display the account types sidebar
+        * The account type value is added as a parameter to the url
+        * 
         * @param string $base        Basepath
-        * @param string $accounttype Acount type (person, organisation, news, community)
+        * @param int    $accounttype Acount type
         * @return string
         */
-       public static function accounts(string $base, string $accounttype)
+       public static function accounttypes(string $base, $accounttype)
        {
-               return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/accounts.tpl'), [
-                       '$title'        => DI::l10n()->t('Accounts'),
-                       '$content'      => $base,
-                       '$accounttype'  => ($accounttype ?? ''),
-                       '$all'          => DI::l10n()->t('All'),
-                       '$person'       => DI::l10n()->t('Persons'),
-                       '$organisation' => DI::l10n()->t('Organisations'),
-                       '$news'         => DI::l10n()->t('News'),
-                       '$community'    => DI::l10n()->t('Forums'),
-               ]);     
+               $accounts = [
+                       ['ref' => 'person', 'name' => DI::l10n()->t('Persons')],
+                       ['ref' => 'organisation', 'name' => DI::l10n()->t('Organisations')],
+                       ['ref' => 'news', 'name' => DI::l10n()->t('News')],
+                       ['ref' => 'community', 'name' => DI::l10n()->t('Forums')],
+               ];
+
+               return self::filter('accounttype', DI::l10n()->t('Account Types'), '',
+                       DI::l10n()->t('All'), $base, $accounts, $accounttype);
        }
 }