Elgg  Version master
Go to the documentation of this file.
1 <?php
8 if (!elgg_get_config('allow_user_default_access')) {
9  return;
10 }
13 if (!$user instanceof ElggUser) {
14  return;
15 }
17 $default_access = $user->getMetadata('elgg_default_access') ?? elgg_get_config('default_access');
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 ]);
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:919
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1112
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
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
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.
Definition: theme.php:5
if(!$user instanceof ElggUser) $default_access