25 if (!
$entity->delete(
true,
true)) {
37 $referrer_url =
elgg_extract(
'HTTP_REFERER', $_SERVER,
'');
45 if ($container instanceof \
ElggUser) {
46 $route_name =
"collection:{$type}:{$subtype}:owner";
48 $route_name =
"collection:{$type}:{$subtype}:group";
51 if ($route_name && $routes->get($route_name)) {
52 $params = $routes->resolveRouteParameters($route_name, $container);
58 if ($container instanceof \ElggEntity) {
59 return $container->getURL();
75 }
elseif ($container instanceof \ElggEntity) {
81 "entity:delete:{$type}:{$subtype}:success",
82 "entity:delete:{$type}:success",
83 'entity:delete:success',
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
$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']))
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...
const ELGG_SHOW_DISABLED_ENTITIES
get_entity(int $guid)
Loads and returns an entity object from a guid.
elgg_strpos()
Wrapper function for mb_strpos().
if(!$entity->delete(true, true)) $forward_url
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
const ELGG_SHOW_DELETED_ENTITIES
if(!$entity instanceof\ElggEntity) if(!$entity->canDelete()||$entity instanceof\ElggPlugin||$entity instanceof\ElggSite||$entity instanceof\ElggUser) $display_name
elgg_substr()
Wrapper function for mb_substr().
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
_elgg_services()
Get the global service provider.
if(!empty($forward_url)) if(empty($forward_url)) $success_keys