Elgg  Version 5.1
default_access.php
Go to the documentation of this file.
1 <?php
8 if (!elgg_get_config('allow_user_default_access')) {
9  return;
10 }
11 
13 if (!$user instanceof ElggUser) {
14  return;
15 }
16 
17 $default_access = $user->getMetadata('elgg_default_access') ?? elgg_get_config('default_access');
18 
19 $title = elgg_echo('default_access:settings');
21  '#type' => 'access',
22  '#label' => elgg_echo('default_access:label'),
23  'name' => 'default_access',
24  'value' => $default_access,
25 ]);
26 
27 echo elgg_view_module('info', $title, $content);
elgg_view_module(string $type, string $title, string $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:940
$content
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1133
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$title
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
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:23
if(!elgg_get_config('allow_user_default_access')) $user
Provide a way of setting your default access.
$vars
Definition: theme.php:5
if(!$user instanceof ElggUser) $default_access