Elgg  Version 5.1
section.php
Go to the documentation of this file.
1 <?php
9 $section = elgg_extract('section', $vars);
11 
12 if (!empty($section) && elgg_view_exists("page/elements/{$section}/before")) {
13  echo elgg_view_deprecated("page/elements/{$section}/before", $vars, 'Prepend the correct page/elements/<section>', '5.1');
14 }
15 
16 if (!empty($html)) {
17  $section_elements = [
18  'body' => 'main',
19  'topbar' => 'header',
20  'footer' => 'footer',
21  ];
22 
23  $class = ['elgg-page-section'];
24  if (!empty($section)) {
25  $class[] = "elgg-page-{$section}";
26  }
27 
28  $inner = elgg_format_element('div', ['class' => 'elgg-inner'], $html);
29 
30  $element = elgg_extract($section, $section_elements, 'div');
31 
32  echo elgg_format_element($element, ['class' => $class], $inner);
33 }
34 
35 if (!empty($section) && elgg_view_exists("page/elements/{$section}/after")) {
36  echo elgg_view_deprecated("page/elements/{$section}/after", $vars, 'Append the correct page/elements/<section>', '5.1');
37 }
$class
Definition: summary.php:44
$html
Definition: section.php:10
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_deprecated(string $view, array $vars, string $suggestion, string $version)
Display a view with a deprecation notice.
Definition: views.php:1514
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145
elgg_view_exists(string $view, string $viewtype= '', bool $recurse=true)
Returns whether the specified view exists.
Definition: views.php:152