Elgg  Version 3.0
generic_comment.php
Go to the documentation of this file.
1 <?php
9 $annotation = elgg_extract('annotation', $vars);
10 if (!$annotation instanceof ElggAnnotation) {
11  return;
12 }
13 
14 $poster = $annotation->getOwnerEntity();
15 $poster_name = htmlspecialchars($poster->getDisplayName(), ENT_NOQUOTES, 'UTF-8');
16 $pubdate = date('r', $annotation->getTimeCreated());
17 $permalink = $annotation->getURL();
18 
19 $title = elgg_echo('generic_comment:title', [$poster_name]);
20 
21 $creator = elgg_view('page/components/creator', ['entity' => $annotation]);
22 $extensions = elgg_view('extensions/item', $vars);
23 
24 $item = <<<__HTML
25 <item>
26  <guid isPermaLink='true'>$permalink</guid>
27  <pubDate>$pubdate</pubDate>
28  <link>$permalink</link>
29  <title><![CDATA[$title]]></title>
30  <description><![CDATA[{$annotation->value}]]></description>
32 </item>
33 
34 __HTML;
35 
36 echo $item;
$creator
$extensions
$permalink
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
if(!$site) if(!($site instanceof ElggSite)) $site description
$poster_name
elgg echo
Translates a string.
Definition: languages.js:43
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
$vars['type']
Definition: save.php:11
$annotation
$pubdate
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
if(!$annotation instanceof ElggAnnotation) $poster