aboutsummaryrefslogtreecommitdiff
path: root/views/default/input/button.php
blob: b1a884c778a0b358524bd0b7057bdb504b87e48e (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
<?php
/**
 * Create a input button
 *
 * @package Elgg
 * @subpackage Core
 *
 * @uses $vars['src'] Src of an image
 * 
 * @todo Handle classes better
 */

$defaults = array(
	'type' => 'button',
	'class' => 'elgg-button elgg-button-action',
);

$vars = array_merge($defaults, $vars);

switch ($vars['type']) {
	case 'button':
	case 'reset':
	case 'submit':
	case 'image':
		break;
	default:
		$vars['type'] = 'button';
		break;
}

// blank src if trying to access an offsite image. @todo why?
if (strpos($vars['src'], elgg_get_site_url()) === false) {
	$vars['src'] = "";
}
?>
<input <?php echo elgg_format_attributes($vars); ?> />