<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
// Only add will be displayed
if ($item['network'] === Protocol::MAIL && local_user() != $item['uid']) {
continue;
- } elseif (!visible_activity($item)) {
+ } elseif (!DI::contentItem()->visibleActivity($item)) {
continue;
}
*/
public function getTemplateData(array $conv_responses, string $formSecurityToken, $thread_level = 1)
{
- $a = DI::app();
-
$item = $this->getData();
$edited = false;
// If the time between "created" and "edited" differs we add
? DI::l10n()->t('Private Message')
: false);
+ $connector = !$item['global'] ? DI::l10n()->t('Connector Message') : false;
+
$shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != Item::PRIVATE;
$announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::TWITTER]);
foreach ($response_verbs as $value => $verb) {
$responses[$verb] = [
'self' => $conv_responses[$verb][$item['uri-id']]['self'] ?? 0,
- 'output' => !empty($conv_responses[$verb][$item['uri-id']]) ? format_activity($conv_responses[$verb][$item['uri-id']]['links'], $verb, $item['uri-id']) : '',
+ 'output' => !empty($conv_responses[$verb][$item['uri-id']]) ? DI::conversation()->formatActivity($conv_responses[$verb][$item['uri-id']]['links'], $verb, $item['uri-id']) : '',
];
}
$shiny = 'shiny';
}
- localize_item($item);
+ DI::contentItem()->localize($item);
$body_html = Item::prepareBody($item, true);
'vwall' => DI::l10n()->t('via Wall-To-Wall:'),
'profile_url' => $profile_link,
'name' => $profile_name,
- 'item_photo_menu_html' => item_photo_menu($item, $formSecurityToken),
+ 'item_photo_menu_html' => DI::contentItem()->photoMenu($item, $formSecurityToken),
'thumb' => DI::baseUrl()->remove(Contact::getAvatarUrlForUrl($item['author-link'], $item['uid'], Proxy::SIZE_THUMB)),
'osparkle' => $osparkle,
'sparkle' => $sparkle,
'app' => $item['app'],
'created' => $ago,
'lock' => $lock,
+ 'connector' => $connector,
'location_html' => $location_html,
'indent' => $indent,
'shiny' => $shiny,
'owner_photo' => DI::baseUrl()->remove(Contact::getAvatarUrlForUrl($item['owner-link'], $item['uid'], Proxy::SIZE_THUMB)),
'owner_name' => $this->getOwnerName(),
'plink' => Item::getPlink($item),
+ 'browsershare' => DI::l10n()->t('Share'),
'edpost' => $edpost,
'ispinned' => $ispinned,
'pin' => $pin,
{
$item_id = $item->getId();
if (!$item_id) {
- Logger::log('[ERROR] Post::addChild : Item has no ID!!', Logger::DEBUG);
+ Logger::info('[ERROR] Post::addChild : Item has no ID!!');
return false;
} elseif ($this->getChild($item->getId())) {
- Logger::log('[WARN] Post::addChild : Item already exists (' . $item->getId() . ').', Logger::DEBUG);
+ Logger::info('[WARN] Post::addChild : Item already exists (' . $item->getId() . ').');
return false;
}
return true;
}
}
- Logger::log('[WARN] Item::removeChild : Item is not a child (' . $id . ').', Logger::DEBUG);
+ Logger::info('[WARN] Item::removeChild : Item is not a child (' . $id . ').');
return false;
}
public function getDataValue($name)
{
if (!isset($this->data[$name])) {
- // Logger::log('[ERROR] Item::getDataValue : Item has no value name "'. $name .'".', Logger::DEBUG);
+ // Logger::info('[ERROR] Item::getDataValue : Item has no value name "'. $name .'".');
return false;
}
private function setTemplate($name)
{
if (empty($this->available_templates[$name])) {
- Logger::log('[ERROR] Item::setTemplate : Template not available ("' . $name . '").', Logger::DEBUG);
+ Logger::info('[ERROR] Item::setTemplate : Template not available ("' . $name . '").');
return false;
}