Elgg  Version 2.3
fieldset.php
Go to the documentation of this file.
1 <?php
2 
18  'elgg-fieldset',
19  'clearfix',
20 ]);
21 
22 $align = elgg_extract('align', $vars, 'vertical');
23 unset($vars['align']);
24 $vars['class'][] = "elgg-fieldset-$align";
25 
26 $justify = elgg_extract('justify', $vars, '');
27 unset($vars['justify']);
28 if ($justify) {
29  $vars['class'][] = "elgg-justify-$justify";
30 }
31 
32 $legend = elgg_extract('legend', $vars);
33 unset($vars['legend']);
34 
35 $fields = (array) elgg_extract('fields', $vars, []);
36 unset($vars['fields']);
37 
38 $fieldset = '';
39 if ($legend) {
40  $vars['class'][] = 'elgg-fieldset-has-legend';
41  $fieldset .= elgg_format_element('legend', [], $legend);
42 }
43 
44 foreach ($fields as $field) {
45  $fieldset .= elgg_view_field($field);
46 }
47 
$fields
Definition: fieldset.php:35
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1424
$align
Definition: fieldset.php:22
if($justify) $legend
Definition: fieldset.php:32
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
$vars['class']
Renders a set of fields wrapped in a <fieldset> tag.
Definition: fieldset.php:17
elgg_format_element($tag_name, array $attributes=array(), $text= '', array $options=array())
Format an HTML element.
Definition: output.php:208
if(elgg_extract('required', $vars)) $field
Definition: field.php:25
elgg echo
Translates a string.
Definition: languages.js:48
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1375
$fieldset
Definition: fieldset.php:38
$justify
Definition: fieldset.php:26