Elgg  Version 2.3
delete.php
Go to the documentation of this file.
1 <?php
9 $id = (int)get_input('id');
10 
11 $items = elgg_get_river(['id' => $id]);
12 if (!$items) {
13  register_error(elgg_echo('river:delete:fail'));
15 }
16 
18 if (!$item->canDelete()) {
19  register_error(elgg_echo('river:delete:lack_permission'));
21 }
22 
23 if ($item->delete()) {
24  system_message(elgg_echo('river:delete:success'));
25 } else {
26  register_error(elgg_echo('river:delete:fail'));
27 }
28 
if(!$items) $item
Definition: delete.php:17
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$items
Definition: delete.php:11
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:425
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
const REFERER
Definition: elgglib.php:2123
$id
Elgg profile plugin edit default profile action removal.
Definition: delete.php:7
elgg system_message
Wrapper function for system_messages.
Definition: elgglib.js:390
elgg_get_river(array $options=array())
Get river items.
Definition: river.php:197
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:399