diff options
author | msquare <msquare@notrademark.de> | 2017-11-24 12:01:19 +0100 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2017-11-24 12:01:19 +0100 |
commit | 928e707015fa5b9b3e2dd52c9493552ae1218911 (patch) | |
tree | ef7e9f297b9f3581361279cda45e46d0778b58c2 /includes/sys_template.php | |
parent | d8476f244dd0ee1bccaab53f123fa12f2a9c9501 (diff) |
add shift calendar to angeltype view
Diffstat (limited to 'includes/sys_template.php')
-rw-r--r-- | includes/sys_template.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/includes/sys_template.php b/includes/sys_template.php index 662283b1..96290062 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -1,6 +1,32 @@ <?php /** + * Renders tabs from the array. Array key is tab name, array value is tab content. + * + * @param array $tabs + * @return string HTML + */ +function tabs($tabs) +{ + $tab_header = []; + $tab_content = []; + foreach($tabs as $header => $content) { + $class = ''; + if(count($tab_header) == 0) { + $class = 'active'; + } + $tab_header[] = '<li role="presentation" class="' . $class . '"> + <a href="#' . $header . '" aria-controls="' . $header . '" role="tab" data-toggle="tab">' + . $header . '</a></li>'; + $tab_content[] = '<div role="tabpanel" class="tab-pane ' . $class . '" id="' . $header . '">' . $content . '</div>'; + } + return div('', [ + '<ul class="nav nav-tabs" role="tablist">' . join($tab_header) . '</ul>', + '<div class="tab-content">' . join($tab_content) . '</div>' + ]); +} + +/** * Display muted (grey) text. * * @param string $text |