Pages/Scripts

* do not skip generic page constructor ... ever
This commit is contained in:
Sarjuuk
2023-04-15 11:40:10 +02:00
parent 5f708470fc
commit 14658a5016
8 changed files with 14 additions and 18 deletions

View File

@@ -25,6 +25,8 @@ class ArenaTeamPage extends GenericPage
public function __construct($pageCall, $pageParam)
{
parent::__construct($pageCall, $pageParam);
if (!CFG_PROFILER_ENABLE)
$this->error();
@@ -34,8 +36,6 @@ class ArenaTeamPage extends GenericPage
if (isset($params[1]))
$params[1] = Profiler::urlize($params[1]);
parent::__construct($pageCall, $pageParam);
if (count($params) == 1 && intval($params[0]))
{
$this->subject = new LocalArenaTeamList(array(['at.id', intval($params[0])]));

View File

@@ -25,6 +25,8 @@ class ArenaTeamsPage extends GenericPage
public function __construct($pageCall, $pageParam)
{
parent::__construct($pageCall, $pageParam);
if (!CFG_PROFILER_ENABLE)
$this->error();
@@ -43,8 +45,6 @@ class ArenaTeamsPage extends GenericPage
$this->sumSubjects += DB::Characters($idx)->selectCell('SELECT count(*) FROM arena_team');
}
parent::__construct($pageCall, $pageParam);
$this->name = Lang::profiler('arenaTeams');
$this->subCat = $pageParam ? '='.$pageParam : '';
}

View File

@@ -25,6 +25,8 @@ class GuildPage extends GenericPage
public function __construct($pageCall, $pageParam)
{
parent::__construct($pageCall, $pageParam);
if (!CFG_PROFILER_ENABLE)
$this->error();
@@ -34,8 +36,6 @@ class GuildPage extends GenericPage
if (isset($params[1]))
$params[1] = Profiler::urlize($params[1]);
parent::__construct($pageCall, $pageParam);
if (count($params) == 1 && intval($params[0]))
{
$this->subject = new LocalGuildList(array(['g.id', intval($params[0])]));

View File

@@ -21,6 +21,8 @@ class GuildsPage extends GenericPage
public function __construct($pageCall, $pageParam)
{
parent::__construct($pageCall, $pageParam);
if (!CFG_PROFILER_ENABLE)
$this->error();
@@ -39,8 +41,6 @@ class GuildsPage extends GenericPage
$this->sumSubjects += DB::Characters($idx)->selectCell('SELECT COUNT(*) FROM guild');
}
parent::__construct($pageCall, $pageParam);
$this->name = Lang::profiler('guilds');
$this->subCat = $pageParam ? '='.$pageParam : '';
}

View File

@@ -42,6 +42,8 @@ class ProfilePage extends GenericPage
public function __construct($pageCall, $pageParam)
{
parent::__construct($pageCall, $pageParam);
if (!CFG_PROFILER_ENABLE)
$this->error();
@@ -51,8 +53,6 @@ class ProfilePage extends GenericPage
if (isset($params[1]))
$params[1] = Profiler::urlize($params[1], true);
parent::__construct($pageCall, $pageParam);
// temp locale
if ($this->mode == CACHE_TYPE_TOOLTIP && $this->_get['domain'])
Util::powerUseLocale($this->_get['domain']);

View File

@@ -18,10 +18,10 @@ class ProfilerPage extends GenericPage
public function __construct($pageCall, $pageParam)
{
parent::__construct($pageCall, $pageParam);
if (!CFG_PROFILER_ENABLE)
$this->error();
parent::__construct($pageCall, $pageParam);
}
protected function generateContent()

View File

@@ -28,11 +28,11 @@ class ProfilesPage extends GenericPage
public function __construct($pageCall, $pageParam)
{
$this->getSubjectFromUrl($pageParam);
if (!CFG_PROFILER_ENABLE)
$this->error();
$this->getSubjectFromUrl($pageParam);
$realms = [];
foreach (Profiler::getRealms() as $idx => $r)
{

View File

@@ -62,10 +62,6 @@ class SearchPage extends GenericPage
public function __construct($pageCall, $pageParam)
{
// restricted access
if ($this->reqUGroup && !User::isInGroup($this->reqUGroup))
$this->error();
parent::__construct($pageCall, $pageParam); // just to set g_user and g_locale
$this->search =