23 if (!
$entity->delete(
true,
false)) {
35 $referrer_url =
elgg_extract(
'HTTP_REFERER', $_SERVER,
'');
43 if ($container instanceof \
ElggUser) {
44 $route_name =
"collection:{$type}:{$subtype}:owner";
46 $route_name =
"collection:{$type}:{$subtype}:group";
49 if ($route_name && $routes->get($route_name)) {
50 $params = $routes->resolveRouteParameters($route_name, $container);
56 if ($container instanceof \ElggEntity) {
57 return $container->getURL();
73 }
elseif ($container instanceof \ElggEntity) {
79 "entity:delete:{$type}:{$subtype}:success",
80 "entity:delete:{$type}:success",
81 'entity:delete:success',
$params
Saves global plugin settings.
elgg_normalize_site_url(string $unsafe_url)
From untrusted input, get a site URL safe for forwarding.
elgg_ok_response($content= '', string|array $message= '', string $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof\ElggRelationship) elseif(is_callable([$item, 'getType']))
if(!$entity instanceof\ElggEntity) if(!$entity->canDelete()||!$entity->hasCapability('restorable')||$entity instanceof\ElggPlugin||$entity instanceof\ElggSite||$entity instanceof\ElggUser) $display_name
elgg_strlen()
Wrapper function for mb_strlen().
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_language_key_exists(string $key, string $language= 'en')
Check if a given language key exists.
elgg_error_response(string|array $message= '', string $forward_url=REFERRER, int $status_code=ELGG_HTTP_BAD_REQUEST)
Prepare an error response to be returned by a page or an action handler.
const REFERRER
Used in calls to forward() to specify the browser should be redirected to the referring page...
get_entity(int $guid)
Loads and returns an entity object from a guid.
elgg_strpos()
Wrapper function for mb_strpos().
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
elgg_substr()
Wrapper function for mb_substr().
$guid
Default entity trash action.
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
_elgg_services()
Get the global service provider.
if(!$entity->delete(true, false)) $forward_url
if(!empty($forward_url)) if(empty($forward_url)) $success_keys