Elgg  Version 6.1
default.php
Go to the documentation of this file.
1 <?php
2 
16 $sections = elgg_extract('sections', $vars);
17 
18 if (empty($sections)) {
19  // render content before head so that JavaScript and CSS can be loaded. See #4032
20  $sections = [
21  'messages' => elgg_view('page/elements/messages', [
22  'object' => elgg_extract('sysmessages', $vars),
23  ]),
24  'topbar' => elgg_view('page/elements/topbar', $vars),
25  'header' => elgg_view('page/elements/header', $vars),
26  'admin-notices' => elgg_view('page/elements/admin_notices', $vars),
27  'body' => elgg_view('page/elements/body', $vars),
28  'footer' => elgg_view('page/elements/footer', $vars),
29  ];
30 }
31 
32 $page = '';
33 foreach ($sections as $section => $content) {
34  $page .= elgg_view('page/elements/section', [
35  'section' => $section,
36  'html' => $content,
37  'page_shell' => elgg_extract('page_shell', $vars),
38  ]);
39 }
40 
41 $page_vars = elgg_extract('page_attrs', $vars, []);
42 $page_vars['class'] = elgg_extract_class($page_vars, ['elgg-page', 'elgg-page-default']);
43 
45 
46 $body .= elgg_view('page/elements/foot', $vars);
47 
48 $head = elgg_view('page/elements/head', elgg_extract('head', $vars, []));
49 
51  'head' => $head,
52  'body' => $body,
53  'body_attrs' => elgg_extract('body_attrs', $vars, []),
54  'html_attrs' => elgg_extract('html_attrs', $vars, []),
55 ];
56 
57 echo elgg_view('page/elements/html', $params);
$content
Definition: default.php:58
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:256
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
$body
Definition: default.php:22
if(!array_key_exists($size, $icon_sizes)) $vars['size']
Definition: default.php:25
$sections
Renders a standard HTML page shell.
Definition: default.php:16
if(empty($sections)) $page
Definition: default.php:32
foreach($sections as $section=> $content) $page_vars
Definition: default.php:41
$params
Definition: default.php:50
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145
elgg_extract_class(array $array, array|string $existing=[], string $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:279
$head
Definition: default.php:48