diff options
author | Evan Winslow <evan.b.winslow@gmail.com> | 2010-10-17 10:51:18 +0000 |
---|---|---|
committer | Evan Winslow <evan.b.winslow@gmail.com> | 2010-10-17 10:51:18 +0000 |
commit | 419c4e01ba3a8b8a038cee32c1fce7d1883532c1 (patch) | |
tree | 8dfc8aade1b36c0214a630cb9d9bc2d441109702 /views/default/html | |
parent | 0c8186592c6566bede22e4f567b04dddad7c493b (diff) | |
download | elgg-419c4e01ba3a8b8a038cee32c1fce7d1883532c1.tar.gz elgg-419c4e01ba3a8b8a038cee32c1fce7d1883532c1.tar.bz2 |
Added checkboxes, form, longtext, option, plaintext, pulldown, and tags input views. Kept things dry by creating a html/tag view that takes care of outputting attributes/body.
Diffstat (limited to 'views/default/html')
-rw-r--r-- | views/default/html/tag.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/views/default/html/tag.php b/views/default/html/tag.php new file mode 100644 index 000000000..d2f888d49 --- /dev/null +++ b/views/default/html/tag.php @@ -0,0 +1,47 @@ +<?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'])) { + $vars['name'] = $vars['internalname']; + unset($vars['internalname']); +} + +if (isset($vars['internalid'])) { + $vars['id'] = $vars['internalid']; + unset($vars['internalid']); +} + +$js = ''; +if (isset($vars['js'])) { + $js = $vars['js']; + unset($vars['js']); +} + +$tag = $vars['tag']; + +//Build the input +$element = array(); + +$element[] = "<$tag"; +foreach ($attributes as $attr => $val) { + if ($val === TRUE) { + $element[] = $attr; + } elseif ($val !== FALSE) { + $val = htmlspecialchars($val); + $element[] = "$attr=\"$val\""; + } +} +$element[] = $js; +$element[] = "/>"; + +echo implode(" ", $element);
\ No newline at end of file |