blob: 67a7d067cf537dd153a78ae879b1ab2ec3e41087 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
<?php
// remove all the junk that elgg_view throws into $vars
unset($vars['config']);
unset($vars['url']);
unset($vars['page_owner']);
unset($vars['page_owner_user']);
foreach ($_SESSION as $key=>$value) {
unset($vars[$key]);
}
// backwards compatibility code
if (isset($vars['internalname'])) {
//@todo put deprecated notice
$vars['name'] = $vars['internalname'];
unset($vars['internalname']);
}
if (isset($vars['internalid'])) {
//@todo put deprecated notice
$vars['id'] = $vars['internalid'];
unset($vars['internalid']);
}
$js = '';
if (isset($vars['js'])) {
//@todo put deprecated notice
$js = $vars['js'];
unset($vars['js']);
}
$tag = $vars['tag'];
unset($vars['tag']);
$body = $vars['body'];
unset($vars['body']);
//Build the input
$element = array();
$element[] = "<$tag";
foreach ($vars as $attr => $val) {
if ($val === TRUE) {
$element[] = $attr;
} elseif (!empty($val)) {
$val = htmlspecialchars($val);
$element[] = "$attr=\"$val\"";
}
}
if (!empty($js)) {
$element[] = $js;
}
if (!isset($body)) {
$element[] = '/';
}
echo implode(" ", $element).">";
if (isset($body)) {
echo "$body</$tag>";
}
|