Elgg  Version master
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 = get_input('action')

Definition at line 12 of file unsubscribe.php.

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

Definition at line 9 of file unsubscribe.php.

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

Definition at line 27 of file unsubscribe.php.

$entity = get_entity($entity_guid)

Definition at line 17 of file unsubscribe.php.

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

Handle unsubscribing to an entity.

Definition at line 6 of file unsubscribe.php.

$forward_url = get_input('forward_url')

Definition at line 14 of file unsubscribe.php.

$message = ''

Definition at line 45 of file unsubscribe.php.

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

Definition at line 8 of file unsubscribe.php.

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

Definition at line 15 of file unsubscribe.php.

$subtype = get_input('subtype')

Definition at line 11 of file unsubscribe.php.

$type = get_input('type')

Definition at line 10 of file unsubscribe.php.

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

Definition at line 22 of file unsubscribe.php.

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

Definition at line 7 of file unsubscribe.php.

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',
]
$subtype
Definition: unsubscribe.php:11
if(!$user instanceof\ElggUser||!$user->canEdit()) $display_name
Definition: unsubscribe.php:27
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$action
Definition: unsubscribe.php:12
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
$methods
Definition: unsubscribe.php:8
$type
Definition: unsubscribe.php:10
if(!$entity->save()) $success_keys
$entity
Definition: unsubscribe.php:17

Definition at line 33 of file unsubscribe.php.