Elgg  Version 3.0
default.php
Go to the documentation of this file.
1 <?php
9 $entity = elgg_extract('entity', $vars);
10 if (!$entity instanceof ElggEntity) {
11  return;
12 }
13 
14 $permalink = htmlspecialchars($entity->getURL(), ENT_NOQUOTES, 'UTF-8');
15 $pubdate = date('r', $entity->getTimeCreated());
16 $title = htmlspecialchars($entity->getDisplayName(), ENT_NOQUOTES, 'UTF-8');
17 
18 if ($entity->description) {
19  $description = elgg_autop($entity->description);
20 } elseif ($entity->briefdescription) {
21  $description = elgg_autop($entity->briefdescription);
22 } else {
23  $description = '';
24 }
25 
26 $creator = elgg_view('page/components/creator', $vars);
27 $georss = elgg_view('page/components/georss', $vars);
28 $extension = elgg_view('extensions/item', $vars);
29 
30 $item = <<<__HTML
31 <item>
32  <guid isPermaLink="true">$permalink</guid>
33  <pubDate>$pubdate</pubDate>
34  <link>$permalink</link>
35  <title><![CDATA[$title]]></title>
36  <description><![CDATA[$description]]></description>
38 </item>
39 
40 __HTML;
41 
42 echo $item;
$description
Definition: default.php:23
if(!$entity instanceof ElggEntity) $permalink
Definition: default.php:14
$creator
Definition: default.php:26
if(!$site) if(!($site instanceof ElggSite)) $site description
elgg_autop($string)
Create paragraphs from text with line spacing.
Definition: output.php:58
elgg echo
Translates a string.
Definition: languages.js:43
$item
Definition: default.php:30
if(!array_key_exists($size, $icon_sizes)) $vars['size']
Definition: default.php:27
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif(is_callable([$item, 'getType']))
Definition: item.php:39
$georss
Definition: default.php:27
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
$entity
Definition: default.php:16
$title
Definition: default.php:31
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
$pubdate
Definition: default.php:15
$extension
Definition: default.php:28