Elgg  Version 6.0
layout.php
Go to the documentation of this file.
1 <?php
8 $item = elgg_extract('item', $vars);
9 if (!$item instanceof ElggRiverItem) {
10  return;
11 }
12 
13 $name = $item->getSubjectEntity()->getDisplayName() ?? '';
14 $name = htmlspecialchars($name, ENT_NOQUOTES, 'UTF-8');
15 $title = elgg_echo('river:update', [$name]);
16 
17 $timestamp = date('r', $item->getTimePosted());
18 
19 $summary = elgg_view('river/elements/summary', $vars, 'default');
21 
23 
24 $object = $item->getObjectEntity();
25 if ($object) {
26  $url = htmlspecialchars($object->getURL());
27 } else {
28  $url = elgg_generate_url('default:river') ?: '';
29 }
30 
32 $domain = htmlspecialchars($site_url['host'], ENT_NOQUOTES, 'UTF-8');
33 $path = '';
34 if ($site_url['path']) {
35  $path = htmlspecialchars($site_url['path'], ENT_NOQUOTES, 'UTF-8');
36  $path = "::{$path}";
37 }
38 
39 ?>
40 <guid isPermaLink="false"><?php echo "{$domain}{$path}::river::{$item->id}"; ?></guid>
41 <pubDate><?= $timestamp; ?></pubDate>
42 <link><?= $url; ?></link>
43 <title><![CDATA[<?= $title; ?>}]]></title>
44 <description><![CDATA[<?= $body; ?>}]]></description>
if(!$item instanceof ElggRiverItem) $name
Definition: layout.php:13
$object
Definition: layout.php:24
$summary
Definition: layout.php:19
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$body
Definition: layout.php:22
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
$item
Layout of a river item.
Definition: layout.php:8
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
$path
Definition: layout.php:33
$timestamp
Definition: layout.php:17
$site description
Definition: settings.php:14
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
$title
Definition: layout.php:15
$site_url
Definition: layout.php:31
$vars
Definition: theme.php:5
$domain
Definition: layout.php:32
foreach($plugin_guids as $guid) if(empty($deactivated_plugins)) $url
Definition: deactivate.php:39
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
elgg_strip_tags(string $string, string $allowable_tags=null)
Strip tags and offer plugins the chance.
Definition: output.php:323