Elgg  Version 4.3
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 ]);
$site_secret_link
Definition: site_secret.php:21
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
$strength_msg
Definition: site_secret.php:11
elgg_view_message($type, $body, array $vars=[])
Wrapper function for the message display pattern.
Definition: views.php:965
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:135
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:944
$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_services()
Get the global service provider.
Definition: elgglib.php:638
elgg echo
Translates a string.
Definition: deprecated.js:530
$current_strength
Definition: site_secret.php:9
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179
$strength_text
Definition: site_secret.php:10