Elgg  Version master
site_secret.php
Go to the documentation of this file.
1 <?php
8 $strength = _elgg_services()->siteSecret->getStrength();
9 $current_strength = elgg_echo('site_secret:current_strength');
10 $strength_text = elgg_echo("site_secret:strength:$strength");
11 $strength_msg = elgg_echo("site_secret:strength_msg:$strength");
12 
13 $site_secret = elgg_view('output/longtext', [
14  'value' => elgg_echo('admin:security:settings:site_secret:intro'),
15 ]);
16 $message_type = ($strength != 'strong') ? 'error' : 'success';
18  'title' => "$current_strength: $strength_text",
19 ]);
20 
21 $site_secret_link = elgg_view('output/url', [
22  'text' => elgg_echo('admin:security:settings:site_secret:regenerate'),
23  'href' => 'action/admin/security/regenerate_site_secret',
24  'confirm' => true,
25  'class' => 'elgg-button elgg-button-action',
26 ]);
27 
28 $site_secret_link .= elgg_view('output/longtext', [
29  'value' => elgg_echo('admin:security:settings:site_secret:regenerate:help'),
30  'class' => 'elgg-subtext',
31 ]);
32 
33 $site_secret .= elgg_format_element('div', ['class' => 'mtm'], $site_secret_link);
34 
35 echo elgg_view_module('info', elgg_echo('admin:security:settings:label:site_secret'), $site_secret, [
36  'id' => 'admin-security-site-secret',
37 ]);
elgg_view_module(string $type, string $title, string $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:919
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$site_secret_link
Definition: site_secret.php:21
$strength_msg
Definition: site_secret.php:11
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
$strength
Security settings subview - site secret.
Definition: site_secret.php:8
$site_secret
Definition: site_secret.php:13
$message_type
Definition: site_secret.php:16
elgg_view_message(string $type, string $body, array $vars=[])
Wrapper function for the message display pattern.
Definition: views.php:940
_elgg_services()
Get the global service provider.
Definition: elgglib.php:351
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145
$current_strength
Definition: site_secret.php:9
$strength_text
Definition: site_secret.php:10