Files
aowow/index.php
Sarjuuk feaee59cd0 - converted articles for MorePages to use STATIC_URL (also neutralized some self-references)
- added config-option to restrict available locales
- fixed opensearch suggestions by generating strict json
- include TalentCalc.css as lowerCase (fixes display under *nix)
- some minor formating
- Setup:
 * added some additional files to be generated (they required STATIC_URL or HOST_URL to be set)
 * moved class Locale from global.js to own template and generate it with CFG_LOCALES
 * changed urlParam (?build=script): may be empty (builds everything) or specific scriptNames chained together with ; (?build=script1;script2)

you are required to run the following command to regenerate files affected by these cahnges
?build=demo;power;realmMenu;searchboxBody;searchboxScript;searchplugin;locales
2014-09-13 23:26:01 +02:00

153 lines
4.9 KiB
PHP

<?php
define('AOWOW_REVISION', 12);
if (!file_exists('config/config.php'))
{
$cwDir = /*$_SERVER['DOCUMENT_ROOT']; //*/getcwd();
require 'setup/setup.php';
exit;
}
// include all necessities, set up basics
require 'includes/kernel.php';
if (version_compare(PHP_VERSION, '5.5.0') <= 0)
{
if (User::isInGroup(U_GROUP_EMPLOYEE))
Util::addNote(U_GROUP_EMPLOYEE, 'PHP Version 5.5.0 or higher required! Your version is '.PHP_VERSION."[br]Core functions are unavailable!");
else
(new GenericPage)->maintenance();
}
$altClass = '';
switch ($pageCall)
{
/* called by user */
case '': // no parameter given -> MainPage
$altClass = 'home';
case 'account': // account management [nyi]
case 'achievement':
case 'achievements':
// case 'arena-team':
// case 'arena-teams':
case 'class':
case 'classes':
case 'currency':
case 'currencies':
case 'compare': // tool: item comparison
case 'event':
case 'events':
case 'faction':
case 'factions':
// case 'guild':
// case 'guilds':
case 'item':
case 'items':
case 'itemset':
case 'itemsets':
case 'maps': // tool: map listing
case 'npc':
case 'npcs':
case 'object':
case 'objects':
case 'pet':
case 'pets':
case 'petcalc': // tool: pet talent calculator
if ($pageCall == 'petcalc')
$altClass = 'talent';
case 'profile': // character profiler [nyi]
case 'profiles': // character profile listing [nyi]
case 'profiler': // character profiler main page
case 'quest':
case 'quests':
case 'race':
case 'races':
case 'search': // tool: searches
case 'skill':
case 'skills':
// case 'sound': // db: sounds for zone, creature, spell, ...
// case 'sounds':
case 'spell':
case 'spells':
case 'talent': // tool: talent calculator
case 'title':
case 'titles':
// case 'user': // tool: user profiles [nyi]
case 'zone':
case 'zones':
if (in_array($pageCall, ['account', 'profile']))
{
if (($_ = (new AjaxHandler($pageParam))->handle($pageCall)) !== null)
{
header('Content-type: application/x-javascript; charset=utf-8');
die((string)$_);
}
}
$_ = ($altClass ?: $pageCall).'Page';
(new $_($pageCall, $pageParam))->display();
break;
/* other pages */
case 'whats-new':
case 'searchplugins':
case 'searchbox':
case 'tooltips':
case 'help':
case 'faq':
case 'aboutus':
(new MorePage($pageCall, $pageParam))->display();
break;
case 'latest-additions':
case 'latest-articles':
case 'latest-comments':
case 'latest-screenshots':
case 'latest-videos':
case 'unrated-comments':
case 'missing-screenshots':
case 'most-comments':
case 'random':
(new UtilityPage($pageCall, $pageParam))->display();
break;
/* called by script */
case 'data': // tool: dataset-loader
case 'cookie': // lossless cookies and user settings
case 'contactus':
case 'comment':
case 'go-to-comment': // find page the comment is on and forward
case 'locale': // subdomain-workaround, change the language
if (($_ = (new AjaxHandler($pageParam))->handle($pageCall)) !== null)
{
header('Content-type: application/x-javascript; charset=utf-8');
die((string)$_);
}
break;
/* setup */
case 'build':
if (User::isInGroup(U_GROUP_EMPLOYEE))
{
require 'setup/tools/filegen/scriptGen.php';
break;
}
case 'sql':
if (User::isInGroup(U_GROUP_EMPLOYEE))
{
require 'setup/tools/database/_'.$pageParam.'.php';
break;
}
case 'setup':
if (User::isInGroup(U_GROUP_EMPLOYEE))
{
require 'setup/syncronize.php';
break;
}
default: // unk parameter given -> ErrorPage
if (isset($_GET['power']))
die('$WowheadPower.register(0, '.User::$localeId.', {})');
else // in conjunction with a proper rewriteRule in .htaccess...
(new GenericPage($pageCall))->error();
break;
}
?>