diff options
Diffstat (limited to 'views/default/input/default.php')
-rw-r--r-- | views/default/input/default.php | 48 |
1 files changed, 5 insertions, 43 deletions
diff --git a/views/default/input/default.php b/views/default/input/default.php index 0577b34e5..4f4eecc59 100644 --- a/views/default/input/default.php +++ b/views/default/input/default.php @@ -15,53 +15,15 @@ * including javascript event attributes such as onclick.
*/
-// 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']);
-}
-
// default attributes
$defaults = array(
'type' => 'text',
);
-$attributes = array_merge($defaults, $vars);
-
-//Build the input
-$element = array();
+$overrides = array(
+ 'tag' => 'input',
+);
-$element[] = "<input";
-foreach ($attributes as $attr => $val) {
- if ($val === TRUE) {
- $element[] = $attr;
- } elseif ($val !== FALSE) {
- $val = htmlspecialchars($val);
- $element[] = "$attr=\"$val\"";
- }
-}
-$element[] = $js;
-$element[] = "/>";
+$args = array_merge($defaults, $vars, $overrides);
-echo implode(" ", $element);
\ No newline at end of file +echo elgg_view('html/tag', $args);
\ No newline at end of file |