mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
- 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
74 lines
2.0 KiB
PHP
74 lines
2.0 KiB
PHP
<?php
|
|
|
|
if (!defined('AOWOW_REVISION'))
|
|
die('illegal access');
|
|
|
|
|
|
// Create 'profile_all.js'-file in static/js;
|
|
// this script requires all realms in use to be defined in auth.realmlist
|
|
// battlegroups has to be set in config file
|
|
|
|
/* Example
|
|
var mn_profiles = [
|
|
["us","US & Oceanic",,[
|
|
["bloodlust","Bloodlust",,[
|
|
["amanthul","Aman'Thul"],
|
|
["barthilas","Barthilas"]
|
|
]],
|
|
["cyclone","Cyclone",,[
|
|
["azjol-nerub","Azjol-Nerub"],
|
|
["bloodscalp","Bloodscalp"]
|
|
]]
|
|
]],
|
|
["eu","Europe",,[
|
|
["blackout","Blackout",,[
|
|
["agamaggan","Agamaggan"],
|
|
["aggramar","Aggramar"]
|
|
]],
|
|
["blutdurst","Blutdurst",,[
|
|
["aegwynn","Aegwynn"],
|
|
["destromath","Destromath"]
|
|
]]
|
|
]]
|
|
];
|
|
*/
|
|
|
|
function mnProfiles(/* &$log */)
|
|
{
|
|
$menu = [
|
|
["us", "US & Oceanic", null,[
|
|
[Util::urlize(CFG_BATTLEGROUP), CFG_BATTLEGROUP, null, []]
|
|
]],
|
|
["eu", "Europe", null,[
|
|
[Util::urlize(CFG_BATTLEGROUP), CFG_BATTLEGROUP, null, []]
|
|
]]
|
|
];
|
|
|
|
$rows = DB::Auth()->select('SELECT name, IF(timezone IN (8, 9, 10, 11, 12), "eu", "us") AS region FROM realmlist WHERE allowedSecurityLevel = 0');
|
|
$set = 0x0;
|
|
|
|
foreach ($rows as $row)
|
|
{
|
|
if ($row['region'] == 'eu')
|
|
{
|
|
$set |= 0x1;
|
|
$menu[1][3][0][3][] = [Util::urlize($row['name']),$row['name']];
|
|
}
|
|
else if ($row['region'] == 'us')
|
|
{
|
|
$set |= 0x2;
|
|
$menu[0][3][0][3][] = [Util::urlize($row['name']),$row['name']];
|
|
}
|
|
}
|
|
|
|
if (!($set & 0x1))
|
|
array_pop($menu);
|
|
|
|
if (!($set & 0x2))
|
|
array_shift($menu);
|
|
|
|
return json_encode($menu, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
|
|
}
|
|
|
|
?>
|