<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
-use Friendica\Model\Group;
+use Friendica\Model\Circle;
use Friendica\Model\Item;
use Friendica\Model\Post;
use Friendica\Model\Profile;
/**
* Return Find People widget
*
- * @return string HTML code respresenting "People Widget"
+ * @return string HTML code representing "People Widget"
*/
public static function findPeople(): string
{
$networks[] = Protocol::TWITTER;
}
+ if (!Addon::isEnabled("tumblr")) {
+ $networks[] = Protocol::TUMBLR;
+ }
+
if (DI::config()->get("system", "ostatus_disabled")) {
$networks[] = Protocol::OSTATUS;
}
$baseUrl = trim($baseUrl, '?') . '?';
}
+ array_walk($options, function (&$value) {
+ $value['ref'] = rawurlencode($value['ref']);
+ });
+
return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/filter.tpl'), [
'$type' => $type,
'$title' => $title,
}
/**
- * Return group membership widget
+ * Return circle membership widget
*
* @param string $baseurl
* @param string $selected
* @return string
* @throws \Exception
*/
- public static function groups(string $baseurl, string $selected = ''): string
+ public static function circles(string $baseurl, string $selected = ''): string
{
if (!DI::userSession()->getLocalUserId()) {
return '';
}
- $options = array_map(function ($group) {
+ $options = array_map(function ($circle) {
return [
- 'ref' => $group['id'],
- 'name' => $group['name']
+ 'ref' => $circle['id'],
+ 'name' => $circle['name']
];
- }, Group::getByUserId(DI::userSession()->getLocalUserId()));
+ }, Circle::getByUserId(DI::userSession()->getLocalUserId()));
return self::filter(
- 'group',
- DI::l10n()->t('Groups'),
+ 'circle',
+ DI::l10n()->t('Circles'),
'',
DI::l10n()->t('Everyone'),
$baseurl,
return '';
}
- $visitorPCid = DI::userSession()->getLocalUserId() ? Contact::getPublicIdByUserId(DI::userSession()->getLocalUserId()) : DI::userSession()->getRemoteUserId();
+ $visitorPCid = DI::userSession()->getPublicContactId() ?: DI::userSession()->getRemoteUserId();
if (!$visitorPCid) {
return '';
}