X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FWidget%2FTrendingTags.php;h=b6b38006bf5bc3b80f205dcae9cf72e220ab884c;hb=7e618856ab09ac74a3760e238c73ecb9515f6701;hp=4ac8a1119e811f5d1742416201f71debdcce3d73;hpb=eba46e786a5b160af690f15d3a3e42f6b9b1e3e4;p=friendica.git diff --git a/src/Content/Widget/TrendingTags.php b/src/Content/Widget/TrendingTags.php index 4ac8a1119e..b6b38006bf 100644 --- a/src/Content/Widget/TrendingTags.php +++ b/src/Content/Widget/TrendingTags.php @@ -1,10 +1,29 @@ . + * + */ namespace Friendica\Content\Widget; -use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Model\Term; +use Friendica\DI; +use Friendica\Model\Tag; /** * Trending tags aside widget for the community pages, handles both local and global scopes @@ -16,22 +35,23 @@ class TrendingTags /** * @param string $content 'global' (all posts) or 'local' (this node's posts only) * @param int $period Period in hours to consider posts - * @return string + * + * @return string Formatted HTML code * @throws \Exception */ - public static function getHTML($content = 'global', int $period = 24) + public static function getHTML(string $content = 'global', int $period = 24): string { if ($content == 'local') { - $tags = Term::getLocalTrendingHashtags($period, 20); + $tags = Tag::getLocalTrendingHashtags($period, 20); } else { - $tags = Term::getGlobalTrendingHashtags($period, 20); + $tags = Tag::getGlobalTrendingHashtags($period, 20); } $tpl = Renderer::getMarkupTemplate('widget/trending_tags.tpl'); $o = Renderer::replaceMacros($tpl, [ - '$title' => L10n::tt('Trending Tags (last %d hour)', 'Trending Tags (last %d hours)', $period), - '$more' => L10n::t('More Trending Tags'), - '$tags' => $tags, + '$title' => DI::l10n()->tt('Trending Tags (last %d hour)', 'Trending Tags (last %d hours)', $period), + '$more' => DI::l10n()->t('More Trending Tags'), + '$tags' => $tags, ]); return $o;