Profiler/Access

* load css/js even when profiler is disabled
 * do not display page speciffic announcements for overridden displays (e.g. Profiler help on maintenance, error, etc. display)
This commit is contained in:
Sarjuuk
2024-02-28 17:54:15 +01:00
parent 8b1fd3ac79
commit 611d2c40bd
2 changed files with 5 additions and 5 deletions

View File

@@ -579,7 +579,7 @@ class GenericPage
}
// get announcements and notes for user
private function addAnnouncements() : void
private function addAnnouncements(bool $pagespecific = true) : void
{
if (!isset($this->announcements))
$this->announcements = [];
@@ -603,7 +603,7 @@ class GenericPage
// fetch announcements
if ($this->pageTemplate['pageName'])
{
$ann = DB::Aowow()->Select('SELECT ABS(id) AS ARRAY_KEY, a.* FROM ?_announcements a WHERE status = 1 AND (page = ? OR page = "*") AND (groupMask = 0 OR groupMask & ?d)', $this->pageTemplate['pageName'], User::$groups);
$ann = DB::Aowow()->Select('SELECT ABS(id) AS ARRAY_KEY, a.* FROM ?_announcements a WHERE status = 1 AND (page = ? OR page = "*") AND (groupMask = 0 OR groupMask & ?d)', $pagespecific ? $this->pageTemplate['pageName'] : '', User::$groups);
foreach ($ann as $k => $v)
{
if ($t = Util::localizedString($v, 'text'))
@@ -744,7 +744,7 @@ class GenericPage
if ($override)
{
$this->addAnnouncements();
$this->addAnnouncements(false);
include('template/pages/'.$override.'.tpl.php');
die();

View File

@@ -30,6 +30,8 @@ class ProfilesPage extends GenericPage
{
$this->getSubjectFromUrl($pageParam);
parent::__construct($pageCall, $pageParam);
if (!CFG_PROFILER_ENABLE)
$this->error();
@@ -48,8 +50,6 @@ class ProfilesPage extends GenericPage
$this->filterObj = new ProfileListFilter(false, ['realms' => $realms]);
parent::__construct($pageCall, $pageParam);
$this->name = Util::ucFirst(Lang::game('profiles'));
$this->subCat = $pageParam ? '='.$pageParam : '';
}