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 $permalink = htmlspecialchars($entity->getURL(), ENT_NOQUOTES, 'UTF-8');
12 $pubdate = date('r', $entity->getTimeCreated());
13 $title = htmlspecialchars($entity->getDisplayName() ?? '', ENT_NOQUOTES, 'UTF-8');
14 
15 if ($entity->description) {
16  $description = elgg_autop($entity->description);
17 } elseif ($entity->briefdescription) {
18  $description = elgg_autop($entity->briefdescription);
19 } else {
20  $description = '';
21 }
22 
23 $creator = elgg_view('page/components/creator', $vars);
24 $georss = elgg_view('page/components/georss', $vars);
25 $extension = elgg_view('extensions/item', $vars);
26 
27 $item = <<<__HTML
28 <item>
29  <guid isPermaLink="true">$permalink</guid>
30  <pubDate>$pubdate</pubDate>
31  <link>$permalink</link>
32  <title><![CDATA[$title]]></title>
33  <description><![CDATA[$description]]></description>
35 </item>
36 
37 __HTML;
38 
39 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
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof ElggRelationship) elseif(is_callable([$item, 'getType']))
Definition: item.php:48
$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