mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
Add options to show server scope/origin in info.php.
Disable server scope column by default, since most people only use global bans.
This commit is contained in:
parent
8eb8ddac52
commit
205df0e285
@ -36,6 +36,12 @@ class Settings {
|
|||||||
// Show server origin column?
|
// Show server origin column?
|
||||||
$this->show_server_origin = false;
|
$this->show_server_origin = false;
|
||||||
|
|
||||||
|
// Show server scope column in info.php?
|
||||||
|
$this->info_show_server_scope = false;
|
||||||
|
|
||||||
|
// Show server origin column in info.php?
|
||||||
|
$this->info_show_server_origin = true;
|
||||||
|
|
||||||
// Show inactive bans? Removed bans will show (Unbanned), mutes will show (Unmuted), warnings will show (Expired).
|
// Show inactive bans? Removed bans will show (Unbanned), mutes will show (Unmuted), warnings will show (Expired).
|
||||||
$this->show_inactive_bans = true;
|
$this->show_inactive_bans = true;
|
||||||
|
|
||||||
|
24
info.php
24
info.php
@ -48,19 +48,23 @@ abstract class Info {
|
|||||||
function moderator_avatar() {
|
function moderator_avatar() {
|
||||||
$row = $this->row;
|
$row = $this->row;
|
||||||
$banner_name = $this->page->get_banner_name($row);
|
$banner_name = $this->page->get_banner_name($row);
|
||||||
return $this->page->get_avatar($banner_name, $row['banned_by_uuid'], true, $this->history_link($banner_name, $row['banned_by_uuid'], ":issued"), $name_left = false);
|
return $this->page->get_avatar($banner_name, $row['banned_by_uuid'], true, $this->history_link($banner_name, $row['banned_by_uuid'], ':issued'), $name_left = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function basic_info() {
|
function basic_info() {
|
||||||
return array(
|
$settings = $this->page->settings;
|
||||||
"table.player" => function (Info $info) { return $info->punished_avatar(); },
|
$table = array(
|
||||||
"table.executor" => function (Info $info) { return $info->moderator_avatar(); },
|
'table.player' => function (Info $info) { return $info->punished_avatar(); },
|
||||||
"table.reason" => function (Info $info) { return $info->page->clean($info->row['reason']); },
|
'table.executor' => function (Info $info) { return $info->moderator_avatar(); },
|
||||||
"table.date" => function (Info $info) { return $info->page->millis_to_date($info->row['time']); },
|
'table.reason' => function (Info $info) { return $info->page->clean($info->row['reason']); },
|
||||||
"table.expires" => function (Info $info) { return $info->page->expiry($info->row); },
|
'table.date' => function (Info $info) { return $info->page->millis_to_date($info->row['time']); },
|
||||||
"table.server.scope" => function (Info $info) { return $info->page->server($info->row); },
|
'table.expires' => function (Info $info) { return $info->page->expiry($info->row); },
|
||||||
"table.server.origin" => function (Info $info) { return $info->page->server($info->row, "server_origin"); },
|
'table.server.scope' => function (Info $info) { return $info->page->server($info->row); },
|
||||||
|
'table.server.origin' => function (Info $info) { return $info->page->server($info->row, "server_origin"); },
|
||||||
);
|
);
|
||||||
|
if (!$settings->info_show_server_scope) unset($table['table.server.scope']);
|
||||||
|
if (!$settings->info_show_server_origin) unset($table['table.server.origin']);
|
||||||
|
return $table;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +77,7 @@ class WarnInfo extends Info {}
|
|||||||
class KickInfo extends Info {
|
class KickInfo extends Info {
|
||||||
function basic_info() {
|
function basic_info() {
|
||||||
$array = parent::basic_info();
|
$array = parent::basic_info();
|
||||||
unset($array["table.expires"]); // kicks do not expire
|
unset($array['table.expires']); // kicks do not expire
|
||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user