Elgg  Version 3.0
module.php
Go to the documentation of this file.
1 <?php
19 $footer = elgg_extract('footer', $vars);
20 $show_inner = elgg_extract('show_inner', $vars, false);
21 
22 $attrs = [
23  'id' => elgg_extract('id', $vars),
24  'class' => elgg_extract_class($vars, 'elgg-module'),
25 ];
26 
27 if (!elgg_is_empty($type)) {
28  $attrs['class'][] = "elgg-module-$type";
29 }
30 
31 $header = elgg_extract('header', $vars);
32 if (!elgg_is_empty($title)) {
33  $header = elgg_format_element('h3', [], $title);
34 }
35 
36 if ($header !== null) {
37  $menu = elgg_extract('menu', $vars);
38  if ($menu) {
39  $header .= elgg_format_element('div', ['class' => 'elgg-module-menu'], $menu);
40  }
41 
42  $header = elgg_format_element('div', ['class' => 'elgg-head'], $header);
43 }
44 
45 $body = elgg_format_element('div', ['class' => 'elgg-body'], $body);
46 if (!elgg_is_empty($footer)) {
47  $footer = elgg_format_element('div', ['class' => 'elgg-foot'], $footer);
48 }
49 
52  $contents = elgg_format_element('div', ['class' => 'elgg-inner'], $contents);
53 }
54 
$attrs
Definition: module.php:22
$menu
Admin sidebar – just outputs the page menus.
Definition: sidebar.php:6
$title
Definition: module.php:17
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
elgg_is_empty($value)
Check if a value isn&#39;t empty, but allow 0 and &#39;0&#39;.
Definition: input.php:206
$type
Elgg module element.
Definition: module.php:16
if(!elgg_is_empty($type)) $header
Definition: module.php:31
if(!elgg_is_empty($footer)) $contents
Definition: module.php:50
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
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
$show_inner
Definition: module.php:20
$vars['type']
Definition: save.php:11
$body
Definition: module.php:18
$footer
Definition: module.php:19