Elgg  Version 6.2
Variables
unsubscribe.php File Reference

Go to the source code of this file.

Variables

 $entity_guid = (int) get_input('guid')
 Handle unsubscribing to an entity. More...
 
 $user_guid = (int) get_input('user_guid', elgg_get_logged_in_user_guid())
 
 $methods = (array) get_input('methods', [])
 
 $all_subscriptions = (bool) get_input('all')
 
 $type = get_input('type')
 
 $subtype = get_input('subtype')
 
 $action = get_input('action')
 
 $forward_url = get_input('forward_url')
 
 $show_success = (bool) get_input('show_success', true)
 
 $entity = get_entity($entity_guid)
 
if(! $entity instanceof \ElggEntity$user = get_user($user_guid)
 
if(! $user instanceof \ElggUser||! $user->canEdit()) $display_name = $entity->getDisplayName() ?: elgg_echo('item')
 
if($all_subscriptions) else
 
 $message = ''
 

Variable Documentation

◆ $action

$action = get_input('action')

Definition at line 12 of file unsubscribe.php.

◆ $all_subscriptions

$all_subscriptions = (bool) get_input('all')

Definition at line 9 of file unsubscribe.php.

◆ $display_name

if (! $user instanceof \ElggUser||! $user->canEdit()) $display_name = $entity->getDisplayName() ?: elgg_echo('item')

Definition at line 27 of file unsubscribe.php.

◆ $entity

$entity = get_entity($entity_guid)

Definition at line 17 of file unsubscribe.php.

◆ $entity_guid

$entity_guid = (int) get_input('guid')

Handle unsubscribing to an entity.

Definition at line 6 of file unsubscribe.php.

◆ $forward_url

$forward_url = get_input('forward_url')

Definition at line 14 of file unsubscribe.php.

◆ $message

$message = ''

Definition at line 45 of file unsubscribe.php.

◆ $methods

$methods = (array) get_input('methods', [])

Definition at line 8 of file unsubscribe.php.

◆ $show_success

$show_success = (bool) get_input('show_success', true)

Definition at line 15 of file unsubscribe.php.

◆ $subtype

$subtype = get_input('subtype')

Definition at line 11 of file unsubscribe.php.

◆ $type

$type = get_input('type')

Definition at line 10 of file unsubscribe.php.

◆ $user

if (! $entity instanceof \ElggEntity) $user = get_user($user_guid)

Definition at line 22 of file unsubscribe.php.

◆ $user_guid

$user_guid = (int) get_input('user_guid', elgg_get_logged_in_user_guid())

Definition at line 7 of file unsubscribe.php.

◆ else

if ( $all_subscriptions) else
Initial value:
{
if (!$entity->removeSubscription($user->guid, $methods, $type, $subtype, $action)) {
return elgg_error_response(elgg_echo('entity:unsubscribe:fail', [$display_name]));
}
}
"entity:unsubscribe:{$entity->type}:{$entity->subtype}:success",
"entity:unsubscribe:{$entity->type}:success",
'entity:unsubscribe:success',
]
if(! $entity->save()) $success_keys
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
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.
if(! $entity instanceof \ElggEntity) $user
Definition: unsubscribe.php:22
$subtype
Definition: unsubscribe.php:11
$entity
Definition: unsubscribe.php:17
$methods
Definition: unsubscribe.php:8
$type
Definition: unsubscribe.php:10
$action
Definition: unsubscribe.php:12
if(! $user instanceof \ElggUser||! $user->canEdit()) $display_name
Definition: unsubscribe.php:27

Definition at line 33 of file unsubscribe.php.