Elgg  Version 3.0
edit.php
Go to the documentation of this file.
1 <?php
2 
3 $guid = elgg_extract('guid', $vars);
4 
6 
7 if (!$guid) {
8  register_error(elgg_echo('generic_comment:notfound'));
10 }
12 if (!($comment instanceof \ElggComment) || !$comment->canEdit()) {
13  register_error(elgg_echo('generic_comment:notfound'));
15 }
16 
17 $target = $comment->getContainerEntity();
18 if (!($target instanceof \ElggEntity)) {
19  register_error(elgg_echo('generic_comment:notfound'));
21 }
22 
23 $title = elgg_echo('generic_comments:edit');
26 
28  'entity' => $target,
29  'comment' => $comment,
30 ];
31 $content = elgg_view_form('comment/save', null, $params);
32 
33 $params = [
34  'content' => $content,
35  'title' => $title,
36  'filter' => '',
37 ];
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:417
if($entity->hasIcon('master')) $body
Definition: edit.php:27
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_push_breadcrumb($text, $href=false)
Adds a breadcrumb to the breadcrumbs stack.
Definition: navigation.php:298
elgg_view_page($title, $body, $page_shell= 'default', $vars=[])
Assembles and outputs a full page.
Definition: views.php:360
if(!$guid) $comment
Definition: edit.php:11
elgg_gatekeeper()
Used at the top of a page to mark it as logged in users only.
$title
Definition: edit.php:16
elgg_view_form($action, $form_vars=[], $body_vars=[])
Definition: views.php:1318
if(!($comment instanceof\ElggComment)||!$comment->canEdit()) $target
Definition: edit.php:17
elgg echo
Translates a string.
Definition: languages.js:43
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:1131
$params
Definition: edit.php:27
const REFERER
Definition: constants.php:52
getDisplayName()
{}
Definition: ElggObject.php:38
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:391
elgg_view_layout($layout_name, $vars=[])
Displays a layout with optional parameters.
Definition: views.php:593
$content
Definition: edit.php:20
$vars['type']
Definition: save.php:11
$guid
Definition: edit.php:3
getURL()
Gets the URL for this entity.
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:87