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 
register_error($error)
Display an error on next page load.
Definition: elgglib.php:464
system_message($message)
Display a system message on next page load.
Definition: elgglib.php:450
const REFERER
Definition: elgglib.php:2123
forward($location="", $reason='system')
Forward to $location.
Definition: elgglib.php:94
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
elgg_get_river(array $options=array())
Get river items.
Definition: river.php:197
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$id
Elgg profile plugin edit default profile action removal.
Definition: delete.php:7
if(! $items) $item
Definition: delete.php:17
$items
Definition: delete.php:11