diff options
Diffstat (limited to 'includes/sys_template.php')
-rw-r--r-- | includes/sys_template.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/includes/sys_template.php b/includes/sys_template.php index a659a7f3..662283b1 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -212,6 +212,20 @@ function page_with_title($title, $elements) } /** + * Renders a description based on the data arrays key and values as label an description. + * @param array $data + */ +function description($data) { + $elements = []; + foreach($data as $label => $description) { + if(!empty($label) && !empty($description)) { + $elements[] = '<dt>' . $label . '</dt><dd>' . $description . '</dd>'; + } + } + return '<dl class="dl-horizontal">' . join($elements) . '</dl>'; +} + +/** * Rendert eine Datentabelle * * @param array|string $columns |