summaryrefslogtreecommitdiff
path: root/includes/sys_template.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-11-09 17:43:56 +0100
committerGitHub <noreply@github.com>2016-11-09 17:43:56 +0100
commitd43eb41d25d0d5c0509417247030dd6c21118cf6 (patch)
tree2c3f78bf8fbd4215e70af7dbc2ce30cfef674816 /includes/sys_template.php
parentd5d2acc7d80920eef5f0ed779a3738a12d5db348 (diff)
parent22520532c78b3a032aec6ececb7623ba094da8de (diff)
Merge pull request #274 from engelsystem/task-164-shift-view
Task 164 shift view
Diffstat (limited to 'includes/sys_template.php')
-rw-r--r--includes/sys_template.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/includes/sys_template.php b/includes/sys_template.php
index 2faf98c3..6c1727a4 100644
--- a/includes/sys_template.php
+++ b/includes/sys_template.php
@@ -42,8 +42,11 @@ function glyph_bool($boolean) {
}
function div($class, $content = [], $dom_id = "") {
+ if (is_array($content)) {
+ $content = join("\n", $content);
+ }
$dom_id = $dom_id != '' ? ' id="' . $dom_id . '"' : '';
- return '<div' . $dom_id . ' class="' . $class . '">' . join("\n", $content) . '</div>';
+ return '<div' . $dom_id . ' class="' . $class . '">' . $content . '</div>';
}
function heading($content, $number = 1) {
@@ -60,6 +63,10 @@ function toolbar($items = [], $right = false) {
return '<ul class="nav navbar-nav' . ($right ? ' navbar-right' : '') . '">' . join("\n", $items) . '</ul>';
}
+function toolbar_pills($items) {
+ return '<ul class="nav nav-pills">' . join("\n", $items) . '</ul>';
+}
+
/**
* Render a link for a toolbar.
*
@@ -374,11 +381,11 @@ function render_table($columns, $rows, $data = true) {
foreach ($rows as $row) {
$html .= '<tr>';
foreach ($columns as $key => $column) {
+ $value = "&nbsp;";
if (isset($row[$key])) {
- $html .= '<td class="column_' . $key . '">' . $row[$key] . '</td>';
- } else {
- $html .= '<td class="column_' . $key . '">&nbsp;</td>';
+ $value = $row[$key];
}
+ $html .= '<td class="column_' . $key . '">' . $value . '</td>';
}
$html .= '</tr>';
}