aboutsummaryrefslogtreecommitdiff
path: root/views/installation/input/button.php
blob: ec90fed9d43ef5b282ea0e7e04a3205c1f42819f (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
<?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; ?>" />