Elgg  Version 6.2
Variables
save.php File Reference

Go to the source code of this file.

Variables

 $entity_guid = (int) get_input('entity_guid', 0, false)
 Action for adding and editing comments. More...
 
 $comment_guid = (int) get_input('comment_guid', 0, false)
 
 $comment_text = get_input('generic_comment')
 
if(empty($comment_text)) if($comment_guid) else
 
if(! $entity instanceof \ElggEntity) if(! $entity->canComment()) $comment = new \ElggComment()
 
$comment description = $comment_text
 
if($entity instanceof \ElggComment) $comment container_guid = $entity->guid
 
$comment access_id = $entity->access_id
 
if(! $comment->save()) if($comment->getLevel()===1) $success_message = elgg_echo('generic_comment:posted')
 
 $forward = $comment->getURL()
 
if(!empty($_SERVER['HTTP_REFERER'])) $result
 

Variable Documentation

◆ $comment

if (! $entity instanceof \ElggEntity) if (! $entity->canComment()) $comment = new \ElggComment()

Definition at line 42 of file save.php.

◆ $comment_guid

$comment_guid = (int) get_input('comment_guid', 0, false)

Definition at line 7 of file save.php.

◆ $comment_text

$comment_text = get_input('generic_comment')

Definition at line 8 of file save.php.

◆ $entity_guid

$entity_guid = (int) get_input('entity_guid', 0, false)

Action for adding and editing comments.

Definition at line 6 of file save.php.

◆ $forward

$forward = $comment->getURL()

Definition at line 75 of file save.php.

◆ $result

if (!empty( $_SERVER[ 'HTTP_REFERER'])) $result
Initial value:
= [
'guid' => $comment->guid,
'output' => elgg_view_entity($comment),
]
if(! $entity instanceof \ElggEntity) if(! $entity->canComment()) $comment
Definition: save.php:42
elgg_view_entity(\ElggEntity $entity, array $vars=[])
Returns a string of a rendered entity.
Definition: views.php:493

Definition at line 87 of file save.php.

◆ $success_message

if (! $comment->save()) if ( $comment->getLevel()===1) $success_message = elgg_echo('generic_comment:posted')

Definition at line 72 of file save.php.

◆ access_id

$comment access_id = $entity->access_id

Definition at line 55 of file save.php.

◆ container_guid

if ( $entity instanceof \ElggComment) $comment container_guid = $entity->guid

Definition at line 54 of file save.php.

◆ description

$comment description = $comment_text

Definition at line 43 of file save.php.

◆ else

if (empty( $comment_text)) if ( $comment_guid) else
Initial value:
{
$entity_guid
Action for adding and editing comments.
Definition: save.php:6
get_entity(int $guid)
Loads and returns an entity object from a guid.
Definition: entities.php:70
$entity
Definition: save.php:17

Definition at line 31 of file save.php.