Elgg  Version 1.9
comments.php
Go to the documentation of this file.
1 <?php
15 $show_add_form = elgg_extract('show_add_form', $vars, true);
16 $full_view = elgg_extract('full_view', $vars, true);
17 $limit = elgg_extract('limit', $vars, get_input('limit', 25));
18 
19 $id = '';
20 if (isset($vars['id'])) {
21  $id = "id=\"{$vars['id']}\"";
22 }
23 
24 $class = 'elgg-comments';
25 if (isset($vars['class'])) {
26  $class = "$class {$vars['class']}";
27 }
28 
29 // work around for deprecation code in elgg_view()
30 unset($vars['internalid']);
31 
32 echo "<div $id class=\"$class\">";
33 
35  'type' => 'object',
36  'subtype' => 'comment',
37  'container_guid' => $vars['entity']->getGUID(),
38  'reverse_order_by' => true,
39  'full_view' => true,
40  'limit' => $limit,
41 ));
42 
43 if ($html) {
44  echo '<h3 id="comments">' . elgg_echo('comments') . '</h3>';
45  echo $html;
46 }
47 
49  echo elgg_view_form('comment/save', array(), $vars);
50 }
51 
52 echo '</div>';
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1464
$limit
Definition: comments.php:17
$id
Definition: comments.php:19
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg echo
Translates a string.
Definition: languages.js:43
$html
Definition: comments.php:34
if(isset($vars['id'])) $class
Definition: comments.php:24
elgg_list_entities(array $options=array(), $getter= 'elgg_get_entities', $viewer= 'elgg_view_entity_list')
Returns a string of rendered entities.
Definition: entities.php:1343
$full_view
Definition: comments.php:16
$show_add_form
List comments with optional add form.
Definition: comments.php:15
elgg_view_form($action, $form_vars=array(), $body_vars=array())
Definition: views.php:1280
if(file_exists($welcome)) $vars
Definition: upgrade.php:93