X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FWidget.php;h=86339928702dadadd879f02e1dbef365d6785d8d;hb=00aa905c155725d91d7b614abdcfcd070250bf7d;hp=ab9bb8882893f148868b490363c36eadc1ef8a3c;hpb=e17dc56af9dfe0e3d840b469451cd5117f90f5e2;p=friendica.git diff --git a/src/Content/Widget.php b/src/Content/Widget.php index ab9bb88828..8633992870 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -1,28 +1,38 @@ . + * */ + namespace Friendica\Content; -use Friendica\Content\ContactSelector; -use Friendica\Content\Feature; use Friendica\Core\Addon; -use Friendica\Core\Config; -use Friendica\Core\L10n; -use Friendica\Core\PConfig; +use Friendica\Core\Cache\Enum\Duration; use Friendica\Core\Protocol; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model\Contact; -use Friendica\Model\FileTag; -use Friendica\Model\GContact; -use Friendica\Model\Profile; -use Friendica\Util\Strings; -use Friendica\Util\XML; - -require_once 'boot.php'; -require_once 'include/dba.php'; +use Friendica\Model\Group; +use Friendica\Model\Item; +use Friendica\Model\Post; +use Friendica\Util\DateTimeFormat; +use Friendica\Util\Temporal; class Widget { @@ -30,15 +40,17 @@ class Widget * Return the follow widget * * @param string $value optional, default empty + * @return string + * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public static function follow($value = "") { - return Renderer::replaceMacros(Renderer::getMarkupTemplate('follow.tpl'), array( - '$connect' => L10n::t('Add New Contact'), - '$desc' => L10n::t('Enter address or web location'), - '$hint' => L10n::t('Example: bob@example.com, http://example.com/barbara'), + return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/follow.tpl'), array( + '$connect' => DI::l10n()->t('Add New Contact'), + '$desc' => DI::l10n()->t('Enter address or web location'), + '$hint' => DI::l10n()->t('Example: bob@example.com, http://example.com/barbara'), '$value' => $value, - '$follow' => L10n::t('Connect') + '$follow' => DI::l10n()->t('Connect') )); } @@ -47,45 +59,50 @@ class Widget */ public static function findPeople() { - $a = get_app(); - $global_dir = Config::get('system', 'directory'); - - if (Config::get('system', 'invitation_only')) { - $x = PConfig::get(local_user(), 'system', 'invites_remaining'); - if ($x || is_site_admin()) { - $a->page['aside'] .= '