Elgg  Version 5.1
Go to the documentation of this file.
1 <?php
6 elgg_deprecated_notice('The resource "comments/edit" is deprecated. Do not use this view.', '5.1');
8 $guid = (int) elgg_extract('guid', $vars);
11 if (!$comment instanceof \ElggComment || !$comment->canEdit()) {
12  throw new EntityPermissionsException(elgg_echo('generic_comment:notfound'));
13 }
15 $target = $comment->getContainerEntity();
16 if (!$target instanceof \ElggEntity) {
17  throw new EntityNotFoundException(elgg_echo('generic_comment:notfound'));
18 }
22 echo elgg_view_page(elgg_echo('generic_comments:edit'), [
23  'content' => elgg_view_form('comment/save', [], [
24  'entity' => $target,
25  'comment' => $comment,
26  ]),
27  'filter_id' => 'comment/edit',
28 ]);
if(!$comment instanceof\ElggComment||!$comment->canEdit()) $target
Definition: edit.php:15
elgg_view_form(string $action, array $form_vars=[], array $body_vars=[])
Definition: views.php:1054
elgg_deprecated_notice(string $msg, string $dep_version)
Log a notice about deprecated use of a function, view, etc.
Definition: elgglib.php:115
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
elgg_push_entity_breadcrumbs(\ElggEntity $entity, bool $link_self=null)
Resolves and pushes entity breadcrumbs based on named routes.
Definition: breadcrumbs.php:34
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
Definition: theme.php:5
Definition: edit.php:10
Aggregate action for saving settings.
Definition: edit.php:8