Elgg  Version 4.3
default.php
Go to the documentation of this file.
1 <?php
6 $entity = elgg_extract('entity', $vars);
7 if (!$entity instanceof ElggEntity) {
8  return;
9 }
10 
11 $title = $entity->getDisplayName();
12 if (empty($title)) {
13  $title = strip_tags($entity->description ?? '');
15 }
16 
17 $permalink = htmlspecialchars($entity->getURL(), ENT_NOQUOTES, 'UTF-8');
18 $pubdate = date('r', $entity->getTimeCreated());
19 
21 
22 $creator = elgg_view('page/components/creator', $vars);
23 $georss = elgg_view('page/components/georss', $vars);
24 $extension = elgg_view('extensions/item', $vars);
25 
26 $item = <<<__HTML
27 <item>
28  <guid isPermaLink="true">$permalink</guid>
29  <pubDate>$pubdate</pubDate>
30  <link>$permalink</link>
31  <title><![CDATA[$title]]></title>
32  <description><![CDATA[$description]]></description>
34 </item>
35 
36 __HTML;
37 
38 echo $item;
$description
Definition: default.php:20
if(!$entity instanceof ElggEntity) $permalink
Definition: default.php:11
if(!$site) if(!($site instanceof ElggSite)) $site description
Definition: settings.php:20
$creator
Definition: default.php:23
elgg_autop($string)
Create paragraphs from text with line spacing.
Definition: output.php:56
$item
Definition: default.php:27
if(!array_key_exists($size, $icon_sizes)) $vars['size']
Definition: default.php:24
$georss
Definition: default.php:24
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:547
$entity
Generic icon view.
Definition: default.php:13
elgg_get_excerpt($text, $num_chars=250)
Returns an excerpt.
Definition: output.php:72
$title
Definition: default.php:28
elgg echo
Translates a string.
Definition: deprecated.js:530
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179
$pubdate
Definition: default.php:12
$extension
Definition: default.php:25