Elgg  Version master
edit.php
Go to the documentation of this file.
1 <?php
2 
5 
6 $guid = (int) elgg_extract('guid', $vars);
7 
9 if (!$comment instanceof \ElggComment || !$comment->canEdit()) {
10  throw new EntityPermissionsException(elgg_echo('generic_comment:notfound'));
11 }
12 
13 $target = $comment->getContainerEntity();
14 if (!$target instanceof \ElggEntity) {
15  throw new EntityNotFoundException(elgg_echo('generic_comment:notfound'));
16 }
17 
19 
20 echo elgg_view_page(elgg_echo('generic_comments:edit'), [
21  'content' => elgg_view_form('comment/save', [], [
22  'entity' => $target,
23  'comment' => $comment,
24  ]),
25  'filter_id' => 'comment/edit',
26 ]);
elgg_push_breadcrumb(string $text, string|false $href=false)
Breadcrumbs.
Definition: breadcrumbs.php:16
if(!$comment instanceof\ElggComment||!$comment->canEdit()) $target
Definition: edit.php:13
elgg_view_form(string $action, array $form_vars=[], array $body_vars=[])
Definition: views.php:1054
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
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:254
get_entity(int $guid)
Loads and returns an entity object from a guid.
Definition: entities.php:67
Thrown when entity can not be edited or container permissions do not allow it to be written...
elgg_view_page(string $title, string|array $body, string $page_shell= 'default', array $vars=[])
Assembles and outputs a full page.
Definition: views.php:256
getDisplayName()
{}
Definition: ElggObject.php:38
$comment
Definition: edit.php:8
Aggregate action for saving settings.
$vars['head']
Definition: html.php:24
$guid
Definition: edit.php:6
getURL()
Gets the URL for this entity.