Elgg  Version master
mute.php
Go to the documentation of this file.
1 <?php
10 $entity_guid = (int) elgg_extract('entity_guid', $vars);
12  throw new \Elgg\Exceptions\Http\EntityNotFoundException();
13 }
14 
15 $recipient_guid = (int) elgg_extract('recipient_guid', $vars);
18 
19 $actor_guid = (int) get_input('actor_guid', elgg_extract('actor_guid', $vars));
20 
22 elgg()->translator->setCurrentLanguage($recipient->getLanguage());
23 
24 // using ignored access to be abe to show non public content
28 
29  return elgg_view_form('notifications/mute', [], [
30  'entity' => $entity,
31  'recipient' => $recipient,
32  'actor' => $actor,
33  ]);
34 });
35 
36 if (empty($content)) {
37  throw new \Elgg\Exceptions\Http\PageNotFoundException(elgg_echo('notifications:mute:error:content'));
38 }
39 
40 echo elgg_view_page(elgg_echo('notifications:mute:title'), [
41  'content' => $content,
42  'filter_id' => 'notifications',
43  'filter_value' => 'mute',
44  'show_owner_block_menu' => false,
45 ]);
$vars
Definition: theme.php:3
$entity
Definition: mute.php:12
$entity_guid
Handle muting notifications about an entity.
Definition: mute.php:6
$recipient
Definition: mute.php:8
$recipient_guid
Definition: mute.php:7
const ELGG_IGNORE_ACCESS
elgg_call() flags
Definition: constants.php:121
elgg()
Bootstrapping and helper procedural code available for use in Elgg core and plugins.
Definition: elgglib.php:12
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:296
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:246
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition: input.php:20
get_entity(int $guid)
Loads and returns an entity object from a guid.
Definition: entities.php:68
elgg_entity_exists(int $guid)
Does an entity exist?
Definition: entities.php:89
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
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
elgg_view_form(string $action, array $form_vars=[], array $body_vars=[])
Definition: views.php:1036
elgg_view_page(string $title, string|array $body, string $page_shell='default', array $vars=[])
Assembles and outputs a full page.
Definition: views.php:235
elgg_set_page_owner_guid(int $guid)
Set the guid of the entity that owns this page.
Definition: pageowner.php:34
if(($owner instanceof \ElggGroup|| $owner instanceof \ElggUser) &&!in_array($owner->guid, $mute_guids)) $actor
Definition: mute.php:78
$content
Definition: mute.php:25
$actor_guid
Definition: mute.php:19