diff options
Diffstat (limited to 'views/installation/input/button.php')
-rw-r--r-- | views/installation/input/button.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/views/installation/input/button.php b/views/installation/input/button.php new file mode 100644 index 000000000..ec90fed9d --- /dev/null +++ b/views/installation/input/button.php @@ -0,0 +1,40 @@ +<?php +/** + * Create a input button + * + * @uses $vars['value'] The current value, if any + * @uses $vars['name'] The name of the input field + * @uses $vars['type'] submit or button. + */ + +if (isset($vars['class'])) { + $class = $vars['class']; +} else { + $class = "elgg-button-submit"; +} + +if (isset($vars['name'])) { + $name = $vars['name']; +} else { + $name = ''; +} + +if (isset($vars['type'])) { + $type = strtolower($vars['type']); +} else { + $type = 'submit'; +} + +switch ($type) { + case 'button' : + $type='button'; + break; + case 'submit': + default: + $type = 'submit'; +} + +$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); + +?> +<input type="<?php echo $type; ?>" value="<?php echo $value; ?>" class="<?php echo $class; ?>" />
\ No newline at end of file |