mirror of
https://github.com/friendica/friendica
synced 2025-04-28 19:04:22 +02:00
New parameter to create a share block for display reasons
This commit is contained in:
parent
e95c678141
commit
b9bb525fe9
2 changed files with 6 additions and 4 deletions
|
@ -669,14 +669,16 @@ class Item
|
|||
* Add a share block for the given item array
|
||||
*
|
||||
* @param array $item
|
||||
* @param bool $add_media
|
||||
* @param bool $add_media true = Media is added to the body
|
||||
* @param bool $for_display true = The share block is used for display puposes, false = used for connectors, transport to other systems, ...
|
||||
* @return string
|
||||
*/
|
||||
public function createSharedBlockByArray(array $item, bool $add_media = false): string
|
||||
public function createSharedBlockByArray(array $item, bool $add_media = false, bool $for_display = false): string
|
||||
{
|
||||
if ($item['network'] == Protocol::FEED) {
|
||||
return PageInfo::getFooterFromUrl($item['plink']);
|
||||
} elseif (!in_array($item['network'] ?? '', Protocol::FEDERATED)) {
|
||||
} elseif (!in_array($item['network'] ?? '', Protocol::FEDERATED) && !$for_display) {
|
||||
$item['guid'] = '';
|
||||
$item['uri'] = '';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue