Elgg  Version 3.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_normalize_url('activity');
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 $html = <<<__HTML
40  <guid isPermaLink="false">$domain$path::river::$item->id</guid>
41  <pubDate>$timestamp</pubDate>
42  <link>$url</link>
43  <title><![CDATA[$title]]></title>
44  <description><![CDATA[$body]]></description>
45 __HTML;
46 
47 echo $html;
if(!$item instanceof ElggRiverItem) $name
Definition: layout.php:13
elgg_normalize_url($url)
Definition: output.php:186
$object
Definition: layout.php:24
elgg_strip_tags($string, $allowable_tags=null)
Strip tags and offer plugins the chance.
Definition: output.php:388
$summary
Definition: layout.php:19
elgg parse_url
Parse a URL into its parts.
Definition: elgglib.js:442
if($site_url['path']) $html
Definition: layout.php:39
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$body
Definition: layout.php:22
$item
Layout of a river item.
Definition: layout.php:8
if(!$site) if(!($site instanceof ElggSite)) $site description
$path
Definition: layout.php:33
$timestamp
Definition: layout.php:17
elgg echo
Translates a string.
Definition: languages.js:43
$url
Definition: default.php:33
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
$title
Definition: layout.php:15
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1131
$site_url
Definition: layout.php:31
$domain
Definition: layout.php:32
$vars['type']
Definition: save.php:11
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246