Elgg  Version master
Variables
comments.php File Reference

Go to the source code of this file.

Variables

 $entity = elgg_extract('entity', $vars)
 
if(! $entity instanceof \ElggEntity$show_add_form = elgg_extract('show_add_form', $vars, true)
 
 $latest_first = elgg_comments_are_latest_first($entity)
 
 $limit = elgg_extract('limit', $vars, get_input('limit'))
 
if(!isset($limit)) $module_vars
 
 $options
 
 $module_title = ''
 
if(! $entity instanceof \ElggCommentelse
 
 $options ['limit'] = false
 
 $options ['offset'] = 0
 
 $options ['pagination'] = false
 
 $options ['count'] = count($comments)
 
 $module_vars ['header'] = false
 
 $comments_list = elgg_view_entity_list($comments, $options)
 
 $content = $comments_list
 
 $form = ''
 
 $show_login_form = $comments_list ? $show_add_form : false
 
 if (empty( $content))
 

Variable Documentation

◆ $comments_list

$comments_list = elgg_view_entity_list($comments, $options)

Definition at line 96 of file comments.php.

◆ $content

$content = $comments_list

Definition at line 98 of file comments.php.

◆ $entity

$entity = elgg_extract('entity', $vars)

Definition at line 16 of file comments.php.

◆ $form

$form = ''

Definition at line 99 of file comments.php.

◆ $latest_first

$latest_first = elgg_comments_are_latest_first($entity)

Definition at line 23 of file comments.php.

◆ $limit

$limit = elgg_extract('limit', $vars, get_input('limit'))

Definition at line 25 of file comments.php.

◆ $module_title

$module_title = ''

Definition at line 50 of file comments.php.

◆ $module_vars [1/2]

if (!isset( $limit)) $module_vars
Initial value:
= [
'id' => elgg_extract('id', $vars, 'comments'),
'class' => elgg_extract_class($vars, 'elgg-comments'),
]
$vars
Definition: theme.php:5
elgg_extract_class(array $array, array|string $existing=[], string $extract_key='class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:279
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:256

Definition at line 30 of file comments.php.

◆ $module_vars [2/2]

$module_vars[ 'header'] = false

Definition at line 93 of file comments.php.

◆ $options [1/5]

$options
Initial value:
= [
'type' => 'object',
'subtype' => 'comment',
'container_guid' => $entity->guid,
'full_view' => true,
'limit' => $limit,
'offset' => (int) get_input('offset'),
'distinct' => false,
'url_fragment' => $module_vars['id'],
'order_by' => [new OrderByClause('e.guid', $latest_first ? 'DESC' : 'ASC')],
'list_class' => 'comments-list',
'pagination' => true,
'preload_owners' => true,
]
Extends QueryBuilder with ORDER BY clauses.
$latest_first
Definition: comments.php:23
$entity
Definition: comments.php:16
if(!isset($limit)) $module_vars
Definition: comments.php:30
$limit
Definition: comments.php:25
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition: input.php:20

Definition at line 35 of file comments.php.

◆ $options [2/5]

$options[ 'count'] = count($comments)

Definition at line 91 of file comments.php.

◆ $options [3/5]

$options[ 'limit'] = false

Definition at line 88 of file comments.php.

◆ $options [4/5]

$options[ 'offset'] = 0

Definition at line 89 of file comments.php.

◆ $options [5/5]

$options[ 'pagination'] = false

Definition at line 90 of file comments.php.

◆ $show_add_form

if (! $entity instanceof \ElggEntity) $show_add_form = elgg_extract('show_add_form', $vars, true)

Definition at line 21 of file comments.php.

◆ $show_login_form

$show_login_form = $comments_list ? $show_add_form : false

Definition at line 101 of file comments.php.

◆ else

if ( $show_add_form &&$entity->canComment()) elseif (!elgg_is_logged_in() &&$show_login_form) if ( $latest_first||$entity instanceof \ElggComment) else
Initial value:
{
$comments = elgg()->thread_preloader->getChildren($entity->guid)
if($owner_guid) if($container_guid) if($subtypes) $comments
elgg()
Bootstrapping and helper procedural code available for use in Elgg core and plugins.
Definition: elgglib.php:12

Definition at line 84 of file comments.php.

◆ if

if(empty($content)) ( empty( $content)  )

Definition at line 166 of file comments.php.