Elgg  Version 2.3
button.php
Go to the documentation of this file.
1 <?php
12 $vars['class'] = elgg_extract_class($vars, 'elgg-button');
13 
14 $defaults = ['type' => 'button'];
15 
16 $vars = array_merge($defaults, $vars);
17 
18 switch ($vars['type']) {
19  case 'button':
20  case 'reset':
21  case 'submit':
22  case 'image':
23  break;
24  default:
25  $vars['type'] = 'button';
26  break;
27 }
28 
29 // blank src if trying to access an offsite image. @todo why?
30 if (isset($vars['src']) && strpos($vars['src'], elgg_get_site_url()) === false) {
31  $vars['src'] = "";
32 }
33 
$vars['class']
Definition: button.php:12
$defaults
Definition: button.php:14
elgg_extract_class(array $array, $existing=[])
Extract class names from an array with key "class", optionally merging into a preexisting set...
Definition: elgglib.php:1396
elgg_format_element($tag_name, array $attributes=array(), $text= '', array $options=array())
Format an HTML element.
Definition: output.php:208
elgg echo
Translates a string.
Definition: languages.js:48
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.