Elgg  Version 3.0
set_maintenance_mode.php
Go to the documentation of this file.
1 <?php
7 $mode = (int) elgg_get_config('elgg_maintenance_mode', null);
8 
9 $message = $site->getPrivateSetting('elgg_maintenance_message');
10 if (!$message) {
11  $message = elgg_echo('admin:maintenance_mode:default_message');
12 }
13 
14 echo elgg_view('output/longtext', [
15  'value' => elgg_echo('admin:maintenance_mode:instructions'),
16 ]);
17 
19  '#type' => 'select',
20  '#label' => elgg_echo('admin:maintenance_mode:mode_label'),
21  'name' => 'mode',
22  'options_values' => [
23  '1' => elgg_echo('on'),
24  '0' => elgg_echo('off'),
25  ],
26  'value' => $mode,
27 ]);
28 
30  '#type' => 'longtext',
31  '#label' => elgg_echo('admin:maintenance_mode:message_label'),
32  'name' => 'message',
33  'id' => 'message',
34  'value' => $message,
35 ]);
36 
38  '#type' => 'submit',
39  'value' => elgg_echo('save'),
40 ]);
41 
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1395
$mode
Configure site maintenance mode.
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_set_form_footer($footer= '')
Sets form footer and defers its rendering until the form view and extensions have been rendered...
Definition: views.php:1331
elgg echo
Translates a string.
Definition: languages.js:43
elgg_get_site_entity()
Get the current site entity.
Definition: entities.php:130
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
elgg_get_config($name, $default=null)
Get an Elgg configuration value.