Elgg  Version 2.3
create.php
Go to the documentation of this file.
1 <?php
6 $item = $vars['item'];
7 /* @var ElggRiverItem $item */
8 
9 $comment = $item->getObjectEntity();
10 $subject = $item->getSubjectEntity();
11 $target = $item->getTargetEntity();
12 
13 $subject_link = elgg_view('output/url', array(
14  'href' => $subject->getURL(),
15  'text' => $subject->name,
16  'class' => 'elgg-river-subject',
17  'is_trusted' => true,
18 ));
19 
20 $target_link = elgg_view('output/url', array(
21  'href' => $comment->getURL(),
22  'text' => $target->getDisplayName(),
23  'class' => 'elgg-river-target',
24  'is_trusted' => true,
25 ));
26 
27 $type = $target->getType();
28 $subtype = $target->getSubtype() ? $target->getSubtype() : 'default';
29 $key = "river:comment:$type:$subtype";
31  $key = "river:comment:$type:default";
32 }
34 
35 echo elgg_view('river/elements/layout', array(
36  'item' => $vars['item'],
37  'message' => elgg_get_excerpt($comment->description),
38  'summary' => $summary,
39 
40  // truthy value to bypass responses rendering
41  'responses' => ' ',
42 ));
elgg_language_key_exists($key, $language= 'en')
Check if a given language key exists.
Definition: languages.php:133
$subject_link
Definition: create.php:13
$item
Post comment river view.
Definition: create.php:6
$key
Definition: create.php:29
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$vars['entity']
$target
Definition: create.php:11
$target_link
Definition: create.php:20
elgg echo
Translates a string.
Definition: languages.js:48
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
$type
Definition: create.php:27
$subtype
Definition: create.php:28
elgg_get_excerpt($text, $num_chars=250)
Returns an excerpt.
Definition: output.php:62
if(!elgg_language_key_exists($key)) $summary
Definition: create.php:33
$subject
Definition: create.php:10
$comment
Definition: create.php:9