Elgg  Version 3.0
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 
41  'elgg-layout',
42  'clearfix'
43 ]);
44 unset($vars['class']);
45 
46 // Prepare layout sidebar
47 $vars['sidebar'] = elgg_extract('sidebar', $vars, '');
48 if ($vars['sidebar'] !== false) {
49  // In a default layout, we want to make sure we render
50  // sidebar navigation items
51  $vars['sidebar'] = elgg_view('page/elements/sidebar', $vars);
52 }
53 $sidebar = elgg_view('page/layouts/elements/sidebar', $vars);
54 
55 // Prepare second layout sidebar
56 $vars['sidebar_alt'] = elgg_extract('sidebar_alt', $vars, false, false);
57 if ($vars['sidebar_alt'] !== false) {
58  // In a default layout, we want to make sure we render
59  // sidebar navigation items
60  $vars['sidebar_alt'] = elgg_view('page/elements/sidebar_alt', $vars);
61 }
62 $sidebar_alt = elgg_view('page/layouts/elements/sidebar_alt', $vars);
63 
64 if ($sidebar && $sidebar_alt) {
65  $class[] = 'elgg-layout-two-sidebar';
66 } else if ($sidebar) {
67  $class[] = 'elgg-layout-one-sidebar';
68 } else {
69  $class[] = 'elgg-layout-one-column';
70 }
71 
73 
74 $breadcrumbs = elgg_view('page/layouts/elements/breadcrumbs', $vars);
75 $header = elgg_view('page/layouts/elements/header', $vars);
76 $body = elgg_view('page/layouts/elements/body', $vars);
77 
79 $layout .= $header;
80 $layout .= elgg_format_element('div', [
81  'class' => 'elgg-layout-columns',
83 
if($vars['sidebar']!==false) $sidebar
Definition: default.php:53
elgg_extract_class(array $array, $existing=[], $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:1153
$class
Definition: default.php:29
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:168
elgg echo
Translates a string.
Definition: languages.js:43
$header
Definition: default.php:75
if(!array_key_exists($size, $icon_sizes)) $vars['size']
Definition: default.php:27
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1131
$breadcrumbs
Definition: default.php:74
$layout_attrs
Elgg default layout.
Definition: default.php:37
$layout
Definition: default.php:78
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
$body
Definition: default.php:32
if($vars['sidebar_alt']!==false) $sidebar_alt
Definition: default.php:62