Elgg  Version 1.11
button.php
Go to the documentation of this file.
1 <?php
12 if (isset($vars['class'])) {
13  $vars['class'] = "elgg-button {$vars['class']}";
14 } else {
15  $vars['class'] = "elgg-button";
16 }
17 
18 $defaults = array(
19  'type' => 'button',
20 );
21 
22 $vars = array_merge($defaults, $vars);
23 
24 switch ($vars['type']) {
25  case 'button':
26  case 'reset':
27  case 'submit':
28  case 'image':
29  break;
30  default:
31  $vars['type'] = 'button';
32  break;
33 }
34 
35 // blank src if trying to access an offsite image. @todo why?
36 if (isset($vars['src']) && strpos($vars['src'], elgg_get_site_url()) === false) {
37  $vars['src'] = "";
38 }
39 ?>
40 <input <?php echo elgg_format_attributes($vars); ?> />
$defaults
Definition: button.php:18
$vars
Definition: button.php:22
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.