';
// dispelType (if applicable)
- if ($dispel = Lang::$game['dt'][$this->curTpl['dispelType']])
+ if ($dispel = Lang::game('dt', $this->curTpl['dispelType']))
$x .= '
'.$dispel.'
';
$x .= '';
@@ -1469,7 +1469,7 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
// duration
if ($this->curTpl['duration'] > 0)
- $x .= ''.sprintf(Lang::$spell['remaining'], Util::formatTime($this->curTpl['duration'])).'';
+ $x .= ''.sprintf(Lang::spell('remaining'), Util::formatTime($this->curTpl['duration'])).'';
$x .= '';
@@ -1506,7 +1506,7 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
// get stances (check: SPELL_ATTR2_NOT_NEED_SHAPESHIFT)
$stances = '';
if ($this->curTpl['stanceMask'] && !($this->curTpl['attributes2'] & 0x80000))
- $stances = Lang::$game['requires2'].' '.Lang::getStances($this->curTpl['stanceMask']);
+ $stances = Lang::game('requires2').' '.Lang::getStances($this->curTpl['stanceMask']);
// get item requirement (skip for professions)
$reqItems = '';
@@ -1576,7 +1576,7 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
if ($tools)
{
- $_ = Lang::$spell['tools'].':
';
+ $_ = Lang::spell('tools').':
';
while ($tool = array_pop($tools))
{
if (isset($tool['itemId']))
@@ -1597,7 +1597,7 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
if ($reagents)
{
- $_ = Lang::$spell['reagents'].':
';
+ $_ = Lang::spell('reagents').':
';
while ($reagent = array_pop($reagents))
{
$_ .= ''.$reagent[2].'';
@@ -1611,7 +1611,7 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
}
if ($reqItems)
- $xTmp[] = Lang::$game['requires2'].' '.$reqItems;
+ $xTmp[] = Lang::game('requires2').' '.$reqItems;
if ($desc[0])
$xTmp[] = ''.$desc[0].'';
diff --git a/includes/types/title.class.php b/includes/types/title.class.php
index a6e3f48d..4efa39bc 100644
--- a/includes/types/title.class.php
+++ b/includes/types/title.class.php
@@ -156,7 +156,7 @@ class TitleList extends BaseType
public function getHtmlizedName($gender = GENDER_MALE)
{
$field = $gender == GENDER_FEMALE ? 'female' : 'male';
- return str_replace('%s', '<'.Util::ucFirst(Lang::$main['name']).'>', $this->getField($field, true));
+ return str_replace('%s', '<'.Util::ucFirst(Lang::main('name')).'>', $this->getField($field, true));
}
public function renderTooltip() { }
diff --git a/includes/utilities.php b/includes/utilities.php
index c8cfb807..ec0a5a34 100644
--- a/includes/utilities.php
+++ b/includes/utilities.php
@@ -813,45 +813,45 @@ class Util
if ($short)
{
if ($_ = round($s['d'] / 364))
- return $_." ".Lang::$timeUnits['ab'][0];
+ return $_." ".Lang::timeUnits('ab', 0);
if ($_ = round($s['d'] / 30))
- return $_." ".Lang::$timeUnits['ab'][1];
+ return $_." ".Lang::timeUnits('ab', 1);
if ($_ = round($s['d'] / 7))
- return $_." ".Lang::$timeUnits['ab'][2];
+ return $_." ".Lang::timeUnits('ab', 2);
if ($_ = round($s['d']))
- return $_." ".Lang::$timeUnits['ab'][3];
+ return $_." ".Lang::timeUnits('ab', 3);
if ($_ = round($s['h']))
- return $_." ".Lang::$timeUnits['ab'][4];
+ return $_." ".Lang::timeUnits('ab', 4);
if ($_ = round($s['m']))
- return $_." ".Lang::$timeUnits['ab'][5];
+ return $_." ".Lang::timeUnits('ab', 5);
if ($_ = round($s['s'] + $s['ms'] / 1000, 2))
- return $_." ".Lang::$timeUnits['ab'][6];
+ return $_." ".Lang::timeUnits('ab', 6);
if ($s['ms'])
- return $s['ms']." ".Lang::$timeUnits['ab'][7];
+ return $s['ms']." ".Lang::timeUnits('ab', 7);
- return '0 '.Lang::$timeUnits['ab'][6];
+ return '0 '.Lang::timeUnits('ab', 6);
}
else
{
$_ = $s['d'] + $s['h'] / 24;
if ($_ > 1 && !($_ % 364)) // whole years
- return round(($s['d'] + $s['h'] / 24) / 364, 2)." ".Lang::$timeUnits[$s['d'] / 364 == 1 && !$s['h'] ? 'sg' : 'pl'][0];
+ return round(($s['d'] + $s['h'] / 24) / 364, 2)." ".Lang::timeUnits($s['d'] / 364 == 1 && !$s['h'] ? 'sg' : 'pl', 0);
if ($_ > 1 && !($_ % 30)) // whole month
- return round(($s['d'] + $s['h'] / 24) / 30, 2)." ".Lang::$timeUnits[$s['d'] / 30 == 1 && !$s['h'] ? 'sg' : 'pl'][1];
+ return round(($s['d'] + $s['h'] / 24) / 30, 2)." ".Lang::timeUnits($s['d'] / 30 == 1 && !$s['h'] ? 'sg' : 'pl', 1);
if ($_ > 1 && !($_ % 7)) // whole weeks
- return round(($s['d'] + $s['h'] / 24) / 7, 2)." ".Lang::$timeUnits[$s['d'] / 7 == 1 && !$s['h'] ? 'sg' : 'pl'][2];
+ return round(($s['d'] + $s['h'] / 24) / 7, 2)." ".Lang::timeUnits($s['d'] / 7 == 1 && !$s['h'] ? 'sg' : 'pl', 2);
if ($s['d'])
- return round($s['d'] + $s['h'] / 24, 2)." ".Lang::$timeUnits[$s['d'] == 1 && !$s['h'] ? 'sg' : 'pl'][3];
+ return round($s['d'] + $s['h'] / 24, 2)." ".Lang::timeUnits($s['d'] == 1 && !$s['h'] ? 'sg' : 'pl', 3);
if ($s['h'])
- return round($s['h'] + $s['m'] / 60, 2)." ".Lang::$timeUnits[$s['h'] == 1 && !$s['m'] ? 'sg' : 'pl'][4];
+ return round($s['h'] + $s['m'] / 60, 2)." ".Lang::timeUnits($s['h'] == 1 && !$s['m'] ? 'sg' : 'pl', 4);
if ($s['m'])
- return round($s['m'] + $s['s'] / 60, 2)." ".Lang::$timeUnits[$s['m'] == 1 && !$s['s'] ? 'sg' : 'pl'][5];
+ return round($s['m'] + $s['s'] / 60, 2)." ".Lang::timeUnits($s['m'] == 1 && !$s['s'] ? 'sg' : 'pl', 5);
if ($s['s'])
- return round($s['s'] + $s['ms'] / 1000, 2)." ".Lang::$timeUnits[$s['s'] == 1 && !$s['ms'] ? 'sg' : 'pl'][6];
+ return round($s['s'] + $s['ms'] / 1000, 2)." ".Lang::timeUnits($s['s'] == 1 && !$s['ms'] ? 'sg' : 'pl', 6);
if ($s['ms'])
- return $s['ms']." ".Lang::$timeUnits[$s['ms'] == 1 ? 'sg' : 'pl'][7];
+ return $s['ms']." ".Lang::timeUnits($s['ms'] == 1 ? 'sg' : 'pl', 7);
- return '0 '.Lang::$timeUnits['pl'][6];
+ return '0 '.Lang::timeUnits('pl', 6);
}
}
@@ -960,12 +960,12 @@ class Util
$text = preg_replace($from, $to, $text);
$pairs = array(
- '$c' => '<'.Lang::$game['class'].'>',
- '$C' => '<'.Lang::$game['class'].'>',
- '$r' => '<'.Lang::$game['race'].'>',
- '$R' => '<'.Lang::$game['race'].'>',
- '$n' => '<'.Lang::$main['name'].'>',
- '$N' => '<'.Lang::$main['name'].'>',
+ '$c' => '<'.Lang::game('class').'>',
+ '$C' => '<'.Lang::game('class').'>',
+ '$r' => '<'.Lang::game('race').'>',
+ '$R' => '<'.Lang::game('race').'>',
+ '$n' => '<'.Lang::main('name').'>',
+ '$N' => '<'.Lang::main('name').'>',
'$b' => ' ',
'$B' => ' ',
'|n' => '' // what .. the fuck .. another type of line terminator? (only in spanish though)
@@ -1084,7 +1084,7 @@ class Util
if (!in_array($type, array(ITEM_MOD_DEFENSE_SKILL_RATING, ITEM_MOD_EXPERTISE_RATING)))
$result .= '%';
- return sprintf(Lang::$item['ratingString'], ''.$result, ''.$level);
+ return sprintf(Lang::item('ratingString'), ''.$result, ''.$level);
}
public static function powerUseLocale($domain = 'www')
diff --git a/localization/lang.class.php b/localization/lang.class.php
index 29899580..c21c8a70 100644
--- a/localization/lang.class.php
+++ b/localization/lang.class.php
@@ -2,28 +2,28 @@
class Lang
{
- public static $timeUnits;
- public static $main;
- public static $account;
- public static $mail;
- public static $game;
+ private static $timeUnits;
+ private static $main;
+ private static $account;
+ private static $mail;
+ private static $game;
- public static $achievement;
- public static $class;
- public static $currency;
- public static $event;
- public static $faction;
- public static $gameObject;
- public static $item;
- public static $itemset;
- public static $maps;
- public static $npc;
- public static $pet;
- public static $quest;
- public static $skill;
- public static $spell;
- public static $title;
- public static $zone;
+ private static $achievement;
+ private static $class;
+ private static $currency;
+ private static $event;
+ private static $faction;
+ private static $gameObject;
+ private static $item;
+ private static $itemset;
+ private static $maps;
+ private static $npc;
+ private static $pet;
+ private static $quest;
+ private static $skill;
+ private static $spell;
+ private static $title;
+ private static $zone;
public static function load($loc)
{
@@ -44,13 +44,19 @@ class Lang
public static function __callStatic($name, $args)
{
if (!isset(self::$$name))
+ {
+ Util::addNote(U_GROUP_STAFF, 'Lang: tried to use undefined property Lang::$'.$name);
return null;
+ }
$var = self::$$name;
foreach ($args as $key)
{
if (!isset($var[$key]))
+ {
+ Util::addNote(U_GROUP_STAFF, 'Lang: undefined key "'.$key.'" in property Lang::$'.$name.'. Full key chain: '.implode(', ', $args));
return null;
+ }
$var = $var[$key];
}
@@ -64,13 +70,13 @@ class Lang
$tmp = [];
if ($flags & CUSTOM_DISABLED)
- $tmp[] = '[tooltip name=disabledHint]'.Util::jsEscape(self::$main['disabledHint']).'[/tooltip][span class=tip tooltip=disabledHint]'.Util::jsEscape(self::$main['disabled']).'[/span]';
+ $tmp[] = '[tooltip name=disabledHint]'.Util::jsEscape(self::main('disabledHint')).'[/tooltip][span class=tip tooltip=disabledHint]'.Util::jsEscape(self::main('disabled')).'[/span]';
if ($flags & CUSTOM_SERVERSIDE)
- $tmp[] = '[tooltip name=serversideHint]'.Util::jsEscape(self::$main['serversideHint']).'[/tooltip][span class=tip tooltip=serversideHint]'.Util::jsEscape(self::$main['serverside']).'[/span]';
+ $tmp[] = '[tooltip name=serversideHint]'.Util::jsEscape(self::main('serversideHint')).'[/tooltip][span class=tip tooltip=serversideHint]'.Util::jsEscape(self::main('serverside')).'[/span]';
if ($flags & CUSTOM_UNAVAILABLE)
- $tmp[] = self::$main['unavailable'];
+ $tmp[] = self::main('unavailable');
if ($flags & CUSTOM_EXCLUDE_FOR_LISTVIEW && User::isInGroup(U_GROUP_STAFF))
$tmp[] = '[tooltip name=excludedHint]This entry is excluded from lists and is not searchable.[/tooltip][span tooltip=excludedHint class="tip q10"]Hidden[/span]';
@@ -106,7 +112,7 @@ class Lang
if (!in_array($prop, [1, 2, 3, 4, 9, 16, 20]))
continue;
- $name = Lang::$spell['lockType'][$prop];
+ $name = self::spell('lockType', $prop);
if (!$name)
continue;
@@ -131,7 +137,7 @@ class Lang
else
continue;
- $locks[$lock['type'.$i] == 1 ? $prop : -$prop] = sprintf(Lang::$game['requires'], $name);
+ $locks[$lock['type'.$i] == 1 ? $prop : -$prop] = sprintf(self::game('requires'), $name);
}
return $locks;
@@ -141,7 +147,7 @@ class Lang
{
$_ = Util::getReputationLevelForPoints($pts);
- return self::$game['rep'][$_];
+ return self::game('rep', $_);
}
public static function getRequiredItems($class, $mask, $short = true)
@@ -164,16 +170,16 @@ class Lang
if ($class == ITEM_CLASS_WEAPON && ($mask & 0x1DE5FF) == 0x1DE5FF)
return '';
- foreach (Lang::$spell['subClassMasks'] as $m => $str)
+ foreach (self::spell('subClassMasks') as $m => $str)
if ($mask == $m)
return $str;
}
if ($class == ITEM_CLASS_MISC) // yeah hardcoded.. sue me!
- return Lang::$spell['cat'][-5];
+ return self::spell('cat', -5);
$tmp = [];
- $strs = Lang::$spell[$class == ITEM_CLASS_ARMOR ? 'armorSubClass' : 'weaponSubClass'];
+ $strs = self::spell($class == ITEM_CLASS_ARMOR ? 'armorSubClass' : 'weaponSubClass');
foreach ($strs as $k => $str)
if ($mask & (1 << $k) && $str)
$tmp[] = $str;
@@ -192,7 +198,7 @@ class Lang
{
if ($stanceMask & (1 << ($i - 1)))
{
- $tmp[] = self::$game['st'][$i];
+ $tmp[] = self::game('st', $i);
$stanceMask &= ~(1 << ($i - 1));
}
$i++;
@@ -211,7 +217,7 @@ class Lang
{
if ($schoolMask & (1 << $i))
{
- $tmp[] = self::$game['sc'][$i];
+ $tmp[] = self::game('sc', $i);
$schoolMask &= ~(1 << $i);
}
$i++;
@@ -236,7 +242,7 @@ class Lang
{
if ($classMask & (1 << ($i - 1)))
{
- $tmp[$i] = (!fMod(count($tmp) + 1, 3) ? $br : null).sprintf($base, $i, self::$game['cl'][$i]);
+ $tmp[$i] = (!fMod(count($tmp) + 1, 3) ? $br : null).sprintf($base, $i, self::game('cl', $i));
$classMask &= ~(1 << ($i - 1));
}
$i++;
@@ -263,7 +269,7 @@ class Lang
if (!$raceMask)
{
$side |= SIDE_BOTH;
- return self::$game['ra'][0];
+ return self::game('ra', 0);
}
if ($raceMask & RACE_MASK_HORDE)
@@ -273,16 +279,16 @@ class Lang
$side |= SIDE_ALLIANCE;
if ($raceMask == RACE_MASK_HORDE)
- return self::$game['ra'][-2];
+ return self::game('ra', -2);
if ($raceMask == RACE_MASK_ALLIANCE)
- return self::$game['ra'][-1];
+ return self::game('ra', -1);
while ($raceMask)
{
if ($raceMask & (1 << ($i - 1)))
{
- $tmp[$i] = (!fMod(count($tmp) + 1, 3) ? $br : null).sprintf($base, $i, self::$game['ra'][$i]);
+ $tmp[$i] = (!fMod(count($tmp) + 1, 3) ? $br : null).sprintf($base, $i, self::game('ra', $i));
$raceMask &= ~(1 << ($i - 1));
}
$i++;
diff --git a/pages/account.php b/pages/account.php
index 59185fa4..2f83eb44 100644
--- a/pages/account.php
+++ b/pages/account.php
@@ -78,7 +78,7 @@ class AccountPage extends GenericPage
if ($this->createRecoverPass($nStep)) // location-header after final step
header('Location: ?account=signin', true, 302);
- $this->head = sprintf(Lang::$account['recoverPass'], $nStep);
+ $this->head = sprintf(Lang::account('recoverPass'), $nStep);
break;
case 'forgotusername':
if (CFG_AUTH_MODE != AUTH_MODE_SELF) // only recover own accounts
@@ -90,16 +90,16 @@ class AccountPage extends GenericPage
if ($this->_post['email'])
{
if (!Util::isValidEmail($this->_post['email']))
- $this->error = Lang::$account['emailInvalid'];
+ $this->error = Lang::account('emailInvalid');
else if (!DB::Aowow()->selectCell('SELECT 1 FROM ?_account WHERE email = ?', $this->_post['email']))
- $this->error = Lang::$account['emailNotFound'];
+ $this->error = Lang::account('emailNotFound');
else if ($err = $this->doRecoverUser())
$this->error = $err;
else
- $this->text = sprintf(Lang::$account['recovUserSent']. $this->_post['email']);
+ $this->text = sprintf(Lang::account('recovUserSent'). $this->_post['email']);
}
- $this->head = Lang::$account['recoverUser'];
+ $this->head = Lang::account('recoverUser');
break;
case 'signin':
$this->tpl = 'acc-signIn';
@@ -131,7 +131,7 @@ class AccountPage extends GenericPage
else
{
$nStep = 1.5;
- $this->text = sprintf(Lang::$account['createAccSent'], $this->_post['email']);
+ $this->text = sprintf(Lang::account('createAccSent'), $this->_post['email']);
}
}
else if (!empty($_GET['token']) && ($newId = DB::Aowow()->selectCell('SELECT id FROM ?_account WHERE status = ?d AND token = ?', ACC_STATUS_NEW, $_GET['token'])))
@@ -142,12 +142,12 @@ class AccountPage extends GenericPage
Util::gainSiteReputation($newId, SITEREP_ACTION_REGISTER);
- $this->text = sprintf(Lang::$account['accActivated'], $_GET['token']);
+ $this->text = sprintf(Lang::account('accActivated'), $_GET['token']);
}
else
$this->next = $this->getNext();
- $this->head = sprintf(Lang::$account['register'], $nStep);
+ $this->head = sprintf(Lang::account('register'), $nStep);
break;
case 'signout':
User::destroy();
@@ -159,7 +159,7 @@ class AccountPage extends GenericPage
protected function generateTitle()
{
- $this->title = [Lang::$account['title']];
+ $this->title = [Lang::account('title')];
}
protected function generatePath() { }
@@ -177,17 +177,17 @@ class AccountPage extends GenericPage
/***********/
$infobox = [];
- $infobox[] = Lang::$account['joinDate']. Lang::$main['colon'].'[tooltip name=joinDate]'. date('l, G:i:s', $user['joinDate']). '[/tooltip][span class=tip tooltip=joinDate]'. date(Lang::$main['dateFmtShort'], $user['joinDate']). '[/span]';
- $infobox[] = Lang::$account['lastLogin'].Lang::$main['colon'].'[tooltip name=lastLogin]'.date('l, G:i:s', $user['prevLogin']).'[/tooltip][span class=tip tooltip=lastLogin]'.date(Lang::$main['dateFmtShort'], $user['prevLogin']).'[/span]';
- $infobox[] = Lang::$account['lastIP']. Lang::$main['colon'].$user['prevIP'];
- $infobox[] = Lang::$account['email']. Lang::$main['colon'].$user['email'];
+ $infobox[] = Lang::account('joinDate'). Lang::main('colon').'[tooltip name=joinDate]'. date('l, G:i:s', $user['joinDate']). '[/tooltip][span class=tip tooltip=joinDate]'. date(Lang::main('dateFmtShort'), $user['joinDate']). '[/span]';
+ $infobox[] = Lang::account('lastLogin').Lang::main('colon').'[tooltip name=lastLogin]'.date('l, G:i:s', $user['prevLogin']).'[/tooltip][span class=tip tooltip=lastLogin]'.date(Lang::main('dateFmtShort'), $user['prevLogin']).'[/span]';
+ $infobox[] = Lang::account('lastIP'). Lang::main('colon').$user['prevIP'];
+ $infobox[] = Lang::account('email'). Lang::main('colon').$user['email'];
$groups = [];
- foreach (Lang::$account['groups'] as $idx => $key)
+ foreach (Lang::account('groups') as $idx => $key)
if ($idx >= 0 && $user['userGroups'] & (1 << $idx))
- $groups[] = (!fMod(count($groups) + 1, 3) ? '[br]' : null).Lang::$account['groups'][$idx];
- $infobox[] = Lang::$account['userGroups'].Lang::$main['colon'].($groups ? implode(', ', $groups) : Lang::$account['groups'][-1]);
- $infobox[] = Util::ucFirst(Lang::$main['siteRep']).Lang::$main['colon'].User::getReputation();
+ $groups[] = (!fMod(count($groups) + 1, 3) ? '[br]' : null).Lang::account('groups', $idx);
+ $infobox[] = Lang::account('userGroups').Lang::main('colon').($groups ? implode(', ', $groups) : Lang::account('groups', -1));
+ $infobox[] = Util::ucFirst(Lang::main('siteRep')).Lang::main('colon').User::getReputation();
$this->infobox = '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]';
@@ -294,15 +294,15 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
if ($this->_post['email']) // step 1
{
if (!Util::isValidEmail($this->_post['email']))
- $this->error = Lang::$account['emailInvalid'];
+ $this->error = Lang::account('emailInvalid');
else if (!DB::Aowow()->selectCell('SELECT 1 FROM ?_account WHERE email = ?', $this->_post['email']))
- $this->error = Lang::$account['emailNotFound'];
+ $this->error = Lang::account('emailNotFound');
else if ($err = $this->doRecoverPass())
$this->error = $err;
else
{
$step = 1.5;
- $this->text = sprintf(Lang::$account['recovPassSent'], $this->_post['email']);
+ $this->text = sprintf(Lang::account('recovPassSent'), $this->_post['email']);
}
}
else if (isset($_GET['token'])) // step 2
@@ -330,17 +330,17 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
{
// check username
if (!User::isValidName($this->_post['username']))
- return Lang::$account['userNotFound'];
+ return Lang::account('userNotFound');
// check password
if (!User::isValidPass($this->_post['password']))
- return Lang::$account['wrongPass'];
+ return Lang::account('wrongPass');
switch (User::Auth($this->_post['username'], $this->_post['password']))
{
case AUTH_OK:
if (!User::$ip)
- return Lang::$main['intError'];
+ return Lang::main('intError');
// reset account status, update expiration
DB::Aowow()->query('UPDATE ?_account SET prevIP = IF(curIp = ?, prevIP, curIP), curIP = IF(curIp = ?, curIP, ?), allowExpire = ?d, status = 0, statusTimer = 0, token = "" WHERE user = ?',
@@ -356,22 +356,22 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
case AUTH_BANNED:
if (User::init())
User::save();
- return Lang::$account['accBanned'];
+ return Lang::account('accBanned');
case AUTH_WRONGUSER:
User::destroy();
- return Lang::$account['userNotFound'];
+ return Lang::account('userNotFound');
case AUTH_WRONGPASS:
User::destroy();
- return Lang::$account['wrongPass'];
+ return Lang::account('wrongPass');
case AUTH_ACC_INACTIVE:
User::destroy();
- return Lang::$account['accInactive'];
+ return Lang::account('accInactive');
case AUTH_IPBANNED:
User::destroy();
- return sprintf(Lang::$account['loginExceeded'], Util::formatTime(CFG_FAILED_AUTH_EXCLUSION * 1000));
+ return sprintf(Lang::account('loginExceeded'), Util::formatTime(CFG_FAILED_AUTH_EXCLUSION * 1000));
case AUTH_INTERNAL_ERR:
User::destroy();
- return Lang::$main['intError'];
+ return Lang::main('intError');
default:
return;
}
@@ -381,34 +381,34 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
{
// check username
if (!User::isValidName($this->_post['username'], $e))
- return Lang::$account[$e == 1 ? 'errNameLength' : 'errNameChars'];
+ return Lang::account($e == 1 ? 'errNameLength' : 'errNameChars');
// check password
if (!User::isValidPass($this->_post['password'], $e))
- return Lang::$account[$e == 1 ? 'errPassLength' : 'errPassChars'];
+ return Lang::account($e == 1 ? 'errPassLength' : 'errPassChars');
if ($this->_post['password'] != $this->_post['c_password'])
- return Lang::$account['passMismatch'];
+ return Lang::account('passMismatch');
// check email
if (!Util::isValidEmail($this->_post['email']))
- return Lang::$account['emailInvalid'];
+ return Lang::account('emailInvalid');
// check ip
if (!User::$ip)
- return Lang::$main['intError'];
+ return Lang::main('intError');
// limit account creation
$ip = DB::Aowow()->selectRow('SELECT ip, count, unbanDate FROM ?_account_bannedips WHERE type = 1 AND ip = ?', User::$ip);
if ($ip && $ip['count'] >= CFG_FAILED_AUTH_COUNT && $ip['unbanDate'] >= time())
{
DB::Aowow()->query('UPDATE ?_account_bannedips SET count = count + 1, unbanDate = UNIX_TIMESTAMP() + ?d WHERE ip = ? AND type = 1', CFG_FAILED_AUTH_EXCLUSION, User::$ip);
- return sprintf(Lang::$account['signupExceeded'], Util::formatTime(CFG_FAILED_AUTH_EXCLUSION * 1000));
+ return sprintf(Lang::account('signupExceeded'), Util::formatTime(CFG_FAILED_AUTH_EXCLUSION * 1000));
}
// username taken
if ($_ = DB::Aowow()->SelectCell('SELECT user FROM ?_account WHERE (user = ? OR email = ?) AND (status <> ?d OR (status = ?d AND statusTimer > UNIX_TIMESTAMP()))', $this->_post['username'], $email, ACC_STATUS_NEW, ACC_STATUS_NEW))
- return $_ == $this->_post['username'] ? Lang::$account['nameInUse'] : Lang::$account['mailInUse'];
+ return $_ == $this->_post['username'] ? Lang::account('nameInUse') : Lang::account('mailInUse');
// create..
$token = Util::createHash();
@@ -425,8 +425,8 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
$token
);
if (!$id) // something went wrong
- return Lang::$main['intError'];
- else if ($_ = $this->sendMail(Lang::$mail['accConfirm'][0], sprintf(Lang::$mail['accConfirm'][1], $token), CFG_ACCOUNT_CREATE_SAVE_DECAY))
+ return Lang::main('intError');
+ else if ($_ = $this->sendMail(Lang::mail('accConfirm', 0), sprintf(Lang::mail('accConfirm', 1), $token), CFG_ACCOUNT_CREATE_SAVE_DECAY))
{
// success:: update ip-bans
if (!$ip || $ip['unbanDate'] < time())
@@ -444,16 +444,16 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
return $_;
// send recovery mail
- return $this->sendMail(Lang::$mail['resetPass'][0], sprintf(Lang::$mail['resetPass'][1], $token), CFG_ACCOUNT_RECOVERY_DECAY);
+ return $this->sendMail(Lang::mail('resetPass', 0), sprintf(Lang::mail('resetPass', 1), $token), CFG_ACCOUNT_RECOVERY_DECAY);
}
private function doResetPass()
{
if ($this->_post['password'] != $this->_post['c_password'])
- return Lang::$account['passCheckFail'];
+ return Lang::account('passCheckFail');
if (!Util::isValidEmail($this->_post['email']))
- return Lang::$account['emailInvalid'];
+ return Lang::account('emailInvalid');
$uId = DB::Aowow()->selectCell('SELECT id FROM ?_account WHERE token = ? AND email = ? AND status = ?d AND statusTimer > UNIX_TIMESTAMP()',
$this->_post['token'],
@@ -461,13 +461,13 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
ACC_STATUS_RECOVER_PASS
);
if (!$uId)
- return Lang::$account['emailNotFound']; // assume they didn't meddle with the token
+ return Lang::account('emailNotFound'); // assume they didn't meddle with the token
if (!User::verifyCrypt($newPass))
- return Lang::$account['newPassDiff'];
+ return Lang::account('newPassDiff');
if (!DB::Aowow()->query('UPDATE ?_account SET passHash = ?, status = ?d WHERE id = ?d', User::hashcrypt($newPass), ACC_STATUS_OK, $uId))
- return Lang::$main['intError'];
+ return Lang::main('intError');
}
private function doRecoverUser()
@@ -476,35 +476,35 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
return $_;
// send recovery mail
- return $this->sendMail(Lang::$mail['recoverUser'][0], sprintf(Lang::$mail['recoverUser'][1], $token), CFG_ACCOUNT_RECOVERY_DECAY);
+ return $this->sendMail(Lang::mail('recoverUser', 0), sprintf(Lang::mail('recoverUser', 1), $token), CFG_ACCOUNT_RECOVERY_DECAY);
}
private function initRecovery($type, $delay, &$token)
{
if (!$type)
- return Lang::$main['intError'];
+ return Lang::main('intError');
// check if already processing
if ($_ = DB::Aowow()->selectCell('SELECT statusTimer - UNIX_TIMESTAMP() FROM ?_account WHERE email = ? AND status <> ?d AND statusTimer > UNIX_TIMESTAMP()', $this->_post['email'], ACC_STATUS_OK))
- return sprintf(lang::$account['isRecovering'], Util::formatTime($_ * 1000));
+ return sprintf(Lang::account('isRecovering'), Util::formatTime($_ * 1000));
// create new token and write to db
$token = Util::createHash();
if (!DB::Aowow()->query('UPDATE ?_account SET token = ?, status = ?d, statusTimer = UNIX_TIMESTAMP() + ?d WHERE email = ?', $token, $type, $delay, $this->_post['email']))
- return Lang::$main['intError'];
+ return Lang::main('intError');
}
private function sendMail($subj, $msg, $delay = 300)
{
// send recovery mail
- $subj = CFG_NAME_SHORT.Lang::$main['colon'] . $subj;
- $msg .= "\r\n\r\n".sprintf(Lang::$mail['tokenExpires'], Util::formatTime($delay * 1000))."\r\n";
+ $subj = CFG_NAME_SHORT.Lang::main('colon') . $subj;
+ $msg .= "\r\n\r\n".sprintf(Lang::mail('tokenExpires'), Util::formatTime($delay * 1000))."\r\n";
$header = 'From: '.CFG_CONTACT_EMAIL . "\r\n" .
'Reply-To: '.CFG_CONTACT_EMAIL . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if (!mail($this->_post['email'], $subj, $msg, $header))
- return sprintf(Lang::$main['intError2'], 'send mail');
+ return sprintf(Lang::main('intError2'), 'send mail');
}
private function getNext($forHeader = false)
diff --git a/pages/achievement.php b/pages/achievement.php
index 76ae9777..ed25622c 100644
--- a/pages/achievement.php
+++ b/pages/achievement.php
@@ -44,7 +44,7 @@ class AchievementPage extends GenericPage
$this->subject = new AchievementList(array(['id', $this->typeId]));
if ($this->subject->error)
- $this->notFound(Lang::$game['achievement']);
+ $this->notFound(Lang::game('achievement'));
$this->extendGlobalData($this->subject->getJSGlobals(GLOBALINFO_REWARDS));
@@ -68,7 +68,7 @@ class AchievementPage extends GenericPage
protected function generateTitle()
{
- array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::$game['achievement']));
+ array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::game('achievement')));
}
protected function generateContent()
@@ -81,7 +81,7 @@ class AchievementPage extends GenericPage
// points
if ($_ = $this->subject->getField('points'))
- $infobox[] = Lang::$achievement['points'].Lang::$main['colon'].'[achievementpoints='.$_.']';
+ $infobox[] = Lang::achievement('points').Lang::main('colon').'[achievementpoints='.$_.']';
// location
// todo (low)
@@ -90,13 +90,13 @@ class AchievementPage extends GenericPage
switch ($this->subject->getField('faction'))
{
case 1:
- $infobox[] = Lang::$main['side'].Lang::$main['colon'].'[span class=icon-alliance]'.Lang::$game['si'][SIDE_ALLIANCE].'[/span]';
+ $infobox[] = Lang::main('side').Lang::main('colon').'[span class=icon-alliance]'.Lang::game('si', SIDE_ALLIANCE).'[/span]';
break;
case 2:
- $infobox[] = Lang::$main['side'].Lang::$main['colon'].'[span class=icon-horde]'.Lang::$game['si'][SIDE_HORDE].'[/span]';
+ $infobox[] = Lang::main('side').Lang::main('colon').'[span class=icon-horde]'.Lang::game('si', SIDE_HORDE).'[/span]';
break;
default: // case 3
- $infobox[] = Lang::$main['side'].Lang::$main['colon'].Lang::$game['si'][SIDE_BOTH];
+ $infobox[] = Lang::main('side').Lang::main('colon').Lang::game('si', SIDE_BOTH);
}
// todo (low): crosslink with charactersDB to check if realmFirsts are still available
@@ -178,7 +178,7 @@ class AchievementPage extends GenericPage
$bar = new TitleList(array(['id', $foo]));
foreach ($bar->iterate() as $__)
- $this->rewards['title'][] = sprintf(Lang::$achievement['titleReward'], $bar->id, trim(str_replace('%s', '', $bar->getField('male', true))));
+ $this->rewards['title'][] = sprintf(Lang::achievement('titleReward'), $bar->id, trim(str_replace('%s', '', $bar->getField('male', true))));
}
$this->rewards['text'] = $this->subject->getField('reward', true);
@@ -190,13 +190,13 @@ class AchievementPage extends GenericPage
if (!$altAcv->error)
{
$this->transfer = sprintf(
- Lang::$achievement['_transfer'],
+ Lang::achievement('_transfer'),
$altAcv->id,
1, // quality
$altAcv->getField('iconString'),
$altAcv->getField('name', true),
$pendant > 0 ? 'alliance' : 'horde',
- $pendant > 0 ? Lang::$game['si'][1] : Lang::$game['si'][2]
+ $pendant > 0 ? Lang::game('si', 1) : Lang::game('si', 2)
);
}
}
@@ -276,7 +276,7 @@ class AchievementPage extends GenericPage
'href' => '?npc='.$obj,
'text' => $crtName,
);
- $tmp['extraText'] = Lang::$achievement['slain'];
+ $tmp['extraText'] = Lang::achievement('slain');
break;
// link to area (by map)
case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG:
@@ -326,7 +326,7 @@ class AchievementPage extends GenericPage
break;
// link to title - todo (low): crosslink
case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE:
- $tmp['extraText'] = Util::ucFirst(Lang::$game['title']).Lang::$main['colon'].$crtName;
+ $tmp['extraText'] = Util::ucFirst(Lang::game('title')).Lang::main('colon').$crtName;
break;
// link to achivement (/w icon)
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT:
@@ -491,7 +491,7 @@ class AchievementPage extends GenericPage
}
if ($_ = CreatureList::getName($this->subject->getField('sender')))
- $mail['sender'] = sprintf(Lang::$quest['mailBy'], $this->subject->getField('sender'), $_);
+ $mail['sender'] = sprintf(Lang::quest('mailBy'), $this->subject->getField('sender'), $_);
return $mail;
}
diff --git a/pages/achievements.php b/pages/achievements.php
index 51c5ca13..968e0937 100644
--- a/pages/achievements.php
+++ b/pages/achievements.php
@@ -47,7 +47,7 @@ class AchievementsPage extends GenericPage
parent::__construct($pageCall, $pageParam);
- $this->name = Util::ucFirst(Lang::$game['achievements']);
+ $this->name = Util::ucFirst(Lang::game('achievements'));
$this->subCat = $pageParam ? '='.$pageParam : '';
}
@@ -121,12 +121,12 @@ class AchievementsPage extends GenericPage
);
// sort for dropdown-menus in filter
- asort(Lang::$game['si']);
+ asort(Lang::game('si'));
}
protected function generateTitle()
{
- array_unshift($this->title, Util::ucFirst(Lang::$game['achievements']));
+ array_unshift($this->title, Util::ucFirst(Lang::game('achievements')));
if ($this->category)
{
$catrow = DB::Aowow()->SelectRow('SELECT * FROM ?_achievementcategory WHERE id = ?d', end($this->category));
diff --git a/pages/class.php b/pages/class.php
index 24e62ed0..d94963c6 100644
--- a/pages/class.php
+++ b/pages/class.php
@@ -26,7 +26,7 @@ class ClassPage extends GenericPage
$this->subject = new CharClassList(array(['id', $this->typeId]));
if ($this->subject->error)
- $this->notFound(Lang::$game['class']);
+ $this->notFound(Lang::game('class'));
$this->name = $this->subject->getField('name', true);
}
@@ -38,7 +38,7 @@ class ClassPage extends GenericPage
protected function generateTitle()
{
- array_unshift($this->title, $this->name, Util::ucFirst(Lang::$game['class']));
+ array_unshift($this->title, $this->name, Util::ucFirst(Lang::game('class')));
}
protected function generateContent()
@@ -56,27 +56,27 @@ class ClassPage extends GenericPage
// hero class
if ($this->subject->getField('flags') & 0x40)
- $infobox[] = '[tooltip=tooltip_heroclass]'.Lang::$game['heroClass'].'[/tooltip]';
+ $infobox[] = '[tooltip=tooltip_heroclass]'.Lang::game('heroClass').'[/tooltip]';
// resource
if ($this->typeId == 11) // special Druid case
- $infobox[] = Lang::$game['resources'].Lang::$main['colon'].
- '[tooltip name=powertype1]'.Lang::$game['st'][0].', '.Lang::$game['st'][31].', '.Lang::$game['st'][2].'[/tooltip][span class=tip tooltip=powertype1]'.Util::ucFirst(Lang::$spell['powerTypes'][0]).'[/span], '.
- '[tooltip name=powertype2]'.Lang::$game['st'][5].', '.Lang::$game['st'][8].'[/tooltip][span class=tip tooltip=powertype2]'.Util::ucFirst(Lang::$spell['powerTypes'][1]).'[/span], '.
- '[tooltip name=powertype8]'.Lang::$game['st'][1].'[/tooltip][span class=tip tooltip=powertype8]'.Util::ucFirst(Lang::$spell['powerTypes'][3]).'[/span]';
+ $infobox[] = Lang::game('resources').Lang::main('colon').
+ '[tooltip name=powertype1]'.Lang::game('st', 0).', '.Lang::game('st', 31).', '.Lang::game('st', 2).'[/tooltip][span class=tip tooltip=powertype1]'.Util::ucFirst(Lang::spell('powerTypes', 0)).'[/span], '.
+ '[tooltip name=powertype2]'.Lang::game('st', 5).', '.Lang::game('st', 8).'[/tooltip][span class=tip tooltip=powertype2]'.Util::ucFirst(Lang::spell('powerTypes', 1)).'[/span], '.
+ '[tooltip name=powertype8]'.Lang::game('st', 1).'[/tooltip][span class=tip tooltip=powertype8]'.Util::ucFirst(Lang::spell('powerTypes', 3)).'[/span]';
else if ($this->typeId == 6) // special DK case
- $infobox[] = Lang::$game['resources'].Lang::$main['colon'].'[span]'.Util::ucFirst(Lang::$spell['powerTypes'][5]).', '.Util::ucFirst(Lang::$spell['powerTypes'][$this->subject->getField('powerType')]).'[/span]';
+ $infobox[] = Lang::game('resources').Lang::main('colon').'[span]'.Util::ucFirst(Lang::spell('powerTypes', 5)).', '.Util::ucFirst(Lang::spell('powerTypes', $this->subject->getField('powerType'))).'[/span]';
else // regular case
- $infobox[] = Lang::$game['resource'].Lang::$main['colon'].'[span]'.Util::ucFirst(Lang::$spell['powerTypes'][$this->subject->getField('powerType')]).'[/span]';
+ $infobox[] = Lang::game('resource').Lang::main('colon').'[span]'.Util::ucFirst(Lang::spell('powerTypes', $this->subject->getField('powerType'))).'[/span]';
// roles
$roles = [];
for ($i = 0; $i < 4; $i++)
if ($this->subject->getField('roles') & (1 << $i))
- $roles[] = (count($roles) == 2 ? "\n" : '').Lang::$game['_roles'][$i];
+ $roles[] = (count($roles) == 2 ? "\n" : '').Lang::game('_roles', $i);
if ($roles)
- $infobox[] = (count($roles) > 1 ? Lang::$game['roles'] : Lang::$game['role']).Lang::$main['colon'].implode(', ', $roles);
+ $infobox[] = (count($roles) > 1 ? Lang::game('roles') : Lang::game('role')).Lang::main('colon').implode(', ', $roles);
// specs
$specList = [];
@@ -85,7 +85,7 @@ class ClassPage extends GenericPage
$specList[$k] = '[icon name='.$skills->getField('iconString').'][url=?spells=7.'.$this->typeId.'.'.$k.']'.$skills->getField('name', true).'[/url][/icon]';
if ($specList)
- $infobox[] = Lang::$game['specs'].Lang::$main['colon'].'[ul][li]'.implode('[/li][li]', $specList).'[/li][/ul]';
+ $infobox[] = Lang::game('specs').Lang::main('colon').'[ul][li]'.implode('[/li][li]', $specList).'[/li][/ul]';
/****************/
diff --git a/pages/classes.php b/pages/classes.php
index 4d262104..5b7da124 100644
--- a/pages/classes.php
+++ b/pages/classes.php
@@ -20,7 +20,7 @@ class ClassesPage extends GenericPage
{
parent::__construct($pageCall, $pageParam);
- $this->name = Util::ucFirst(Lang::$game['classes']);
+ $this->name = Util::ucFirst(Lang::game('classes'));
}
protected function generateContent()
@@ -38,7 +38,7 @@ class ClassesPage extends GenericPage
protected function generateTitle()
{
- array_unshift($this->title, Util::ucFirst(Lang::$game['classes']));
+ array_unshift($this->title, Util::ucFirst(Lang::game('classes')));
}
protected function generatePath() {}
diff --git a/pages/compare.php b/pages/compare.php
index 7b3e258a..de8f1ea9 100644
--- a/pages/compare.php
+++ b/pages/compare.php
@@ -35,7 +35,7 @@ class ComparePage extends GenericPage
else if (!empty($_COOKIE['compare_groups']))
$this->compareString = urldecode($_COOKIE['compare_groups']);
- $this->name = Lang::$main['compareTool'];
+ $this->name = Lang::main('compareTool');
}
protected function generateContent()
diff --git a/pages/currencies.php b/pages/currencies.php
index b718b12f..ba788a59 100644
--- a/pages/currencies.php
+++ b/pages/currencies.php
@@ -23,7 +23,7 @@ class CurrenciesPage extends GenericPage
parent::__construct($pageCall, $pageParam);
- $this->name = Util::ucFirst(Lang::$game['currencies']);
+ $this->name = Util::ucFirst(Lang::game('currencies'));
}
protected function generateContent()
@@ -48,7 +48,7 @@ class CurrenciesPage extends GenericPage
{
array_unshift($this->title, $this->name);
if ($this->category)
- array_unshift($this->title, Lang::$currency['cat'][$this->category[0]]);
+ array_unshift($this->title, Lang::currency('cat', $this->category[0]));
}
protected function generatePath()
diff --git a/pages/currency.php b/pages/currency.php
index 3f29f050..2e590169 100644
--- a/pages/currency.php
+++ b/pages/currency.php
@@ -25,7 +25,7 @@ class CurrencyPage extends GenericPage
$this->subject = new CurrencyList(array(['id', $this->typeId]));
if ($this->subject->error)
- $this->notFound(Lang::$game['currency']);
+ $this->notFound(Lang::game('currency'));
$this->name = $this->subject->getField('name', true);
}
@@ -37,7 +37,7 @@ class CurrencyPage extends GenericPage
protected function generateTitle()
{
- array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::$game['currency']));
+ array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::game('currency')));
}
protected function generateContent()
@@ -53,9 +53,9 @@ class CurrencyPage extends GenericPage
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
if ($this->typeId == 103) // Arena Points
- $infobox[] = Lang::$currency['cap'].Lang::$main['colon'].'10\'000';
+ $infobox[] = Lang::currency('cap').Lang::main('colon').'10\'000';
else if ($this->typeId == 104) // Honor
- $infobox[] = Lang::$currency['cap'].Lang::$main['colon'].'75\'000';
+ $infobox[] = Lang::currency('cap').Lang::main('colon').'75\'000';
/****************/
/* Main Content */
diff --git a/pages/event.php b/pages/event.php
index f58cb29f..11aff02a 100644
--- a/pages/event.php
+++ b/pages/event.php
@@ -30,7 +30,7 @@ class EventPage extends GenericPage
$this->subject = new WorldEventList($conditions);
if ($this->subject->error)
- $this->notFound(Lang::$game['event']);
+ $this->notFound(Lang::game('event'));
$this->hId = $this->subject->getField('holidayId');
$this->eId = $this->subject->getField('eventBak');
@@ -56,7 +56,7 @@ class EventPage extends GenericPage
protected function generateTitle()
{
- array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::$game['event']));
+ array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::game('event')));
}
protected function generateContent()
@@ -73,12 +73,12 @@ class EventPage extends GenericPage
if ($_ = $this->subject->getField('bossCreature'))
{
$this->extendGlobalIds(TYPE_NPC, $_);
- $this->infobox[] = Lang::$npc['rank'][3].Lang::$main['colon'].'[npc='.$_.']';
+ $this->infobox[] = Lang::npc('rank', 3).Lang::main('colon').'[npc='.$_.']';
}
// display internal id to staff
if (User::isInGroup(U_GROUP_STAFF))
- $this->infobox[] = 'Event-Id'.Lang::$main['colon'].$this->eId;
+ $this->infobox[] = 'Event-Id'.Lang::main('colon').$this->eId;
/****************/
/* Main Content */
@@ -274,19 +274,19 @@ class EventPage extends GenericPage
// start
if ($updated['start'])
- array_push($this->infobox, Lang::$event['start'].Lang::$main['colon'].date(Lang::$main['dateFmtLong'], $updated['start']));
+ array_push($this->infobox, Lang::event('start').Lang::main('colon').date(Lang::main('dateFmtLong'), $updated['start']));
// end
if ($updated['end'])
- array_push($this->infobox, Lang::$event['end'].Lang::$main['colon'].date(Lang::$main['dateFmtLong'], $updated['end']));
+ array_push($this->infobox, Lang::event('end').Lang::main('colon').date(Lang::main('dateFmtLong'), $updated['end']));
// occurence
if ($updated['rec'] > 0)
- array_push($this->infobox, Lang::$event['interval'].Lang::$main['colon'].Util::formatTime($updated['rec'] * 1000));
+ array_push($this->infobox, Lang::event('interval').Lang::main('colon').Util::formatTime($updated['rec'] * 1000));
// in progress
if ($updated['start'] < time() && $updated['end'] > time())
- array_push($this->infobox, '[span class=q2]'.Lang::$event['inProgress'].'[/span]');
+ array_push($this->infobox, '[span class=q2]'.Lang::event('inProgress').'[/span]');
$this->infobox = '[ul][li]'.implode('[/li][li]', $this->infobox).'[/li][/ul]';
diff --git a/pages/events.php b/pages/events.php
index 778b9fe7..2d510fad 100644
--- a/pages/events.php
+++ b/pages/events.php
@@ -23,7 +23,7 @@ class EventsPage extends GenericPage
parent::__construct($pageCall, $pageParam);
- $this->name = Util::ucFirst(Lang::$game['events']);
+ $this->name = Util::ucFirst(Lang::game('events'));
}
protected function generateContent()
@@ -72,7 +72,7 @@ class EventsPage extends GenericPage
{
array_unshift($this->title, $this->name);
if ($this->category)
- array_unshift($this->title, Lang::$event['category'][$this->category[0]]);
+ array_unshift($this->title, Lang::event('category')[$this->category[0]]);
}
protected function generatePath()
diff --git a/pages/faction.php b/pages/faction.php
index bc94cff4..17e45ebe 100644
--- a/pages/faction.php
+++ b/pages/faction.php
@@ -25,7 +25,7 @@ class FactionPage extends GenericPage
$this->subject = new FactionList(array(['id', $this->typeId]));
if ($this->subject->error)
- $smarty->notFound(Lang::$game['faction']);
+ $smarty->notFound(Lang::game('faction'));
$this->name = $this->subject->getField('name', true);
}
@@ -43,7 +43,7 @@ class FactionPage extends GenericPage
protected function generateTitle()
{
- array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::$game['faction']));
+ array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::game('faction')));
}
protected function generateContent()
@@ -60,7 +60,7 @@ class FactionPage extends GenericPage
{
$this->extendGlobalIds(TYPE_NPC, $ids);
- $qmStr = Lang::$faction['quartermaster'].Lang::$main['colon'];
+ $qmStr = Lang::faction('quartermaster').Lang::main('colon');
if (count($ids) == 1)
$qmStr .= '[npc='.$ids[0].']';
@@ -78,7 +78,7 @@ class FactionPage extends GenericPage
// side if any
if ($_ = $this->subject->getField('side'))
- $infobox[] = Lang::$main['side'].Lang::$main['colon'].'[span class=icon-'.($_ == 1 ? 'alliance' : 'horde').']'.Lang::$game['si'][$_].'[/span]';
+ $infobox[] = Lang::main('side').Lang::main('colon').'[span class=icon-'.($_ == 1 ? 'alliance' : 'horde').']'.Lang::game('si', $_).'[/span]';
/****************/
/* Main Content */
@@ -117,10 +117,10 @@ class FactionPage extends GenericPage
$buff = '';
foreach ($spillover->iterate() as $spillId => $__)
if ($val = ($spillover->getField('spilloverRateIn') * $this->subject->getField('spilloverRateOut') * 100))
- $buff .= '[tr][td][faction='.$spillId.'][/td][td][span class=q'.($val > 0 ? '2]+' : '10]').$val.'%[/span][/td][td]'.Lang::$game['rep'][$spillover->getField('spilloverMaxRank')].'[/td][/tr]';
+ $buff .= '[tr][td][faction='.$spillId.'][/td][td][span class=q'.($val > 0 ? '2]+' : '10]').$val.'%[/span][/td][td]'.Lang::game('rep', $spillover->getField('spilloverMaxRank')).'[/td][/tr]';
if ($buff)
- $this->extraText .= '[h3 class=clear]'.Lang::$faction['spillover'].'[/h3][div margin=15px]'.Lang::$faction['spilloverDesc'].'[/div][table class=grid width=400px][tr][td width=150px][b]'.Util::ucFirst(Lang::$game['faction']).'[/b][/td][td width=100px][b]'.Lang::$spell['_value'].'[/b][/td][td width=150px][b]'.Lang::$faction['maxStanding'].'[/b][/td][/tr]'.$buff.'[/table]';
+ $this->extraText .= '[h3 class=clear]'.Lang::faction('spillover').'[/h3][div margin=15px]'.Lang::faction('spilloverDesc').'[/div][table class=grid width=400px][tr][td width=150px][b]'.Util::ucFirst(Lang::game('faction')).'[/b][/td][td width=100px][b]'.Lang::spell('_value').'[/b][/td][td width=150px][b]'.Lang::faction('maxStanding').'[/b][/td][/tr]'.$buff.'[/table]';
// reward rates (ultimately this should be calculated into each reward display)
@@ -134,12 +134,12 @@ class FactionPage extends GenericPage
switch ($k)
{
- case 'quest_rate': $buff .= '[tr][td]'.Lang::$game['quests'].Lang::$main['colon'].'[/td]'; break;
- case 'quest_daily_rate': $buff .= '[tr][td]'.Lang::$game['quests'].' ('.Lang::$quest['daily'].')'.Lang::$main['colon'].'[/td]'; break;
- case 'quest_weekly_rate': $buff .= '[tr][td]'.Lang::$game['quests'].' ('.Lang::$quest['weekly'].')'.Lang::$main['colon'].'[/td]'; break;
- case 'quest_monthly_rate': $buff .= '[tr][td]'.Lang::$game['quests'].' ('.Lang::$quest['monthly'].')'.Lang::$main['colon'].'[/td]'; break;
- case 'creature_rate': $buff .= '[tr][td]'.Lang::$game['npcs'].Lang::$main['colon'].'[/td]'; break;
- case 'spell_rate': $buff .= '[tr][td]'.Lang::$game['spells'].Lang::$main['colon'].'[/td]'; break;
+ case 'quest_rate': $buff .= '[tr][td]'.Lang::game('quests') .Lang::main('colon').'[/td]'; break;
+ case 'quest_daily_rate': $buff .= '[tr][td]'.Lang::game('quests').' ('.Lang::quest('daily').')' .Lang::main('colon').'[/td]'; break;
+ case 'quest_weekly_rate': $buff .= '[tr][td]'.Lang::game('quests').' ('.Lang::quest('weekly').')' .Lang::main('colon').'[/td]'; break;
+ case 'quest_monthly_rate': $buff .= '[tr][td]'.Lang::game('quests').' ('.Lang::quest('monthly').')'.Lang::main('colon').'[/td]'; break;
+ case 'creature_rate': $buff .= '[tr][td]'.Lang::game('npcs') .Lang::main('colon').'[/td]'; break;
+ case 'spell_rate': $buff .= '[tr][td]'.Lang::game('spells') .Lang::main('colon').'[/td]'; break;
}
$buff .= '[td width=35px align=right][span class=q'.($v < 1 ? '10]' : '2]+').intVal(($v - 1) * 100).'%[/span][/td][/tr]';
@@ -160,7 +160,7 @@ class FactionPage extends GenericPage
$altFac->id,
$altFac->getField('name', true),
$pendant > 0 ? 'alliance' : 'horde',
- $pendant > 0 ? Lang::$game['si'][1] : Lang::$game['si'][2]
+ $pendant > 0 ? Lang::game('si', 1) : Lang::game('si', 2)
);
}
}
diff --git a/pages/factions.php b/pages/factions.php
index 0d152da0..1cde6a3d 100644
--- a/pages/factions.php
+++ b/pages/factions.php
@@ -28,7 +28,7 @@ class FactionsPage extends GenericPage
parent::__construct($pageCall, $pageParam);
- $this->name = Util::ucFirst(Lang::$game['factions']);
+ $this->name = Util::ucFirst(Lang::game('factions'));
}
protected function generateContent()
@@ -71,11 +71,11 @@ class FactionsPage extends GenericPage
switch (count($this->category))
{
case 1:
- $t = Lang::$faction['cat'][$this->category[0]];
+ $t = Lang::faction('cat', $this->category[0]);
array_unshift($this->title, is_array($t) ? $t[0] : $t);
break;
case 2:
- array_unshift($this->title, Lang::$faction['cat'][$this->category[0]][$this->category[1]]);
+ array_unshift($this->title, Lang::faction('cat', $this->category[0], $this->category[1]));
break;
}
}
diff --git a/pages/genericPage.class.php b/pages/genericPage.class.php
index 9ce86e00..c2331a30 100644
--- a/pages/genericPage.class.php
+++ b/pages/genericPage.class.php
@@ -285,7 +285,7 @@ class GenericPage
$this->infobox = $article['quickInfo'];
if ($article['locale'] != User::$localeId)
- $this->article['params'] = ['prepend' => Util::jsEscape('