Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
layout.php
Go to the documentation of this file.
1 <?php
7 $item = $vars['item'];
8 
9 $name = $item->getSubjectEntity()->name;
10 $name = htmlspecialchars($name, ENT_NOQUOTES, 'UTF-8');
11 $title = elgg_echo('river:update', array($name));
12 
13 $timestamp = date('r', $item->getTimePosted());
14 $summary = elgg_view('river/elements/summary', $vars, false, false, 'default');
16 
17 
18 $object = $item->getObjectEntity();
19 if ($object) {
20  $url = htmlspecialchars($object->getURL());
21 } else {
22  $url = elgg_normalize_url('activity');
23 }
24 
26 $domain = htmlspecialchars($site_url['host'], ENT_NOQUOTES, 'UTF-8');
27 $path = '';
28 if ($site_url['path']) {
29  $path = htmlspecialchars($site_url['path'], ENT_NOQUOTES, 'UTF-8');
30  $path = "::$path";
31 }
32 
33 $html = <<<__HTML
34  <guid isPermaLink="false">$domain$path::river::$item->id</guid>
35  <pubDate>$timestamp</pubDate>
36  <link>$url</link>
37  <title><![CDATA[$title]]></title>
38  <description><![CDATA[$body]]></description>
39 __HTML;
40 
41 echo $html;
$name
Definition: layout.php:9
elgg_normalize_url($url)
Definition: output.php:290
$object
Definition: layout.php:18
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$summary
Definition: layout.php:14
if($site_url['path']) $html
Definition: layout.php:33
$url
Definition: exceptions.php:24
$vars['entity']
$body
Definition: layout.php:15
$item
Layout of a river item.
Definition: layout.php:8
if(!$site) if(!($site instanceof ElggSite)) $site description
$path
Definition: layout.php:27
$timestamp
Definition: layout.php:13
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:342
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
$title
Definition: layout.php:11
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:1310
$site_url
Definition: layout.php:25
$domain
Definition: layout.php:26