Elgg  Version 2.3
module.php
Go to the documentation of this file.
1 <?php
2 
15 $type = elgg_extract('type', $vars, false);
16 $title = elgg_extract('title', $vars, '');
17 $body = elgg_extract('body', $vars, '');
18 $footer = elgg_extract('footer', $vars, '');
19 $show_inner = elgg_extract('show_inner', $vars, false);
20 
21 $attrs = [
22  'id' => elgg_extract('id', $vars),
23  'class' => elgg_extract_class($vars, 'elgg-module'),
24 ];
25 
26 if ($type) {
27  $attrs['class'][] = "elgg-module-$type";
28 }
29 
30 $header = elgg_extract('header', $vars);
31 if ($title) {
32  $header = elgg_format_element('h3', [], $title);
33 }
34 
35 if ($header !== null) {
36  $header = elgg_format_element('div', ['class' => 'elgg-head'], $header);
37 }
38 $body = elgg_format_element('div', ['class' => 'elgg-body'], $body);
39 if ($footer) {
40  $footer = elgg_format_element('div', ['class' => 'elgg-foot'], $footer);
41 }
42 
45  $contents = elgg_format_element('div', ['class' => 'elgg-inner'], $contents);
46 }
47 
if($footer) $contents
Definition: module.php:43
$attrs
Definition: module.php:21
$title
Definition: module.php:16
elgg_extract_class(array $array, $existing=[])
Extract class names from an array with key "class", optionally merging into a preexisting set...
Definition: elgglib.php:1396
$vars['entity']
elgg_format_element($tag_name, array $attributes=array(), $text= '', array $options=array())
Format an HTML element.
Definition: output.php:208
$type
Elgg module element.
Definition: module.php:15
$body
Definition: module.php:17
elgg echo
Translates a string.
Definition: languages.js:48
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:1375
$show_inner
Definition: module.php:19
$footer
Definition: module.php:18
if($type) $header
Definition: module.php:30