Files
pokemon-showdown-client/replays/theme/panels.lib.php
Guangcong Luo 029b691be1 Add replay database code to version control (#1301)
This required a new architecture for serving replays from inside the
client repository, because that seems like a better call than
introducing yet another PS repository.

(Experience gives me the impression that separating repositories wasn't
a good idea, and we should be working to make PS more mono-repo-like,
rather than less.)

License for replay code is tentatively AGPLv3, although feel free to ask
for a more permissive license if you have plans to use it in an
open-source project that requires it.
2019-06-14 17:48:34 +09:00

78 lines
1.3 KiB
PHP

<?php
include_once dirname(__FILE__).'/wrapper.inc.php';
class Panels {
var $output = 'normal';
var $tab = false;
var $root;
var $name;
function __construct() {
global $psconfig;
$this->root = '/';
$this->name = 'Showdown';
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 noScripts() {
$this->scriptsIncluded = true;
}
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();