mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
Make colors configurable for navbar and badges
This commit is contained in:
parent
d7c3b8ae83
commit
21b774a33a
@ -169,6 +169,7 @@ try {
|
|||||||
$all = $trim;
|
$all = $trim;
|
||||||
}
|
}
|
||||||
usort($all, array("History", "cmp_row_date_desc"));
|
usort($all, array("History", "cmp_row_date_desc"));
|
||||||
|
$bc = $page->settings->info_badge_classes;
|
||||||
|
|
||||||
if (!empty($all)) {
|
if (!empty($all)) {
|
||||||
$page->table_begin();
|
$page->table_begin();
|
||||||
@ -193,7 +194,7 @@ try {
|
|||||||
|
|
||||||
$label_type = $page->type;
|
$label_type = $page->type;
|
||||||
$label_name = Info::create($row, $page, $label_type)->name(); //ucfirst($label_type);
|
$label_name = Info::create($row, $page, $label_type)->name(); //ucfirst($label_type);
|
||||||
$label = "<span class='badge litebans-label-history litebans-label-$label_type'>$label_name</span>";
|
$label = "<span class='$bc litebans-label-history litebans-label-$label_type'>$label_name</span>";
|
||||||
|
|
||||||
$page->print_table_rows($row, array(
|
$page->print_table_rows($row, array(
|
||||||
"type" => $label,
|
"type" => $label,
|
||||||
|
@ -43,7 +43,7 @@ function navbar($links) {
|
|||||||
$li .= " class=\"$class\"";
|
$li .= " class=\"$class\"";
|
||||||
|
|
||||||
if ($this->page->settings->header_show_totals && isset($this->count[$page])) {
|
if ($this->page->settings->header_show_totals && isset($this->count[$page])) {
|
||||||
$title .= " <span class=\"badge-pill badge-secondary\">";
|
$title .= ' <span class="' . $this->page->settings->badge_classes . '">';
|
||||||
$title .= $this->count[$page];
|
$title .= $this->count[$page];
|
||||||
$title .= "</span>";
|
$title .= "</span>";
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ $settings = $this->page->settings;
|
|||||||
|
|
||||||
|
|
||||||
<header role="banner">
|
<header role="banner">
|
||||||
<div class="navbar navbar-expand-lg fixed-top navbar-dark bg-primary">
|
<div class="navbar navbar-expand-lg fixed-top <?php echo $settings->navbar_classes; ?>">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="<?php echo $settings->name_link; ?>">
|
<a class="navbar-brand" href="<?php echo $settings->name_link; ?>">
|
||||||
<?php echo $settings->name; ?>
|
<?php echo $settings->name; ?>
|
||||||
|
@ -29,6 +29,14 @@ final class Settings {
|
|||||||
// $this->name_link = 'https://example.com';
|
// $this->name_link = 'https://example.com';
|
||||||
$this->name_link = 'index.php';
|
$this->name_link = 'index.php';
|
||||||
|
|
||||||
|
// Here you can customize colors for the Bootstrap 4 theme that you are using.
|
||||||
|
// Bootstrap 4 themes have four sets of colors: primary, secondary, light and dark.
|
||||||
|
// Navbar classes: navbar-light, navbar-dark, bg-primary, bg-secondary, bg-light, bg-dark
|
||||||
|
// Badge (label) classes: badge, badge-pill, badge-primary, badge-secondary, badge-light, badge-dark
|
||||||
|
$this->navbar_classes = 'navbar-dark bg-primary';
|
||||||
|
$this->badge_classes = 'badge-pill badge-secondary';
|
||||||
|
$this->info_badge_classes = 'badge';
|
||||||
|
|
||||||
// Show server scope column?
|
// Show server scope column?
|
||||||
$this->show_server_scope = true;
|
$this->show_server_scope = true;
|
||||||
|
|
||||||
|
11
info.php
11
info.php
@ -151,6 +151,7 @@ if ($st->execute(array($id))) {
|
|||||||
|
|
||||||
$header = $page->name;
|
$header = $page->name;
|
||||||
$badges = "";
|
$badges = "";
|
||||||
|
$bc = $page->settings->info_badge_classes;
|
||||||
|
|
||||||
if (!($info instanceof KickInfo)) {
|
if (!($info instanceof KickInfo)) {
|
||||||
$active = $page->active($row);
|
$active = $page->active($row);
|
||||||
@ -163,19 +164,19 @@ if ($st->execute(array($id))) {
|
|||||||
$idx = "generic.ipmute";
|
$idx = "generic.ipmute";
|
||||||
}
|
}
|
||||||
if ($idx !== null) {
|
if ($idx !== null) {
|
||||||
$badges .= "<span class='badge litebans-label-info litebans-label-ipban'>" . $page->t($idx) . "</span>";
|
$badges .= "<span class='$bc litebans-label-info litebans-label-ipban'>" . $page->t($idx) . "</span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($active === true) {
|
if ($active === true) {
|
||||||
$badges .= "<span class='badge litebans-label-info litebans-label-active'>" . $page->t("generic.active") . "</span>";
|
$badges .= "<span class='$bc litebans-label-info litebans-label-active'>" . $page->t("generic.active") . "</span>";
|
||||||
if ($permanent) {
|
if ($permanent) {
|
||||||
$badges .= "<span class='badge litebans-label-info litebans-label-permanent'>" . $page->t("generic.permanent") . "</span>";
|
$badges .= "<span class='$bc litebans-label-info litebans-label-permanent'>" . $page->t("generic.permanent") . "</span>";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($page->is_expired($row)) {
|
if ($page->is_expired($row)) {
|
||||||
$badges .= "<span class='badge litebans-label-info litebans-label-expired'>" . $page->t("generic.expired") . "</span>";
|
$badges .= "<span class='$bc litebans-label-info litebans-label-expired'>" . $page->t("generic.expired") . "</span>";
|
||||||
} else {
|
} else {
|
||||||
$badges .= "<span class='badge litebans-label-info litebans-label-inactive'>" . $page->t("generic.inactive") . "</span>";
|
$badges .= "<span class='$bc litebans-label-info litebans-label-inactive'>" . $page->t("generic.inactive") . "</span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user