X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FWidget.php;h=faba55b7a860b483e28022e98909d85eaa2cb899;hb=acd1caa1144f558002214d5991f551f232482200;hp=230f2b6958f1685f888d04a1ad2be0e83a0d9568;hpb=4f2ae8868431952bd3acda1537ee899740cbf205;p=friendica.git
diff --git a/src/Content/Widget.php b/src/Content/Widget.php
index 230f2b6958..faba55b7a8 100644
--- a/src/Content/Widget.php
+++ b/src/Content/Widget.php
@@ -10,9 +10,9 @@ 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\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
@@ -49,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)
. '
';
}
@@ -80,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)) {
@@ -149,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);
@@ -277,11 +267,11 @@ class Widget
if (Profile::getMyURL()) {
$contact = DBA::selectFirst('contact', ['id'],
['nurl' => normalise_link(Profile::getMyURL()), 'uid' => $profile_uid]);
- if (DBM::is_result($contact)) {
+ if (DBA::isResult($contact)) {
$cid = $contact['id'];
} else {
$gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(Profile::getMyURL())]);
- if (DBM::is_result($gcontact)) {
+ if (DBA::isResult($gcontact)) {
$zcid = $gcontact['id'];
}
}