X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FWidget.php;h=35e8913e0869866dcf9c33778b46c5d2d6d8cb8b;hb=795268eb7ad3f10b08721f5d006f22a91bb5c9b6;hp=2f78d0fd3d387dd52f6e4830f2ed2f41c9c8b240;hpb=7d5494dd67f58e1fc63c6571946e26290092321c;p=friendica.git diff --git a/src/Content/Widget.php b/src/Content/Widget.php index 2f78d0fd3d..35e8913e08 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -18,9 +18,8 @@ use Friendica\Model\Contact; use Friendica\Model\FileTag; use Friendica\Model\GContact; use Friendica\Model\Profile; - -require_once 'boot.php'; -require_once 'include/dba.php'; +use Friendica\Util\Strings; +use Friendica\Util\XML; class Widget { @@ -45,7 +44,7 @@ class Widget */ public static function findPeople() { - $a = get_app(); + $a = \get_app(); $global_dir = Config::get('system', 'directory'); if (Config::get('system', 'invitation_only')) { @@ -138,7 +137,7 @@ class Widget $extra_sql = self::unavailableNetworks(); - $r = DBA::p("SELECT DISTINCT(`network`) FROM `contact` WHERE `uid` = ? AND `network` != '' $extra_sql ORDER BY `network`", + $r = DBA::p("SELECT DISTINCT(`network`) FROM `contact` WHERE `uid` = ? AND NOT `deleted` AND `network` != '' $extra_sql ORDER BY `network`", local_user() ); @@ -153,10 +152,10 @@ class Widget } return Renderer::replaceMacros(Renderer::getMarkupTemplate('nets.tpl'), array( - '$title' => L10n::t('Networks'), + '$title' => L10n::t('Protocols'), '$desc' => '', '$sel_all' => (($selected == '') ? 'selected' : ''), - '$all' => L10n::t('All Networks'), + '$all' => L10n::t('All Protocols'), '$nets' => $nets, '$base' => $baseurl, )); @@ -174,10 +173,6 @@ class Widget return ''; } - if (!Feature::isEnabled(local_user(), 'filing')) { - return ''; - } - $saved = PConfig::get(local_user(), 'system', 'filetags'); if (!strlen($saved)) { return; @@ -189,7 +184,7 @@ class Widget if ($cnt) { foreach ($matches as $mtch) { - $unescaped = xmlify(FileTag::decode($mtch[1])); + $unescaped = XML::escape(FileTag::decode($mtch[1])); $terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : '')); } } @@ -212,7 +207,7 @@ class Widget */ public static function categories($baseurl, $selected = '') { - $a = get_app(); + $a = \get_app(); if (!Feature::isEnabled($a->profile['profile_uid'], 'categories')) { return ''; @@ -229,7 +224,7 @@ class Widget if ($cnt) { foreach ($matches as $mtch) { - $unescaped = xmlify(FileTag::decode($mtch[1])); + $unescaped = XML::escape(FileTag::decode($mtch[1])); $terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : '')); } } @@ -269,11 +264,11 @@ class Widget if (!$cid) { if (Profile::getMyURL()) { $contact = DBA::selectFirst('contact', ['id'], - ['nurl' => normalise_link(Profile::getMyURL()), 'uid' => $profile_uid]); + ['nurl' => Strings::normaliseLink(Profile::getMyURL()), 'uid' => $profile_uid]); if (DBA::isResult($contact)) { $cid = $contact['id']; } else { - $gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(Profile::getMyURL())]); + $gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => Strings::normaliseLink(Profile::getMyURL())]); if (DBA::isResult($gcontact)) { $zcid = $gcontact['id']; } @@ -321,7 +316,7 @@ class Widget */ public static function tagCloud($limit = 50) { - $a = get_app(); + $a = \get_app(); if (!$a->profile['profile_uid'] || !$a->profile['url']) { return '';