Elgg  Version master
maintenance.php
Go to the documentation of this file.
1 <?php
10 // render content before head so that JavaScript and CSS can be loaded. See #4032
11 $messages = elgg_view('page/elements/messages', ['object' => elgg_extract('sysmessages', $vars)]);
12 $content = (string) elgg_extract('body', $vars);
13 
14 elgg_unregister_external_file('css', 'elgg');
15 elgg_load_external_file('css', 'maintenance');
16 
17 $body = elgg_format_element('div', ['class' => 'elgg-page-messages'], $messages);
18 $body .= elgg_format_element('main', ['class' => 'elgg-body-maintenance'], $content);
19 $body = elgg_format_element('div', ['class' => ['elgg-page', 'elgg-page-maintenance'], 'id' => 'elgg-maintenance-page-wrapper'], $body);
20 
21 $head = elgg_view('page/elements/head', elgg_extract('head', $vars, []));
22 
23 echo elgg_view('page/elements/html', [
24  'head' => $head,
25  'body' => $body,
26 ]);
elgg_unregister_external_file(string $type, string $name)
Unregister an external file.
$head
Definition: maintenance.php:21
$messages
Maintenance mode page shell.
Definition: maintenance.php:11
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
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
elgg_load_external_file(string $type, string $name)
Load an external resource for use on this page.
$body
Maintenance mode layout.
Definition: maintenance.php:8
$vars
Definition: theme.php:5
$content
Definition: maintenance.php:12
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145