From 0398efad65a98fed4166f6a47649408f5ebf5b49 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sat, 24 Jul 2021 00:33:55 +0200 Subject: [PATCH] Fixed tabs --- includes/sys_template.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/includes/sys_template.php b/includes/sys_template.php index 96df3936..2ed37d19 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -38,25 +38,31 @@ function tabs($tabs, $selected = 0) $tab_header = []; $tab_content = []; foreach ($tabs as $header => $content) { - $class = ''; + $active = false; $id = $header; $href = '#' . $id; if (count($tab_header) == $selected) { - $class = 'active'; + $active = true; } if (is_array($content)) { $href = $content['href']; $content = null; $id = null; } - $tab_header[] = ''; - $tab_content[] = $content ? '
' + $tab_content[] = $content + ? '
' . $content - . '
' : ''; + . '
' + : ''; } return div('', [ '',