Elgg  Version 4.3
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 ]);
if(!$comment instanceof\ElggComment||!$comment->canEdit()) $target
Definition: edit.php:13
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
elgg_view_page($title, $body, $page_shell= 'default', $vars=[])
Assembles and outputs a full page.
Definition: views.php:262
Thrown when entity can not be edited or container permissions do not allow it to be written...
elgg_view_form($action, $form_vars=[], $body_vars=[])
Definition: views.php:1064
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:547
getDisplayName()
{}
Definition: ElggObject.php:38
$comment
Definition: edit.php:8
Aggregate action for saving settings.
elgg echo
Translates a string.
Definition: deprecated.js:530
$vars['head']
Definition: html.php:24
elgg_push_breadcrumb($text, $href=false)
Breadcrumbs Elgg uses a breadcrumb stack.
Definition: breadcrumbs.php:21
$guid
Definition: edit.php:6
getURL()
Gets the URL for this entity.
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:69