X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FAllFriends.php;h=662dc17e4c24c047402f27b8773b9b7b879b80e2;hb=0f932ae723c8b97a1889b9d77a52da3fe7f8b2b3;hp=e5fbe697128d576374fd6fed2d9b2e75da3ee3ab;hpb=f59ea2af55aea17beeda1f93ad9ea91f12b1b84d;p=friendica.git diff --git a/src/Module/AllFriends.php b/src/Module/AllFriends.php index e5fbe69712..662dc17e4c 100644 --- a/src/Module/AllFriends.php +++ b/src/Module/AllFriends.php @@ -5,8 +5,8 @@ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Content\ContactSelector; use Friendica\Content\Pager; -use Friendica\Core\L10n; use Friendica\Core\Renderer; +use Friendica\DI; use Friendica\Model; use Friendica\Network\HTTPException; use Friendica\Util\Proxy as ProxyUtils; @@ -16,9 +16,9 @@ use Friendica\Util\Proxy as ProxyUtils; */ class AllFriends extends BaseModule { - public static function content() + public static function content(array $parameters = []) { - $app = self::getApp(); + $app = DI::app(); if (!local_user()) { throw new HTTPException\ForbiddenException(); @@ -32,7 +32,7 @@ class AllFriends extends BaseModule } if (!$cid) { - throw new HTTPException\BadRequestException(L10n::t('Invalid contact.')); + throw new HTTPException\BadRequestException(DI::l10n()->t('Invalid contact.')); } $uid = $app->user['uid']; @@ -40,19 +40,19 @@ class AllFriends extends BaseModule $contact = Model\Contact::getContactForUser($cid, local_user(), ['name', 'url', 'photo', 'uid', 'id']); if (empty($contact)) { - throw new HTTPException\BadRequestException(L10n::t('Invalid contact.')); + throw new HTTPException\BadRequestException(DI::l10n()->t('Invalid contact.')); } - $app->page['aside'] = ""; + DI::page()['aside'] = ""; Model\Profile::load($app, "", 0, Model\Contact::getDetailsByURL($contact["url"])); $total = Model\GContact::countAllFriends(local_user(), $cid); - $pager = new Pager($app->query_string); + $pager = new Pager(DI::args()->getQueryString()); $friends = Model\GContact::allFriends(local_user(), $cid, $pager->getStart(), $pager->getItemsPerPage()); if (empty($friends)) { - return L10n::t('No friends to display.'); + return DI::l10n()->t('No friends to display.'); } $id = 0; @@ -69,10 +69,10 @@ class AllFriends extends BaseModule $friend['id'] = $friend['cid']; $photoMenu = Model\Contact::photoMenu($friend); } else { - $connlnk = $app->getBaseURL() . '/follow/?url=' . $friend['url']; + $connlnk = DI::baseUrl()->get() . '/follow/?url=' . $friend['url']; $photoMenu = [ - 'profile' => [L10n::t('View Profile'), Model\Contact::magicLinkbyId($friend['id'], $friend['url'])], - 'follow' => [L10n::t('Connect/Follow'), $connlnk] + 'profile' => [DI::l10n()->t('View Profile'), Model\Contact::magicLinkbyId($friend['id'], $friend['url'])], + 'follow' => [DI::l10n()->t('Connect/Follow'), $connlnk] ]; } @@ -88,7 +88,7 @@ class AllFriends extends BaseModule 'account_type' => Model\Contact::getAccountType($contactDetails), 'network' => ContactSelector::networkToName($contactDetails['network'], $contactDetails['url']), 'photoMenu' => $photoMenu, - 'conntxt' => L10n::t('Connect'), + 'conntxt' => DI::l10n()->t('Connect'), 'connlnk' => $connlnk, 'id' => ++$id, ];