This repository was archived by the owner on Jan 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbs-tabs.php
79 lines (58 loc) · 1.5 KB
/
bs-tabs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
* Show Snippets in Bootstrap tabs
* [plugin=bs-tabs.php]key=word[/plugin]
* key = keyword of your snippets
*/
/* backend */
$plugin = array();
$plugin['title'] = 'Tabs Plugin';
$plugin['description'] = '<p>Show Textsnippets in Bootstrap3 Tabs</p>';
$plugin['version'] = '0.1';
$plugin['author'] = 'flatCore DevTeam';
/* frontend */
if(FC_SOURCE == 'frontend') {
global $db_content;
global $languagePack;
$tabs = $db_content->select("fc_textlib", "*",[
"textlib_keywords" => $key,
"textlib_lang" => $languagePack,
"ORDER" => [
"textlib_priority" => "DESC"
]
]);
echo '<div class="card p-3 mt-3">';
echo '<nav>';
echo '<div class="nav nav-tabs" id="nav-tab" role="tablist">';
$x = 0;
foreach($tabs as $tab) {
$id = 'tabid'.$tab['textlib_id'];
if($x==0) {
$class = 'nav-link active';
} else {
$class = 'nav-link';
}
echo '<button class="'.$class.'" data-bs-toggle="tab" data-bs-target="#'.$id.'" type="button" role="tab">'.$tab['textlib_permalink_name'].'</button>';
$x++;
}
echo '</div>';
echo '</nav>';
echo '<div class="tab-content p-2" id="myTabContent">';
$x = 0;
foreach($tabs as $tab) {
$id = 'tabid'.$tab['textlib_id'];
if($x==0) {
$class = 'tab-pane fade show active';
} else {
$class = 'tab-pane fade';
}
echo '<div class="'.$class.'" id="'.$id.'" role="tabpanel">';
echo '<h5>'.$tab['textlib_title'].'</h5>';
echo $tab['textlib_content'];
echo '</div>';
$x++;
}
echo '</div>';
echo '</div>';
}
?>