X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FWidget.php;h=faba55b7a860b483e28022e98909d85eaa2cb899;hb=947cc98cc43a82cb3e67b51a897009a7bd2629a0;hp=5928cb316ffec7d57ffcbd26503f32ddcca2728a;hpb=0ec44f3e8a73229c3aadea86f61b5571a701c6b7;p=friendica.git
diff --git a/src/Content/Widget.php b/src/Content/Widget.php
index 5928cb316f..faba55b7a8 100644
--- a/src/Content/Widget.php
+++ b/src/Content/Widget.php
@@ -10,6 +10,7 @@ use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
+use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
@@ -48,7 +49,7 @@ class Widget
if (Config::get('system', 'invitation_only')) {
$x = PConfig::get(local_user(), 'system', 'invites_remaining');
if ($x || is_site_admin()) {
- $a->page['aside'] .= '
'
+ $a->page['aside'] .= '
'
. L10n::tt('%d invitation available', '%d invitations available', $x)
. '
';
}
@@ -79,38 +80,31 @@ class Widget
*/
public static function unavailableNetworks()
{
- $networks = array();
-
- if (!Addon::isEnabled("appnet")) {
- $networks[] = NETWORK_APPNET;
- }
-
- if (!Addon::isEnabled("fbpost") && !Addon::isEnabled("facebook")) {
- $networks[] = NETWORK_FACEBOOK;
- }
+ // Always hide content from these networks
+ $networks = ['face', 'apdn'];
if (!Addon::isEnabled("statusnet")) {
- $networks[] = NETWORK_STATUSNET;
+ $networks[] = Protocol::STATUSNET;
}
if (!Addon::isEnabled("pumpio")) {
- $networks[] = NETWORK_PUMPIO;
+ $networks[] = Protocol::PUMPIO;
}
if (!Addon::isEnabled("twitter")) {
- $networks[] = NETWORK_TWITTER;
+ $networks[] = Protocol::TWITTER;
}
if (Config::get("system", "ostatus_disabled")) {
- $networks[] = NETWORK_OSTATUS;
+ $networks[] = Protocol::OSTATUS;
}
if (!Config::get("system", "diaspora_enabled")) {
- $networks[] = NETWORK_DIASPORA;
+ $networks[] = Protocol::DIASPORA;
}
if (!Addon::isEnabled("pnut")) {
- $networks[] = NETWORK_PNUT;
+ $networks[] = Protocol::PNUT;
}
if (!sizeof($networks)) {
@@ -148,10 +142,7 @@ class Widget
$nets = array();
while ($rr = DBA::fetch($r)) {
- /// @TODO If 'network' is not there, this triggers an E_NOTICE
- if ($rr['network']) {
- $nets[] = array('ref' => $rr['network'], 'name' => ContactSelector::networkToName($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' ));
- }
+ $nets[] = array('ref' => $rr['network'], 'name' => ContactSelector::networkToName($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' ));
}
DBA::close($r);
@@ -276,11 +267,11 @@ class Widget
if (Profile::getMyURL()) {
$contact = DBA::selectFirst('contact', ['id'],
['nurl' => normalise_link(Profile::getMyURL()), 'uid' => $profile_uid]);
- if (DBA::is_result($contact)) {
+ if (DBA::isResult($contact)) {
$cid = $contact['id'];
} else {
$gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(Profile::getMyURL())]);
- if (DBA::is_result($gcontact)) {
+ if (DBA::isResult($gcontact)) {
$zcid = $gcontact['id'];
}
}