mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
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:
@@ -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();
|
||||
|
||||
@@ -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 : '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user