Files
pokemon-showdown-client/website/lib/panels.lib.php
Guangcong Luo d334977d8b Update to PHP 5 constructors
We had an old constructor in a library that was preventing an upgrade
to PHP 8.
2021-10-10 00:44:32 -04:00

75 lines
1.3 KiB
PHP

<?php
include_once dirname(__FILE__).'/../theme/wrapper.inc.php';
class Panels {
var $output = 'normal';
var $tab = false;
var $root;
var $name;
function __construct() {
global $psconfig;
if (@$psconfig['root']) $this->root = $psconfig['root'];
if (@$psconfig['name']) $this->name = $psconfig['name'];
switch (@$_REQUEST['output']) {
case 'html':
case 'json':
$this->output = $_REQUEST['output'];
break;
}
}
var $pagetitle = false;
function setPageTitle($title) {
if ($this->pagetitle === false) {
$this->pagetitle = $title;
}
}
var $pagedescription = false;
function setPageDescription($description) {
if ($this->pagedescription === false) {
$this->pagedescription = $description;
}
}
function setTab($tab) {
if ($this->tab === false) {
$this->tab = $tab;
}
}
var $depth = 0;
var $scriptsIncluded = false;
function start() {
$this->depth++;
if ($this->depth != 1) {
return;
}
if ($this->output === 'normal') {
ThemeHeaderTemplate();
}
}
function scripts() {
if ($this->output !== 'normal') return;
if ($this->scriptsIncluded) return;
$this->scriptsIncluded = true;
ThemeScriptsTemplate();
}
function end() {
$this->depth--;
if ($this->depth != 0) {
return;
}
if ($this->output === 'normal') {
ThemeFooterTemplate();
}
}
}
$panels = new Panels();