Elgg  Version 6.1
default.php
Go to the documentation of this file.
1 <?php
2 
37 $layout_attrs = elgg_extract('layout_attrs', $vars, []);
38 unset($vars['layout_attrs']);
39 
40 $class = elgg_extract_class($vars, ['elgg-layout']);
41 unset($vars['class']);
42 
43 // Prepare layout sidebar
44 $vars['sidebar'] = elgg_extract('sidebar', $vars, '');
45 if ($vars['sidebar'] !== false) {
46  // In a default layout, we want to make sure we render
47  // sidebar navigation items
48  $vars['sidebar'] = elgg_view('page/elements/sidebar', $vars);
49 }
50 
51 $sidebar = elgg_view('page/layouts/elements/sidebar', $vars);
52 
53 // Prepare second layout sidebar
54 $vars['sidebar_alt'] = elgg_extract('sidebar_alt', $vars, false, false);
55 if ($vars['sidebar_alt'] !== false) {
56  // In a default layout, we want to make sure we render
57  // sidebar navigation items
58  $vars['sidebar_alt'] = elgg_view('page/elements/sidebar_alt', $vars);
59 }
60 
61 $sidebar_alt = elgg_view('page/layouts/elements/sidebar_alt', $vars);
62 
63 if ($sidebar && $sidebar_alt) {
64  $class[] = 'elgg-layout-two-sidebar';
65 } else if ($sidebar) {
66  $class[] = 'elgg-layout-one-sidebar';
67 } else {
68  $class[] = 'elgg-layout-one-column';
69 }
70 
72 
73 $body = elgg_view('page/layouts/elements/body', $vars);
74 
if($vars['sidebar']!==false) $sidebar
Definition: default.php:51
$class
Definition: default.php:29
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
$layout_attrs
Elgg default layout.
Definition: default.php:37
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
if($vars['sidebar_alt']!==false) $sidebar_alt
Definition: default.php:61