Elgg
Version 1.11
actions
widgets
delete.php
Go to the documentation of this file.
1
<?php
9
$widget
=
get_entity
(
get_input
(
'widget_guid'
));
10
if
(
$widget
) {
11
$layout_owner_guid =
$widget
->getContainerGUID();
12
elgg_set_page_owner_guid
($layout_owner_guid);
13
if
(
elgg_can_edit_widget_layout
(
$widget
->context) &&
$widget
->delete()) {
14
forward
(
REFERER
);
15
}
16
}
17
18
register_error
(
elgg_echo
(
'widgets:remove:failure'
));
19
forward
(
REFERER
);
register_error
register_error($error)
Display an error on next page load.
Definition:
elgglib.php:455
REFERER
const REFERER
Definition:
elgglib.php:1995
forward
forward($location="", $reason='system')
Forward to $location.
Definition:
elgglib.php:80
elgg_echo
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition:
languages.php:21
elgg_can_edit_widget_layout
elgg_can_edit_widget_layout($context, $user_guid=0)
Can the user edit the widget layout.
Definition:
widgets.php:53
get_entity
get_entity($guid)
Loads and returns an entity object from a guid.
Definition:
entities.php:382
get_input
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition:
input.php:27
elgg_set_page_owner_guid
elgg_set_page_owner_guid($guid)
Set the guid of the entity that owns this page.
Definition:
pageowner.php:73
$widget
$widget
Definition:
delete.php:9
Generated on Fri Aug 29 2025 00:00:37 for Elgg by
1.9.1