Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
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' => (array) elgg_extract('class', $vars, []),
24 ];
25 
26 $attrs['class'][] = 'elgg-module';
27 if ($type) {
28  $attrs['class'][] = "elgg-module-$type";
29 }
30 
31 $header = elgg_extract('header', $vars);
32 if ($title) {
33  $header = elgg_format_element('h3', [], $title);
34 }
35 
36 if ($header !== null) {
37  $header = elgg_format_element('div', ['class' => 'elgg-head'], $header);
38 }
39 $body = elgg_format_element('div', ['class' => 'elgg-body'], $body);
40 if ($footer) {
41  $footer = elgg_format_element('div', ['class' => 'elgg-foot'], $footer);
42 }
43 
46  $contents = elgg_format_element('div', ['class' => 'elgg-inner'], $contents);
47 }
48 
if($footer) $contents
Definition: module.php:44
$attrs
Definition: module.php:21
$title
Definition: module.php:16
$vars['entity']
elgg_format_element($tag_name, array $attributes=array(), $text= '', array $options=array())
Format an HTML element.
Definition: output.php:218
$type
Elgg module element.
Definition: module.php:15
$body
Definition: module.php:17
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:1310
$show_inner
Definition: module.php:19
$footer
Definition: module.php:18
if($type) $header
Definition: module.php:31