Elgg  Version 1.9
module.php
Go to the documentation of this file.
1 <?php
15 $type = elgg_extract('type', $vars, false);
16 $title = elgg_extract('title', $vars, '');
17 $header = elgg_extract('header', $vars, '');
18 $body = elgg_extract('body', $vars, '');
19 $footer = elgg_extract('footer', $vars, '');
20 $show_inner = elgg_extract('show_inner', $vars, false);
21 
22 $class = 'elgg-module';
23 if ($type) {
24  $class = "$class elgg-module-$type";
25 }
27 if ($additional_class) {
28  $class = "$class $additional_class";
29 }
30 
31 $id = '';
32 if (isset($vars['id'])) {
33  $id = "id=\"{$vars['id']}\"";
34 }
35 
36 if (isset($vars['header'])) {
37  $header = "<div class=\"elgg-head\">$header</div>";
38 } elseif ($title) {
39  $header = "<div class=\"elgg-head\"><h3>$title</h3></div>";
40 }
41 
42 $body = "<div class=\"elgg-body\">$body</div>";
43 
44 if ($footer) {
45  $footer = "<div class=\"elgg-foot\">$footer</div>";
46 }
47 
50  $contents = "<div class=\"elgg-inner\">$contents</div>";
51 }
52 
53 echo "<div class=\"$class\" $id>$contents</div>";
if($additional_class) $id
Definition: module.php:31
$class
Definition: module.php:22
if($footer) $contents
Definition: module.php:48
if($type) $additional_class
Definition: module.php:26
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1464
$title
Definition: module.php:16
$type
Elgg module element.
Definition: module.php:15
$header
Definition: module.php:17
elgg echo
Translates a string.
Definition: languages.js:43
$body
Definition: module.php:18
$show_inner
Definition: module.php:20
$footer
Definition: module.php:19
if(file_exists($welcome)) $vars
Definition: upgrade.php:93