Elgg  Version 2.3
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 
27 $params = array(
28  'entity' => $target,
29  'comment' => $comment,
30 );
31 $content = elgg_view_form('comment/save', null, $params);
32 
33 $params = array(
34  'content' => $content,
35  'title' => $title,
36  'filter' => '',
37 );
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_view_form($action, $form_vars=array(), $body_vars=array())
Definition: views.php:1345
if(!$guid) $comment
Definition: edit.php:11
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
Definition: views.php:689
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:425
if(!elgg_instanceof($entity, 'user')||!$entity->canEdit()) $content
Definition: edit.php:20
$vars['entity']
elgg_gatekeeper()
Used at the top of a page to mark it as logged in users only.
Definition: pagehandler.php:58
if(!($comment instanceof\ElggComment)||!$comment->canEdit()) $target
Definition: edit.php:17
const REFERER
Definition: elgglib.php:2123
elgg echo
Translates a string.
Definition: languages.js:48
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:1375
$guid
Definition: edit.php:9
$body
Definition: edit.php:31
$title
Definition: edit.php:12
getDisplayName()
{}
Definition: ElggObject.php:179
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:399
if($entity->hasIcon('master')) $params
Definition: edit.php:27
getURL()
Gets the URL for this entity.
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:204
elgg_view_page($title, $body, $page_shell= 'default', $vars=array())
Assembles and outputs a full page.
Definition: views.php:447