2013-09-09 13:41:08 +01:00
|
|
|
<?php
|
2014-02-18 07:24:26 +00:00
|
|
|
|
2019-05-28 17:59:38 +01:00
|
|
|
class HellBan extends Extension
|
|
|
|
{
|
|
|
|
public function onPageRequest(PageRequestEvent $event)
|
|
|
|
{
|
|
|
|
global $page, $user;
|
2013-09-09 13:41:08 +01:00
|
|
|
|
2019-07-09 09:10:21 -05:00
|
|
|
if ($user->can(Permissions::HELLBANNED)) {
|
2019-05-28 17:59:38 +01:00
|
|
|
$s = "";
|
2019-07-09 09:10:21 -05:00
|
|
|
} elseif ($user->can(Permissions::VIEW_HELLBANNED)) {
|
2019-05-28 17:59:38 +01:00
|
|
|
$s = "DIV.hb, TR.hb TD {border: 1px solid red !important;}";
|
|
|
|
} else {
|
|
|
|
$s = ".hb {display: none !important;}";
|
|
|
|
}
|
2013-09-09 13:41:08 +01:00
|
|
|
|
2019-05-28 17:59:38 +01:00
|
|
|
if ($s) {
|
|
|
|
$page->add_html_header("<style>$s</style>");
|
|
|
|
}
|
|
|
|
}
|
2013-09-09 13:41:08 +01:00
|
|
|
}
|