Elgg  Version master
mute.php
Go to the documentation of this file.
1 <?php
11 
12 $entity_guid = (int) elgg_extract('entity_guid', $vars);
14  throw new EntityNotFoundException();
15 }
16 
17 $recipient_guid = (int) elgg_extract('recipient_guid', $vars);
19 
21 
22 $actor_guid = (int) get_input('actor_guid', elgg_extract('actor_guid', $vars));
23 
25 elgg()->translator->setCurrentLanguage($recipient->getLanguage());
26 
27 // using ignored access to be abe to show non public content
31 
32  return elgg_view_form('notifications/mute', [], [
33  'entity' => $entity,
34  'recipient' => $recipient,
35  'actor' => $actor,
36  ]);
37 });
38 
39 if (empty($content)) {
40  throw new EntityNotFoundException(elgg_echo('notifications:mute:error:content'));
41 }
42 
43 echo elgg_view_page(elgg_echo('notifications:mute:title'), [
44  'content' => $content,
45  'filter_id' => 'notifications',
46  'filter_value' => 'mute',
47  'show_owner_block_menu' => false,
48 ]);
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
Definition: elgglib.php:304
elgg
Definition: install.js:27
elgg_view_form(string $action, array $form_vars=[], array $body_vars=[])
Definition: views.php:1033
if(($owner instanceof\ElggGroup||$owner instanceof\ElggUser)&&!in_array($owner->guid, $mute_guids)) $actor
Definition: mute.php:78
$actor_guid
Definition: mute.php:22
elgg_entity_gatekeeper(int $guid, string $type=null, string $subtype=null, bool $validate_can_edit=false)
Can the viewer see this entity?
Definition: gatekeepers.php:99
$entity
Definition: mute.php:12
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$content
Definition: mute.php:28
elgg_set_page_owner_guid(int $guid)
Set the guid of the entity that owns this page.
Definition: pageowner.php:34
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition: input.php:20
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
$entity_guid
Handle muting notifications about an entity.
Definition: mute.php:6
elgg_entity_exists(int $guid)
Does an entity exist?
Definition: entities.php:91
const ELGG_IGNORE_ACCESS
elgg_call() flags
Definition: constants.php:121
get_entity(int $guid)
Loads and returns an entity object from a guid.
Definition: entities.php:70
elgg_view_page(string $title, string|array $body, string $page_shell= 'default', array $vars=[])
Assembles and outputs a full page.
Definition: views.php:235
get_user(int $guid)
Elgg users Functions to manage multiple or single users in an Elgg install.
Definition: users.php:16
$vars
Definition: theme.php:5
$recipient_guid
Definition: mute.php:7
Aggregate action for saving settings.
$recipient
Definition: mute.php:8