From 419c4e01ba3a8b8a038cee32c1fce7d1883532c1 Mon Sep 17 00:00:00 2001 From: Evan Winslow Date: Sun, 17 Oct 2010 10:51:18 +0000 Subject: 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. --- views/default/input/pulldown.php | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 views/default/input/pulldown.php (limited to 'views/default/input/pulldown.php') diff --git a/views/default/input/pulldown.php b/views/default/input/pulldown.php new file mode 100644 index 000000000..49c126c77 --- /dev/null +++ b/views/default/input/pulldown.php @@ -0,0 +1,55 @@ + "option" where "value" is an internal name and "option" is + * the value displayed on the button. Replaces $vars['options'] when defined. + */ + +$defaults = array( + 'class' => 'input-pulldown', +); + +$overrides = array( + 'tag' => 'select', +); + +$args = array_merge($defaults, $vars, $overrides); + +$body = ''; + +if ($vars['options_values']) { + foreach($vars['options_values'] as $value => $option) { + $option_args = array( + 'value' => $value, + 'body' => $option, + 'selected' => ($value == $args['value']), + ); + + $body .= elgg_view('input/option', $option_args); + } +} else { + foreach($vars['options'] as $option) { + $option_args = array( + 'body' => $option, + 'selected' => ($option == $args['value']), + ); + + $body .= elgg_view('input/option', $option_args); + } +} + +$args['body'] = $body; + +echo elgg_view('html/tag', $args); -- cgit v1.2.3