X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FWidget.php;h=93dc5b71759eeb62daa065aafc9fa4e47e6a377f;hb=739b6d6533fb54b1d7e6a641242c0103d73c487e;hp=06841ed924038b9780af21720259d9f0b696f7ff;hpb=ba9f145ef78236ffbf304d07adbe2aa51f5326d4;p=friendica.git
diff --git a/src/Content/Widget.php b/src/Content/Widget.php
index 06841ed924..93dc5b7175 100644
--- a/src/Content/Widget.php
+++ b/src/Content/Widget.php
@@ -1,6 +1,6 @@
get('system', 'invitation_only')) {
- $x = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'invites_remaining'));
+ $x = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'invites_remaining'));
if ($x || DI::app()->isSiteAdmin()) {
DI::page()['aside'] .= '
'
. DI::l10n()->tt('%d invitation available', '%d invitations available', $x)
@@ -121,6 +120,10 @@ class Widget
$networks[] = Protocol::TWITTER;
}
+ if (!Addon::isEnabled("tumblr")) {
+ $networks[] = Protocol::TUMBLR;
+ }
+
if (DI::config()->get("system", "ostatus_disabled")) {
$networks[] = Protocol::OSTATUS;
}
@@ -196,7 +199,7 @@ class Widget
*/
public static function groups(string $baseurl, string $selected = ''): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
@@ -205,7 +208,7 @@ class Widget
'ref' => $group['id'],
'name' => $group['name']
];
- }, Group::getByUserId(Session::getLocalUser()));
+ }, Group::getByUserId(DI::userSession()->getLocalUserId()));
return self::filter(
'group',
@@ -228,7 +231,7 @@ class Widget
*/
public static function contactRels(string $baseurl, string $selected = ''): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
@@ -259,13 +262,13 @@ class Widget
*/
public static function networks(string $baseurl, string $selected = ''): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
$networks = self::unavailableNetworks();
$query = "`uid` = ? AND NOT `deleted` AND `network` != '' AND NOT `network` IN (" . substr(str_repeat("?, ", count($networks)), 0, -2) . ")";
- $condition = array_merge([$query], array_merge([Session::getLocalUser()], $networks));
+ $condition = array_merge([$query], array_merge([DI::userSession()->getLocalUserId()], $networks));
$r = DBA::select('contact', ['network'], $condition, ['group_by' => ['network'], 'order' => ['network']]);
@@ -300,12 +303,12 @@ class Widget
*/
public static function fileAs(string $baseurl, string $selected = ''): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
$terms = [];
- foreach (Post\Category::getArray(Session::getLocalUser(), Post\Category::FILE) as $savedFolderName) {
+ foreach (Post\Category::getArray(DI::userSession()->getLocalUserId(), Post\Category::FILE) as $savedFolderName) {
$terms[] = ['ref' => $savedFolderName, 'name' => $savedFolderName];
}
@@ -362,11 +365,11 @@ class Widget
*/
public static function commonFriendsVisitor(int $uid, string $nickname): string
{
- if (Session::getLocalUser() == $uid) {
+ if (DI::userSession()->getLocalUserId() == $uid) {
return '';
}
- $visitorPCid = Session::getLocalUser() ? Contact::getPublicIdByUserId(Session::getLocalUser()) : Session::getRemoteUser();
+ $visitorPCid = DI::userSession()->getPublicContactId() ?: DI::userSession()->getRemoteUserId();
if (!$visitorPCid) {
return '';
}