Elgg  Version 3.0
content_access.php
Go to the documentation of this file.
1 <?php
6 $field = [
7  '#type' => 'access',
8  'options_values' => [
9  ACCESS_PRIVATE => elgg_echo('access:label:private'),
10  ACCESS_LOGGED_IN => elgg_echo('access:label:logged_in'),
11  ACCESS_PUBLIC => elgg_echo('access:label:public'),
12  ],
13  'name' => 'default_access',
14  '#label' => elgg_echo('installation:sitepermissions'),
15  '#help' => elgg_echo('admin:site:access:warning'),
16  'value' => elgg_get_config('default_access'),
17 ];
18 
20 
22  '#type' => 'checkbox',
23  'label' => elgg_echo('installation:allow_user_default_access:label'),
24  '#help' => elgg_echo('installation:allow_user_default_access:description'),
25  'name' => 'allow_user_default_access',
26  'checked' => (bool) elgg_get_config('allow_user_default_access'),
27  'switch' => true,
28 ]);
29 
30 echo elgg_view_module('info', elgg_echo('admin:legend:content_access'), $body, ['id' => 'elgg-settings-advanced-content-access']);
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1395
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
const ACCESS_PRIVATE
Definition: constants.php:12
const ACCESS_LOGGED_IN
Definition: constants.php:13
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:1198
elgg echo
Translates a string.
Definition: languages.js:43
$field
Advanced site settings, content access section.
const ACCESS_PUBLIC
Definition: constants.php:14
elgg_get_config($name, $default=null)
Get an Elgg configuration value.