From 27bc09f13633538dd232d4f3470738ee2a6edfba Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sun, 29 Mar 2015 00:46:46 +0100 Subject: [PATCH] bulk replacement: accesing locale strings by function --- includes/ajaxHandler.class.php | 20 +-- includes/types/achievement.class.php | 4 +- includes/types/basetype.class.php | 16 +-- includes/types/creature.class.php | 8 +- includes/types/item.class.php | 124 ++++++++-------- includes/types/profile.class.php | 2 +- includes/types/quest.class.php | 8 +- includes/types/spell.class.php | 82 +++++------ includes/types/title.class.php | 2 +- includes/utilities.php | 50 +++---- localization/lang.class.php | 80 ++++++----- pages/account.php | 102 +++++++------- pages/achievement.php | 24 ++-- pages/achievements.php | 6 +- pages/class.php | 24 ++-- pages/classes.php | 4 +- pages/compare.php | 2 +- pages/currencies.php | 4 +- pages/currency.php | 8 +- pages/event.php | 16 +-- pages/events.php | 4 +- pages/faction.php | 26 ++-- pages/factions.php | 6 +- pages/genericPage.class.php | 6 +- pages/item.php | 72 +++++----- pages/items.php | 52 +++---- pages/itemset.php | 26 ++-- pages/itemsets.php | 8 +- pages/maps.php | 2 +- pages/more.php | 2 +- pages/npc.php | 58 ++++---- pages/npcs.php | 8 +- pages/object.php | 46 +++--- pages/objects.php | 4 +- pages/pet.php | 8 +- pages/pets.php | 6 +- pages/profile.php | 8 +- pages/profiler.php | 2 +- pages/profiles.php | 6 +- pages/quest.php | 82 +++++------ pages/quests.php | 6 +- pages/race.php | 12 +- pages/races.php | 4 +- pages/screenshot.php | 40 +++--- pages/search.php | 2 +- pages/skill.php | 4 +- pages/skills.php | 4 +- pages/spell.php | 156 ++++++++++----------- pages/spells.php | 36 ++--- pages/talent.php | 2 +- pages/title.php | 16 +-- pages/titles.php | 6 +- pages/utility.php | 16 +-- pages/zone.php | 16 +-- pages/zones.php | 6 +- template/bricks/book.tpl.php | 2 +- template/bricks/contribute.tpl.php | 2 +- template/bricks/footer.tpl.php | 10 +- template/bricks/headerMenu.tpl.php | 6 +- template/bricks/infobox.tpl.php | 8 +- template/bricks/mail.tpl.php | 2 +- template/bricks/mapper.tpl.php | 6 +- template/bricks/reagentList.tpl.php | 6 +- template/bricks/redButtons.tpl.php | 24 ++-- template/bricks/rewards.tpl.php | 2 +- template/bricks/series.tpl.php | 2 +- template/bricks/tooltip.tpl.php | 2 +- template/pages/acc-dashboard.tpl.php | 12 +- template/pages/acc-recover.tpl.php | 12 +- template/pages/acc-signIn.tpl.php | 14 +- template/pages/acc-signUp.tpl.php | 12 +- template/pages/achievement.tpl.php | 12 +- template/pages/achievements.tpl.php | 20 +-- template/pages/admin/screenshots.tpl.php | 4 +- template/pages/detail-page-generic.tpl.php | 4 +- template/pages/home.tpl.php | 6 +- template/pages/item.tpl.php | 10 +- template/pages/items.tpl.php | 60 ++++---- template/pages/itemset.tpl.php | 12 +- template/pages/itemsets.tpl.php | 36 ++--- template/pages/maps.tpl.php | 36 ++--- template/pages/npc.tpl.php | 24 ++-- template/pages/npcs.tpl.php | 28 ++-- template/pages/object.tpl.php | 4 +- template/pages/objects.tpl.php | 12 +- template/pages/profiler.tpl.php | 18 +-- template/pages/profiles.tpl.php | 36 ++--- template/pages/quest.tpl.php | 42 +++--- template/pages/quests.tpl.php | 26 ++-- template/pages/screenshot.tpl.php | 10 +- template/pages/search.tpl.php | 10 +- template/pages/spell.tpl.php | 64 ++++----- template/pages/spells.tpl.php | 48 +++---- template/pages/talent.tpl.php | 2 +- template/pages/text-page-generic.tpl.php | 2 +- 95 files changed, 1000 insertions(+), 992 deletions(-) diff --git a/includes/ajaxHandler.class.php b/includes/ajaxHandler.class.php index fbc1c5bb..8990857b 100644 --- a/includes/ajaxHandler.class.php +++ b/includes/ajaxHandler.class.php @@ -394,7 +394,7 @@ class AjaxHandler case 'vote': // up, down and remove if (!User::$id || empty($this->get['id']) || empty($this->get['rating'])) { - $result = ['error' => 1, 'message' => Lang::$main['genericError']]; + $result = ['error' => 1, 'message' => Lang::main('genericError')]; break; } @@ -404,13 +404,13 @@ class AjaxHandler $val *= -1; if (User::getCurDailyVotes() <= 0) - $result = ['error' => 1, 'message' => Lang::$main['tooManyVotes']]; + $result = ['error' => 1, 'message' => Lang::main('tooManyVotes')]; else if (!$target || $val != $this->get['rating']) - $result = ['error' => 1, 'message' => Lang::$main['genericError']]; + $result = ['error' => 1, 'message' => Lang::main('genericError')]; else if (($val > 0 && !User::canUpvote()) || ($val < 0 && !User::canDownvote())) - $result = ['error' => 1, 'message' => Lang::$main['bannedRating']]; + $result = ['error' => 1, 'message' => Lang::main('bannedRating')]; if ($result) break; @@ -425,7 +425,7 @@ class AjaxHandler if (!$ok) { - $result = ['error' => 1, 'message' => Lang::$main['genericError']]; + $result = ['error' => 1, 'message' => Lang::main('genericError')]; break; } @@ -481,7 +481,7 @@ class AjaxHandler if ($ok) // this one is very special; as in: completely retarded return 'ok'; // the script expects the actual characters 'ok' not some string like "ok" - $result = Lang::$main['genericError']; + $result = Lang::main('genericError'); break; case 'show-replies': $result = empty($this->get['id']) ? [] : CommunityContent::getCommentReplies($this->get['id']); @@ -494,13 +494,13 @@ class AjaxHandler $result = 'Your reply has '.mb_strlen(@$this->post['body']).' characters and must have at least '.$_minRpl.' and at most '.$_maxRpl.'.'; else if (empty($this->post['commentId']) || !DB::Aowow()->selectCell('SELECT 1 FROM ?_comments WHERE id = ?d', $this->post['commentId'])) - $result = Lang::$main['genericError']; + $result = Lang::main('genericError'); else if (DB::Aowow()->query('INSERT INTO ?_comments (`userId`, `roles`, `body`, `date`, `replyTo`) VALUES (?d, ?d, ?, UNIX_TIMESTAMP(), ?d)', User::$id, User::$groups, $this->post['body'], $this->post['commentId'])) $result = CommunityContent::getCommentReplies($this->post['commentId']); else - $result = Lang::$main['genericError']; + $result = Lang::main('genericError'); break; case 'edit-reply': // also returns all replies on success @@ -508,7 +508,7 @@ class AjaxHandler $result = 'You are not allowed to reply.'; else if (empty($this->post['replyId']) || empty($this->post['commentId'])) - $result = Lang::$main['genericError']; + $result = Lang::main('genericError'); else if (empty($this->post['body']) || mb_strlen($this->post['body']) < $_minRpl || mb_strlen($this->post['body']) > $_maxRpl) $result = 'Your reply has '.mb_strlen(@$this->post['body']).' characters and must have at least '.$_minRpl.' and at most '.$_maxRpl.'.'; @@ -525,7 +525,7 @@ class AjaxHandler User::isInGroup(U_GROUP_MODERATOR) ? DBSIMPLE_SKIP : User::$id ); - $result = $ok ? CommunityContent::getCommentReplies($this->post['commentId']) : Lang::$main['genericError']; + $result = $ok ? CommunityContent::getCommentReplies($this->post['commentId']) : Lang::main('genericError'); break; case 'detach-reply': if (!User::isInGroup(U_GROUP_MODERATOR) || empty($this->post['id'])) diff --git a/includes/types/achievement.class.php b/includes/types/achievement.class.php index 405357d9..59d20f59 100644 --- a/includes/types/achievement.class.php +++ b/includes/types/achievement.class.php @@ -158,7 +158,7 @@ class AchievementList extends BaseType { // link to title - todo (low): crosslink case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE: - $crtName = Util::ucFirst(Lang::$game['title']).Lang::$main['colon'].$crtName; + $crtName = Util::ucFirst(Lang::game('title')).Lang::main('colon').$crtName; break; // link to quest case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: @@ -209,7 +209,7 @@ class AchievementList extends BaseType if ($criteria) { - $x .= '
'.Lang::$achievement['criteria'].':'; + $x .= '
'.Lang::achievement('criteria').':'; $x .= '
'.$criteria.'
'; } if ($description || $criteria) diff --git a/includes/types/basetype.class.php b/includes/types/basetype.class.php index 132064bc..703d975c 100644 --- a/includes/types/basetype.class.php +++ b/includes/types/basetype.class.php @@ -549,10 +549,10 @@ trait spawnHelper { foreach ($wPoints as $i => $p) { - $label = [Lang::$npc['waypoint'].Lang::$main['colon'].$p['point']]; + $label = [Lang::npc('waypoint').Lang::main('colon').$p['point']]; if ($p['wait']) - $label[] = Lang::$npc['wait'].Lang::$main['colon'].Util::formatTime($p['wait'], false); + $label[] = Lang::npc('wait').Lang::main('colon').Util::formatTime($p['wait'], false); $set = ['label' => '$
'.implode('
', $label).'
', 'type' => $wpIdx]; @@ -573,26 +573,26 @@ trait spawnHelper $label = []; if (User::isInGroup(U_GROUP_STAFF)) - $label[] = $s['guid'] < 0 ? 'Vehicle Accessory' : 'GUID'.Lang::$main['colon'].$s['guid']; + $label[] = $s['guid'] < 0 ? 'Vehicle Accessory' : 'GUID'.Lang::main('colon').$s['guid']; if ($s['respawn']) - $label[] = Lang::$npc['respawnIn'].Lang::$main['colon'].Util::formatTime($s['respawn'] * 1000, false); + $label[] = Lang::npc('respawnIn').Lang::main('colon').Util::formatTime($s['respawn'] * 1000, false); if (User::isInGroup(U_GROUP_STAFF)) { if ($s['phaseMask'] > 1) - $label[] = Lang::$game['phases'].Lang::$main['colon'].$s['phaseMask']; + $label[] = Lang::game('phases').Lang::main('colon').$s['phaseMask']; if ($s['spawnMask'] == 15) - $label[] = Lang::$game['mode'].Lang::$main['colon'].Lang::$game['modes'][-1]; + $label[] = Lang::game('mode').Lang::main('colon').Lang::game('modes', -1); else if ($s['spawnMask']) { $_ = []; for ($i = 0; $i < 4; $i++) if ($s['spawnMask'] & 1 << $i) - $_[] = Lang::$game['modes'][$i]; + $_[] = Lang::game('modes', $i); - $label[] = Lang::$game['mode'].Lang::$main['colon'].implode(', ', $_); + $label[] = Lang::game('mode').Lang::main('colon').implode(', ', $_); } } diff --git a/includes/types/creature.class.php b/includes/types/creature.class.php index 354f8b5c..544ffef1 100644 --- a/includes/types/creature.class.php +++ b/includes/types/creature.class.php @@ -56,7 +56,7 @@ class CreatureList extends BaseType $level = '??'; $type = $this->curTpl['type']; - $row3 = [Lang::$game['level']]; + $row3 = [Lang::game('level')]; $fam = $this->curTpl['family']; if (!($this->curTpl['typeFlags'] & 0x4)) @@ -71,9 +71,9 @@ class CreatureList extends BaseType $row3[] = $level; if ($type) - $row3[] = Lang::$game['ct'][$type]; + $row3[] = Lang::game('ct', $type); - $row3[] = '('.Lang::$npc['rank'][$this->curTpl['rank']].')'; + $row3[] = '('.Lang::npc('rank', $this->curTpl['rank']).')'; $x = ''; $x .= ''; @@ -84,7 +84,7 @@ class CreatureList extends BaseType $x .= ''; if ($type == 1 && $fam) // 1: Beast - $x .= ''; + $x .= ''; $fac = new FactionList(array([['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0], ['id', (int)$this->getField('factionId')])); if (!$fac->error) diff --git a/includes/types/item.class.php b/includes/types/item.class.php index 38c2e6d6..13c9eaf1 100644 --- a/includes/types/item.class.php +++ b/includes/types/item.class.php @@ -487,7 +487,7 @@ class ItemList extends BaseType // heroic tag if (($_flags & ITEM_FLAG_HEROIC) && $_quality == ITEM_QUALITY_EPIC) - $x .= '
'.Lang::$item['heroic'].''; + $x .= '
'.Lang::item('heroic').''; // requires map (todo: reparse ?_zones for non-conflicting data; generate Link to zone) if ($_ = $this->curTpl['map']) @@ -505,44 +505,44 @@ class ItemList extends BaseType // conjured if ($_flags & ITEM_FLAG_CONJURED) - $x .= '
'.Lang::$item['conjured']; + $x .= '
'.Lang::item('conjured'); // bonding if ($_flags & ITEM_FLAG_ACCOUNTBOUND) - $x .= '
'.Lang::$item['bonding'][0]; + $x .= '
'.Lang::item('bonding', 0); else if ($this->curTpl['bonding']) - $x .= '
'.Lang::$item['bonding'][$this->curTpl['bonding']]; + $x .= '
'.Lang::item('bonding', $this->curTpl['bonding']); // unique || unique-equipped || unique-limited if ($this->curTpl['maxCount'] > 0) { - $x .= '
'.Lang::$item['unique']; + $x .= '
'.Lang::item('unique'); if ($this->curTpl['maxCount'] > 1) $x .= ' ('.$this->curTpl['maxCount'].')'; } else if ($_flags & ITEM_FLAG_UNIQUEEQUIPPED) - $x .= '
'.Lang::$item['uniqueEquipped']; + $x .= '
'.Lang::item('uniqueEquipped'); else if ($this->curTpl['itemLimitCategory']) { $limit = DB::Aowow()->selectRow("SELECT * FROM ?_itemlimitcategory WHERE id = ?", $this->curTpl['itemLimitCategory']); - $x .= '
'.($limit['isGem'] ? Lang::$item['uniqueEquipped'] : Lang::$item['unique']).Lang::$main['colon'].Util::localizedString($limit, 'name').' ('.$limit['count'].')'; + $x .= '
'.($limit['isGem'] ? Lang::item('uniqueEquipped') : Lang::item('unique')).Lang::main('colon').Util::localizedString($limit, 'name').' ('.$limit['count'].')'; } // max duration if ($dur = $this->curTpl['duration']) - $x .= "
".Lang::$game['duration'].Lang::$main['colon'].Util::formatTime(abs($dur) * 1000).($this->curTpl['flagsCustom'] & 0x1 ? ' ('.Lang::$item['realTime'].')' : null); + $x .= "
".Lang::game('duration').Lang::main('colon').Util::formatTime(abs($dur) * 1000).($this->curTpl['flagsCustom'] & 0x1 ? ' ('.Lang::item('realTime').')' : null); // required holiday if ($hId = $this->curTpl['holidayId']) { $hDay = DB::Aowow()->selectRow("SELECT * FROM ?_holidays WHERE id = ?", $hId); - $x .= '
'.sprintf(Lang::$game['requires'], ''.Util::localizedString($hDay, 'name').''); + $x .= '
'.sprintf(Lang::game('requires'), ''.Util::localizedString($hDay, 'name').''); } // item begins a quest if ($this->curTpl['startQuest']) - $x .= '
'.Lang::$item['startQuest'].''; + $x .= '
'.Lang::item('startQuest').''; // containerType (slotCount) if ($this->curTpl['slots'] > 0) @@ -551,9 +551,9 @@ class ItemList extends BaseType // word order differs <_< if (in_array(User::$localeId, [LOCALE_FR, LOCALE_ES, LOCALE_RU])) - $x .= '
'.sprintf(Lang::$item['bagSlotString'], Lang::$item['bagFamily'][$fam], $this->curTpl['slots']); + $x .= '
'.sprintf(Lang::item('bagSlotString'), Lang::item('bagFamily', $fam), $this->curTpl['slots']); else - $x .= '
'.sprintf(Lang::$item['bagSlotString'], $this->curTpl['slots'], Lang::$item['bagFamily'][$fam]); + $x .= '
'.sprintf(Lang::item('bagSlotString'), $this->curTpl['slots'], Lang::item('bagFamily', $fam)); } if (in_array($_class, [ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON, ITEM_CLASS_AMMUNITION])) @@ -561,20 +561,20 @@ class ItemList extends BaseType $x .= '
'.$this->getField('name', true).'
'.implode(' ', $row3).'
'.Lang::$game['fa'][$fam].'
'.Lang::game('fa', $fam).'
'; // Class - $x .= ''; + $x .= ''; // Subclass if ($_class == ITEM_CLASS_ARMOR && $_subClass > 0) - $x .= ''; + $x .= ''; else if ($_class == ITEM_CLASS_WEAPON) - $x .= ''; + $x .= ''; else if ($_class == ITEM_CLASS_AMMUNITION) - $x .= ''; + $x .= ''; $x .= '
'.Lang::$item['inventoryType'][$_slot].''.Lang::item('inventoryType', $_slot).''.Lang::$item['armorSubClass'][$_subClass].''.Lang::item('armorSubClass', $_subClass).''.Lang::$item['weaponSubClass'][$_subClass].''.Lang::item('weaponSubClass', $_subClass).''.Lang::$item['projectileSubClass'][$_subClass].''.Lang::item('projectileSubClass', $_subClass).'
'; } else if ($_slot && $_class != ITEM_CLASS_CONTAINER) // yes, slot can occur on random items and is then also displayed <_< .. excluding Bags >_> - $x .= '
'.Lang::$item['inventoryType'][$_slot].'
'; + $x .= '
'.Lang::item('inventoryType', $_slot).'
'; else $x .= '
'; @@ -585,29 +585,29 @@ class ItemList extends BaseType $dps = $speed ? ($dmgmin1 + $dmgmax1) / (2 * $speed) : 0; if ($_class == ITEM_CLASS_AMMUNITION && $dmgmin1 && $dmgmax1) - $x .= Lang::$item['addsDps'].' '.number_format(($dmgmin1 + $dmgmax1) / 2, 1).' '.Lang::$item['dps2'].'
'; + $x .= Lang::item('addsDps').' '.number_format(($dmgmin1 + $dmgmax1) / 2, 1).' '.Lang::item('dps2').'
'; else if ($dps) { if ($_class == ITEM_CLASS_WEAPON) { $x .= ''; - $x .= ''; - $x .= ''; + $x .= ''; + $x .= ''; $x .= '
'.sprintf($this->curTpl['dmgType1'] ? Lang::$item['damageMagic'] : Lang::$item['damagePhys'], $this->curTpl['dmgMin1'].' - '.$this->curTpl['dmgMax1'], Lang::$game['sc'][$this->curTpl['dmgType1']]).''.Lang::$item['speed'].' '.number_format($speed, 2).''.sprintf($this->curTpl['dmgType1'] ? Lang::item('damageMagic') : Lang::item('damagePhys'), $this->curTpl['dmgMin1'].' - '.$this->curTpl['dmgMax1'], Lang::game('sc', $this->curTpl['dmgType1'])).''.Lang::item('speed').' '.number_format($speed, 2).'
'; } else - $x .= ''.sprintf($this->curTpl['dmgType1'] ? Lang::$item['damageMagic'] : Lang::$item['damagePhys'], $this->curTpl['dmgMin1'].' - '.$this->curTpl['dmgMax1'], Lang::$game['sc'][$this->curTpl['dmgType1']]).'
'; + $x .= ''.sprintf($this->curTpl['dmgType1'] ? Lang::item('damageMagic') : Lang::item('damagePhys'), $this->curTpl['dmgMin1'].' - '.$this->curTpl['dmgMax1'], Lang::game('sc', $this->curTpl['dmgType1'])).'
'; // secondary damage is set if ($this->curTpl['dmgMin2']) - $x .= '+'.sprintf($this->curTpl['dmgType2'] ? Lang::$item['damageMagic'] : Lang::$item['damagePhys'], $this->curTpl['dmgMin2'].' - '.$this->curTpl['dmgMax2'], Lang::$game['sc'][$this->curTpl['dmgType2']]).'
'; + $x .= '+'.sprintf($this->curTpl['dmgType2'] ? Lang::item('damageMagic') : Lang::item('damagePhys'), $this->curTpl['dmgMin2'].' - '.$this->curTpl['dmgMax2'], Lang::game('sc', $this->curTpl['dmgType2'])).'
'; if ($_class == ITEM_CLASS_WEAPON) - $x .= '('.number_format($dps, 1).' '.Lang::$item['dps'].')
'; + $x .= '('.number_format($dps, 1).' '.Lang::item('dps').')
'; // display FeralAttackPower if set if ($fap = $this->getFeralAP()) - $x .= '('.$fap.' '.Lang::$item['fap'].')
'; + $x .= '('.$fap.' '.Lang::item('fap').')
'; } // Armor @@ -617,14 +617,14 @@ class ItemList extends BaseType if ($interactive) $spanI = 'class="q2 tip" onmouseover="$WH.Tooltip.showAtCursor(event, $WH.sprintf(LANG.tooltip_armorbonus, '.$this->curTpl['armorDamageModifier'].'), 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"'; - $x .= ''.sprintf(Lang::$item['armor'], intVal($this->curTpl['armor'] + $this->curTpl['armorDamageModifier'])).'
'; + $x .= ''.sprintf(Lang::item('armor'), intVal($this->curTpl['armor'] + $this->curTpl['armorDamageModifier'])).'
'; } else if (($this->curTpl['armor'] + $this->curTpl['armorDamageModifier']) > 0) - $x .= ''.sprintf(Lang::$item['armor'], intVal($this->curTpl['armor'] + $this->curTpl['armorDamageModifier'])).'
'; + $x .= ''.sprintf(Lang::item('armor'), intVal($this->curTpl['armor'] + $this->curTpl['armorDamageModifier'])).'
'; // Block if ($this->curTpl['block']) - $x .= ''.sprintf(Lang::$item['block'], $this->curTpl['block']).'
'; + $x .= ''.sprintf(Lang::item('block'), $this->curTpl['block']).'
'; // Item is a gem (don't mix with sockets) if ($geId = $this->curTpl['gemEnchantmentId']) @@ -647,10 +647,10 @@ class ItemList extends BaseType case 2: // requires less than ( || ) gems case 5: // requires at least than ( || ) gems $sp = (int)$gemCnd['value'.$i] > 1; - $x .= ''.Lang::$achievement['reqNumCrt'].' '.sprintf(Lang::$item['gemConditions'][$gemCnd['comparator'.$i]][$sp], $gemCnd['value'.$i], Lang::$item['gemColors'][$gemCnd['color'.$i] - 1]).'
'; + $x .= ''.Lang::achievement('reqNumCrt').' '.sprintf(Lang::item('gemConditions', $gemCnd['comparator'.$i], $sp), $gemCnd['value'.$i], Lang::item('gemColors', $gemCnd['color'.$i] - 1)).'
'; break; case 3: // requires more than ( || ) gems - $x .= ''.Lang::$achievement['reqNumCrt'].' '.sprintf(Lang::$item['gemConditions'][3], Lang::$item['gemColors'][$gemCnd['color'.$i] - 1], Lang::$item['gemColors'][$gemCnd['cmpColor'.$i] - 1]).'
'; + $x .= ''.Lang::achievement('reqNumCrt').' '.sprintf(Lang::item('gemConditions', 3), Lang::item('gemColors', $gemCnd['color'.$i] - 1), Lang::item('gemColors', $gemCnd['cmpColor'.$i] - 1)).'
'; break; } } @@ -660,7 +660,7 @@ class ItemList extends BaseType // Random Enchantment - if random enchantment is set, prepend stats from it if ($this->curTpl['randomEnchant'] && !isset($enhance['r'])) - $x .= ''.Lang::$item['randEnchant'].'
'; + $x .= ''.Lang::item('randEnchant').'
'; else if (isset($enhance['r'])) $x .= $randEnchant; @@ -675,7 +675,7 @@ class ItemList extends BaseType // base stat if ($type >= ITEM_MOD_AGILITY && $type <= ITEM_MOD_STAMINA) - $x .= ''.($qty > 0 ? '+' : '-').abs($qty).' '.Lang::$item['statType'][$type].'
'; + $x .= ''.($qty > 0 ? '+' : '-').abs($qty).' '.Lang::item('statType', $type).'
'; else // rating with % for reqLevel $green[] = $this->parseRating($type, $qty, $interactive, $causesScaling); } @@ -683,7 +683,7 @@ class ItemList extends BaseType // magic resistances foreach (Util::$resistanceFields as $j => $rowName) if ($rowName && $this->curTpl[$rowName] != 0) - $x .= '+'.$this->curTpl[$rowName].' '.Lang::$game['resistances'][$j].'
'; + $x .= '+'.$this->curTpl[$rowName].' '.Lang::game('resistances', $j).'
'; // Enchantment if (isset($enhance['e'])) @@ -735,7 +735,7 @@ class ItemList extends BaseType $col = $pop ? 1 : 0; $hasMatch &= $pop ? (($gems[$pop]['colorMask'] & (1 << $colorId)) ? 1 : 0) : 0; $icon = $pop ? sprintf(Util::$bgImagePath['tiny'], STATIC_URL, strtolower($gems[$pop]['iconString'])) : null; - $text = $pop ? Util::localizedString($gems[$pop], 'text') : Lang::$item['socket'][$colorId]; + $text = $pop ? Util::localizedString($gems[$pop], 'text') : Lang::item('socket', $colorId); if ($interactive) $x .= ''.$text.'
'; @@ -749,7 +749,7 @@ class ItemList extends BaseType $pop = array_pop($enhance['g']); $col = $pop ? 1 : 0; $icon = $pop ? sprintf(Util::$bgImagePath['tiny'], STATIC_URL, strtolower($gems[$pop]['iconString'])) : null; - $text = $pop ? Util::localizedString($gems[$pop], 'text') : Lang::$item['socket'][-1]; + $text = $pop ? Util::localizedString($gems[$pop], 'text') : Lang::item('socket', -1); if ($interactive) $x .= ''.$text.'
'; @@ -762,12 +762,12 @@ class ItemList extends BaseType if ($this->curTpl['socketBonus']) { $sbonus = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantment WHERE Id = ?d', $this->curTpl['socketBonus']); - $x .= ''.Lang::$item['socketBonus'].Lang::$main['colon'].Util::localizedString($sbonus, 'text').'
'; + $x .= ''.Lang::item('socketBonus').Lang::main('colon').Util::localizedString($sbonus, 'text').'
'; } // durability if ($dur = $this->curTpl['durability']) - $x .= Lang::$item['durability'].' '.$dur.' / '.$dur.'
'; + $x .= Lang::item('durability').' '.$dur.' / '.$dur.'
'; // required classes if ($classes = Lang::getClassString($this->curTpl['requiredClass'], $jsg, $__)) @@ -776,7 +776,7 @@ class ItemList extends BaseType if (empty($this->jsGlobals[TYPE_CLASS][$js])) $this->jsGlobals[TYPE_CLASS][$js] = $js; - $x .= Lang::$game['classes'].Lang::$main['colon'].$classes.'
'; + $x .= Lang::game('classes').Lang::main('colon').$classes.'
'; } // required races @@ -786,30 +786,30 @@ class ItemList extends BaseType if (empty($this->jsGlobals[TYPE_RACE][$js])) $this->jsGlobals[TYPE_RACE][$js] = $js; - if ($races != Lang::$game['ra'][0]) // not "both", but display combinations like: troll, dwarf - $x .= Lang::$game['races'].Lang::$main['colon'].$races.'
'; + if ($races != Lang::game('ra', 0)) // not "both", but display combinations like: troll, dwarf + $x .= Lang::game('races').Lang::main('colon').$races.'
'; } // required honorRank (not used anymore) if ($rhr = $this->curTpl['requiredHonorRank']) - $x .= sprintf(Lang::$game['requires'], Lang::$game['pvpRank'][$rhr]).'
'; + $x .= sprintf(Lang::game('requires'), Lang::game('pvpRank', $rhr)).'
'; // required CityRank..? // what the f.. // required level if (($_flags & ITEM_FLAG_ACCOUNTBOUND) && $_quality == ITEM_QUALITY_HEIRLOOM) - $x .= sprintf(Lang::$game['reqLevelHlm'], ' 1'.Lang::$game['valueDelim'].MAX_LEVEL.' ('.($interactive ? sprintf(Util::$changeLevelString, MAX_LEVEL) : ''.MAX_LEVEL).')').'
'; + $x .= sprintf(Lang::game('reqLevelHlm'), ' 1'.Lang::game('valueDelim').MAX_LEVEL.' ('.($interactive ? sprintf(Util::$changeLevelString, MAX_LEVEL) : ''.MAX_LEVEL).')').'
'; else if ($_reqLvl > 1) - $x .= sprintf(Lang::$game['reqLevel'], $_reqLvl).'
'; + $x .= sprintf(Lang::game('reqLevel'), $_reqLvl).'
'; // required arena team rating / personal rating / todo (low): sort out what kind of rating if (!empty($this->getExtendedCost([], $reqRating)[$this->id]) && $reqRating) - $x .= sprintf(Lang::$item['reqRating'], $reqRating).'
'; + $x .= sprintf(Lang::item('reqRating'), $reqRating).'
'; // item level if (in_array($_class, [ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON])) - $x .= Lang::$item['itemLevel'].' '.$this->curTpl['itemLevel'].'
'; + $x .= Lang::item('itemLevel').' '.$this->curTpl['itemLevel'].'
'; // required skill if ($reqSkill = $this->curTpl['requiredSkill']) @@ -818,22 +818,22 @@ class ItemList extends BaseType if ($this->curTpl['requiredSkillRank'] > 0) $_ .= ' ('.$this->curTpl['requiredSkillRank'].')'; - $x .= sprintf(Lang::$game['requires'], $_).'
'; + $x .= sprintf(Lang::game('requires'), $_).'
'; } // required spell if ($reqSpell = $this->curTpl['requiredSpell']) - $x .= Lang::$game['requires2'].' '.SpellList::getName($reqSpell).'
'; + $x .= Lang::game('requires2').' '.SpellList::getName($reqSpell).'
'; // required reputation w/ faction if ($reqFac = $this->curTpl['requiredFaction']) - $x .= sprintf(Lang::$game['requires'], ''.FactionList::getName($reqFac).' - '.Lang::$game['rep'][$this->curTpl['requiredFactionRank']]).'
'; + $x .= sprintf(Lang::game('requires'), ''.FactionList::getName($reqFac).' - '.Lang::game('rep', $this->curTpl['requiredFactionRank'])).'
'; // locked or openable if ($locks = Lang::getLocks($this->curTpl['lockId'], true)) - $x .= ''.Lang::$item['locked'].'
'.implode('
', $locks).'

'; + $x .= ''.Lang::item('locked').'
'.implode('
', $locks).'

'; else if ($this->curTpl['flags'] & ITEM_FLAG_OPENABLE) - $x .= ''.Lang::$item['openClick'].'
'; + $x .= ''.Lang::item('openClick').'
'; // upper table: done if (!$subOf) @@ -851,7 +851,7 @@ class ItemList extends BaseType if ($cd < $this->curTpl['spellCategoryCooldown'.$j]) $cd = $this->curTpl['spellCategoryCooldown'.$j]; - $cd = $cd < 5000 ? null : ' ('.sprintf(Lang::$game['cooldown'], Util::formatTime($cd)).')'; + $cd = $cd < 5000 ? null : ' ('.sprintf(Lang::game('cooldown'), Util::formatTime($cd)).')'; $itemSpellsAndTrigger[$this->curTpl['spellId'.$j]] = [$this->curTpl['spellTrigger'.$j], $cd]; } @@ -879,7 +879,7 @@ class ItemList extends BaseType $parsed = sprintF($link, $parsed); } - $green[] = Lang::$item['trigger'][$itemSpellsAndTrigger[$itemSpells->id][0]].$parsed.$itemSpellsAndTrigger[$itemSpells->id][1]; + $green[] = Lang::item('trigger', $itemSpellsAndTrigger[$itemSpells->id][0]).$parsed.$itemSpellsAndTrigger[$itemSpells->id][1]; } } } @@ -915,7 +915,7 @@ class ItemList extends BaseType if ($skId = $itemset->getField('skillId')) // bonus requires skill to activate { - $xSet .= '
'.sprintf(Lang::$game['requires'], ''.SkillList::getName($skId).''); + $xSet .= '
'.sprintf(Lang::game('requires'), ''.SkillList::getName($skId).''); if ($_ = $itemset->getField('skillLevel')) $xSet .= ' ('.$_.')'; @@ -959,7 +959,7 @@ class ItemList extends BaseType $setSpells[$i] = $setSpells[$j]; $setSpells[$j] = $tmp; } - $xSet .= '('.$setSpells[$i]['bonus'].') '.Lang::$item['set'].': '.$setSpells[$i]['tooltip'].''; + $xSet .= '('.$setSpells[$i]['bonus'].') '.Lang::item('set').': '.$setSpells[$i]['tooltip'].''; if ($i < count($setSpells) - 1) $xSet .= '
'; } @@ -974,7 +974,7 @@ class ItemList extends BaseType { $xCraft = ''; if ($desc = $this->getField('description', true)) - $x .= ''.Lang::$item['trigger'][0].' '.$desc.'
'; + $x .= ''.Lang::item('trigger', 0).' '.$desc.'
'; // recipe handling (some stray Techniques have subclass == 0), place at bottom of tooltipp if ($_class == ITEM_CLASS_RECIPE || $this->curTpl['bagFamily'] == 16) @@ -998,7 +998,7 @@ class ItemList extends BaseType foreach ($reagents->iterate() as $__) $reqReag[] = ''.$reagents->getField('name', true).' ('.$reagentItems[$reagents->id].')'; - $xCraft .= '

'.Lang::$game['requires2'].' '.implode(', ', $reqReag).'
'; + $xCraft .= '

'.Lang::game('requires2').' '.implode(', ', $reqReag).'
'; } } } @@ -1018,11 +1018,11 @@ class ItemList extends BaseType // readable if ($this->curTpl['pageTextId']) - $xMisc[] = ''.Lang::$item['readClick'].''; + $xMisc[] = ''.Lang::item('readClick').''; // charges (i guess checking first spell is enough (single charges not shown)) if ($this->curTpl['spellCharges1'] > 1 || $this->curTpl['spellCharges1'] < -1) - $xMisc[] = ''.abs($this->curTpl['spellCharges1']).' '.Lang::$item['charges'].''; + $xMisc[] = ''.abs($this->curTpl['spellCharges1']).' '.Lang::item('charges').''; // list required reagents if (isset($xCraft)) @@ -1032,7 +1032,7 @@ class ItemList extends BaseType $x .= implode('
', $xMisc); if ($sp = $this->curTpl['sellPrice']) - $x .= '
'.Lang::$item['sellPrice'].Lang::$main['colon'].Util::formatMoney($sp).'
'; + $x .= '
'.Lang::item('sellPrice').Lang::main('colon').Util::formatMoney($sp).'
'; if (!$subOf) $x .= ''; @@ -1277,10 +1277,10 @@ class ItemList extends BaseType $reqLvl = $this->curTpl['requiredLevel'] > 1 ? $this->curTpl['requiredLevel'] : MAX_LEVEL; $level = min(max($reqLvl, $ssdLvl), MAX_LEVEL); - if (!Lang::$item['statType'][$type]) // unknown rating - return sprintf(Lang::$item['statType'][count(Lang::$item['statType']) - 1], $type, $value); + if (!Lang::item('statType', $type)) // unknown rating + return sprintf(Lang::item('statType', count(Lang::item('statType')) - 1), $type, $value); else if (in_array($type, Util::$lvlIndepRating)) // level independant Bonus - return Lang::$item['trigger'][1].str_replace('%d', ''.$value, Lang::$item['statType'][$type]); + return Lang::item('trigger', 1).str_replace('%d', ''.$value, Lang::item('statType', $type)); else // rating-Bonuses { $scaling = true; @@ -1290,7 +1290,7 @@ class ItemList extends BaseType else $js = " (".Util::setRatingLevel($level, $type, $value).")"; - return Lang::$item['trigger'][1].str_replace('%d', ''.$value.$js, Lang::$item['statType'][$type]); + return Lang::item('trigger', 1).str_replace('%d', ''.$value.$js, Lang::item('statType', $type)); } } diff --git a/includes/types/profile.class.php b/includes/types/profile.class.php index 184653d4..a6a6da11 100644 --- a/includes/types/profile.class.php +++ b/includes/types/profile.class.php @@ -155,7 +155,7 @@ class ProfileList extends BaseType $x .= '<'.$g.'> ('.$this->getField('guildrank').')'; else if ($d = $this->getField('description')) $x .= ''.$d.''; - $x .= ''.Lang::$game['level'].' '.$this->getField('level').' '.Lang::$game['ra'][$this->curTpl['race']].' '.Lang::$game['cl'][$this->curTpl['classs']].''; + $x .= ''.Lang::game('level').' '.$this->getField('level').' '.Lang::game('ra', $this->curTpl['race']).' '.Lang::game('cl', $this->curTpl['classs']).''; $x .= ''; return $x; diff --git a/includes/types/quest.class.php b/includes/types/quest.class.php index 8c601d88..b5f931c0 100644 --- a/includes/types/quest.class.php +++ b/includes/types/quest.class.php @@ -281,10 +281,10 @@ class QuestList extends BaseType $x = ''; if ($level) { - $level = sprintf(Lang::$quest['questLevel'], $level); + $level = sprintf(Lang::quest('questLevel'), $level); if ($this->curTpl['flags'] & QUEST_FLAG_DAILY) // daily - $level .= ' '.Lang::$quest['daily']; + $level .= ' '.Lang::quest('daily'); $x .= '
'.$title.''.$level.'
'; } @@ -329,10 +329,10 @@ class QuestList extends BaseType if ($_ = $this->getField('rewardOrReqMoney')) if ($_ < 0) - $xReq .= '
- '.Lang::$quest['money'].Lang::$main['colon'].Util::formatMoney(abs($_)); + $xReq .= '
- '.Lang::quest('money').Lang::main('colon').Util::formatMoney(abs($_)); if ($xReq) - $x .= '

'.Lang::$quest['requirements'].Lang::$main['colon'].''.$xReq; + $x .= '

'.Lang::quest('requirements').Lang::main('colon').''.$xReq; $x .= ''; diff --git a/includes/types/spell.class.php b/includes/types/spell.class.php index ff99c41b..0e94ff8c 100644 --- a/includes/types/spell.class.php +++ b/includes/types/spell.class.php @@ -503,19 +503,19 @@ class SpellList extends BaseType // minRange exists; show as range if ($this->curTpl['rangeMinHostile']) - return sprintf(Lang::$spell['range'], $this->curTpl['rangeMinHostile'].' - '.$this->curTpl['rangeMaxHostile']); + return sprintf(Lang::spell('range'), $this->curTpl['rangeMinHostile'].' - '.$this->curTpl['rangeMaxHostile']); // friend and hostile differ; do color else if ($this->curTpl['rangeMaxHostile'] != $this->curTpl['rangeMaxFriend']) - return sprintf(Lang::$spell['range'], ''.$this->curTpl['rangeMaxHostile'].' - '.$this->curTpl['rangeMaxHostile']. ''); + return sprintf(Lang::spell('range'), ''.$this->curTpl['rangeMaxHostile'].' - '.$this->curTpl['rangeMaxHostile']. ''); // hardcode: "melee range" else if ($this->curTpl['rangeMaxHostile'] == 5) - return Lang::$spell['meleeRange']; + return Lang::spell('meleeRange'); // hardcode "unlimited range" else if ($this->curTpl['rangeMaxHostile'] == 50000) - return Lang::$spell['unlimRange']; + return Lang::spell('unlimRange'); // regular case else - return sprintf(Lang::$spell['range'], $this->curTpl['rangeMaxHostile']); + return sprintf(Lang::spell('range'), $this->curTpl['rangeMaxHostile']); } public function createPowerCostForCurrent() @@ -527,29 +527,29 @@ class SpellList extends BaseType // power cost: pct over static if ($this->curTpl['powerCostPercent'] > 0) - $str .= $this->curTpl['powerCostPercent']."% ".sprintf(Lang::$spell['pctCostOf'], strtolower(Lang::$spell['powerTypes'][$pt])); + $str .= $this->curTpl['powerCostPercent']."% ".sprintf(Lang::spell('pctCostOf'), strtolower(Lang::spell('powerTypes', $pt))); else if ($this->curTpl['powerCost'] > 0 || $this->curTpl['powerPerSecond'] > 0 || $this->curTpl['powerCostPerLevel'] > 0) - $str .= ($pt == POWER_RAGE || $pt == POWER_RUNIC_POWER ? $this->curTpl['powerCost'] / 10 : $this->curTpl['powerCost']).' '.Util::ucFirst(Lang::$spell['powerTypes'][$pt]); + $str .= ($pt == POWER_RAGE || $pt == POWER_RUNIC_POWER ? $this->curTpl['powerCost'] / 10 : $this->curTpl['powerCost']).' '.Util::ucFirst(Lang::spell('powerTypes', $pt)); else if ($rCost = ($this->curTpl['powerCostRunes'] & 0x333)) { // Blood 2|1 - Unholy 2|1 - Frost 2|1 $runes = []; if ($_ = (($rCost & 0x300) >> 8)) - $runes[] = $_.' '.Lang::$spell['powerRunes'][2]; + $runes[] = $_.' '.Lang::spell('powerRunes', 2); if ($_ = (($rCost & 0x030) >> 4)) - $runes[] = $_.' '.Lang::$spell['powerRunes'][1]; + $runes[] = $_.' '.Lang::spell('powerRunes', 1); if ($_ = ($rCost & 0x003)) - $runes[] = $_.' '.Lang::$spell['powerRunes'][0]; + $runes[] = $_.' '.Lang::spell('powerRunes', 0); $str .= implode(', ', $runes); } // append periodic cost if ($this->curTpl['powerPerSecond'] > 0) - $str .= sprintf(Lang::$spell['costPerSec'], $this->curTpl['powerPerSecond']); + $str .= sprintf(Lang::spell('costPerSec'), $this->curTpl['powerPerSecond']); // append level cost (todo (low): work in as scaling cost) if ($this->curTpl['powerCostPerLevel'] > 0) - $str .= sprintf(Lang::$spell['costPerLevel'], $this->curTpl['powerCostPerLevel']); + $str .= sprintf(Lang::spell('costPerLevel'), $this->curTpl['powerCostPerLevel']); return $str; } @@ -557,25 +557,25 @@ class SpellList extends BaseType public function createCastTimeForCurrent($short = true, $noInstant = true) { if ($this->curTpl['interruptFlagsChannel']) - return Lang::$spell['channeled']; + return Lang::spell('channeled'); else if ($this->curTpl['castTime'] > 0) - return $short ? sprintf(Lang::$spell['castIn'], $this->curTpl['castTime'] / 1000) : Util::formatTime($this->curTpl['castTime']); + return $short ? sprintf(Lang::spell('castIn'), $this->curTpl['castTime'] / 1000) : Util::formatTime($this->curTpl['castTime']); // show instant only for player/pet/npc abilities (todo (low): unsure when really hidden (like talent-case)) else if ($noInstant && !in_array($this->curTpl['typeCat'], [11, 7, -3, -6, -8, 0]) && !($this->curTpl['cuFlags'] & SPELL_CU_TALENTSPELL)) return ''; // SPELL_ATTR0_ABILITY instant ability.. yeah, wording thing only (todo (low): rule is imperfect) else if ($this->curTpl['damageClass'] != 1 || $this->curTpl['attributes0'] & 0x10) - return Lang::$spell['instantPhys']; + return Lang::spell('instantPhys'); else // instant cast - return Lang::$spell['instantMagic']; + return Lang::spell('instantMagic'); } private function createCooldownForCurrent() { if ($this->curTpl['recoveryTime']) - return sprintf(Lang::$game['cooldown'], Util::formatTime($this->curTpl['recoveryTime'], true)); + return sprintf(Lang::game('cooldown'), Util::formatTime($this->curTpl['recoveryTime'], true)); else if ($this->curTpl['recoveryCategory']) - return sprintf(Lang::$game['cooldown'], Util::formatTime($this->curTpl['recoveryCategory'], true)); + return sprintf(Lang::game('cooldown'), Util::formatTime($this->curTpl['recoveryCategory'], true)); else return ''; } @@ -686,17 +686,17 @@ class SpellList extends BaseType // if (character level is set manually (profiler only)) // $pl = $PL = $this->charLevel; - $PlayerName = Lang::$main['name']; - $ap = $AP = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.atkpwr[0]', Lang::$spell['traitShort']['atkpwr']) : Lang::$spell['traitShort']['atkpwr']; - $rap = $RAP = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.rgdatkpwr[0]', Lang::$spell['traitShort']['rgdatkpwr']) : Lang::$spell['traitShort']['rgdatkpwr']; - $sp = $SP = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.splpwr[0]', Lang::$spell['traitShort']['splpwr']) : Lang::$spell['traitShort']['splpwr']; - $spa = $SPA = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.arcsplpwr[0]', Lang::$spell['traitShort']['arcsplpwr']) : Lang::$spell['traitShort']['arcsplpwr']; - $spfi = $SPFI = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.firsplpwr[0]', Lang::$spell['traitShort']['firsplpwr']) : Lang::$spell['traitShort']['firsplpwr']; - $spfr = $SPFR = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.frosplpwr[0]', Lang::$spell['traitShort']['frosplpwr']) : Lang::$spell['traitShort']['frosplpwr']; - $sph = $SPH = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.holsplpwr[0]', Lang::$spell['traitShort']['holsplpwr']) : Lang::$spell['traitShort']['holsplpwr']; - $spn = $SPN = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.natsplpwr[0]', Lang::$spell['traitShort']['natsplpwr']) : Lang::$spell['traitShort']['natsplpwr']; - $sps = $SPS = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.shasplpwr[0]', Lang::$spell['traitShort']['shasplpwr']) : Lang::$spell['traitShort']['shasplpwr']; - $bh = $BH = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.splheal[0]', Lang::$spell['traitShort']['splheal']) : Lang::$spell['traitShort']['splheal']; + $PlayerName = Lang::main('name'); + $ap = $AP = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.atkpwr[0]', Lang::spell('traitShort', 'atkpwr')) : Lang::spell('traitShort', 'atkpwr'); + $rap = $RAP = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.rgdatkpwr[0]', Lang::spell('traitShort', 'rgdatkpwr')) : Lang::spell('traitShort', 'rgdatkpwr'); + $sp = $SP = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.splpwr[0]', Lang::spell('traitShort', 'splpwr')) : Lang::spell('traitShort', 'splpwr'); + $spa = $SPA = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.arcsplpwr[0]', Lang::spell('traitShort', 'arcsplpwr')) : Lang::spell('traitShort', 'arcsplpwr'); + $spfi = $SPFI = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.firsplpwr[0]', Lang::spell('traitShort', 'firsplpwr')) : Lang::spell('traitShort', 'firsplpwr'); + $spfr = $SPFR = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.frosplpwr[0]', Lang::spell('traitShort', 'frosplpwr')) : Lang::spell('traitShort', 'frosplpwr'); + $sph = $SPH = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.holsplpwr[0]', Lang::spell('traitShort', 'holsplpwr')) : Lang::spell('traitShort', 'holsplpwr'); + $spn = $SPN = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.natsplpwr[0]', Lang::spell('traitShort', 'natsplpwr')) : Lang::spell('traitShort', 'natsplpwr'); + $sps = $SPS = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.shasplpwr[0]', Lang::spell('traitShort', 'shasplpwr')) : Lang::spell('traitShort', 'shasplpwr'); + $bh = $BH = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.splheal[0]', Lang::spell('traitShort', 'splheal')) : Lang::spell('traitShort', 'splheal'); $HND = $hnd = $this->interactive ? sprintf(Util::$dfnString, '[Hands required by weapon]', 'HND') : 'HND'; // todo (med): localize this one $MWS = $mws = $this->interactive ? sprintf(Util::$dfnString, 'LANG.traits.mlespeed[0]', 'MWS') : 'MWS'; @@ -815,7 +815,7 @@ class SpellList extends BaseType $base = $this->getField('duration'); if ($base <= 0) - return Lang::$spell['untilCanceled']; + return Lang::spell('untilCanceled'); if ($op && is_numeric($oparg) && is_numeric($base)) eval("\$base = $base $op $oparg;"); @@ -948,9 +948,9 @@ class SpellList extends BaseType eval("\$min = $min $op $oparg;"); if ($this->interactive) - return $modStrMin.$min . (!$equal ? Lang::$game['valueDelim'] . $modStrMax.$max : null); + return $modStrMin.$min . (!$equal ? Lang::game('valueDelim') . $modStrMax.$max : null); else - return $min . (!$equal ? Lang::$game['valueDelim'] . $max : null); + return $min . (!$equal ? Lang::game('valueDelim') . $max : null); case 'q': // EffectMiscValue case 'Q': if ($lookup) @@ -1008,9 +1008,9 @@ class SpellList extends BaseType else if ($rType && $equal && $aura == 189) return ''.$min.' ('.Util::setRatingLevel($this->charLevel, $rType, $min).')'; else if ($this->interactive && $aura == 189) - return $modStrMin.$min . (!$equal ? Lang::$game['valueDelim'] . $modStrMax.$max : null); + return $modStrMin.$min . (!$equal ? Lang::game('valueDelim') . $modStrMax.$max : null); else - return $min . (!$equal ? Lang::$game['valueDelim'] . $max : null); + return $min . (!$equal ? Lang::game('valueDelim') . $max : null); case 't': // Periode case 'T': if ($lookup) @@ -1056,7 +1056,7 @@ class SpellList extends BaseType return $base; case 'z': // HomeZone - return Lang::$spell['home']; + return Lang::spell('home'); } } @@ -1456,7 +1456,7 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.] $x .= ''.$this->getField('name', true).''; // 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('
'.Lang::$main['englishOnly'].'
')]; + $this->article['params'] = ['prepend' => Util::jsEscape('
'.Lang::main('englishOnly').'
')]; } } @@ -380,8 +380,8 @@ class GenericPage $this->tabId = null; $this->type = -99; // get error-article $this->typeId = 0; - $this->title[] = Lang::$main['errPageTitle']; - $this->name = Lang::$main['errPageTitle']; + $this->title[] = Lang::main('errPageTitle'); + $this->name = Lang::main('errPageTitle'); $this->addArticle(); diff --git a/pages/item.php b/pages/item.php index 3aa4c56b..29fb825a 100644 --- a/pages/item.php +++ b/pages/item.php @@ -59,7 +59,7 @@ class ItemPage extends genericPage $this->subject = new ItemList($conditions); if ($this->subject->error) - $this->notFound(Lang::$game['item']); + $this->notFound(Lang::game('item')); if (!is_numeric($param)) $this->typeId = $this->subject->id; @@ -106,7 +106,7 @@ class ItemPage extends genericPage protected function generateTitle() { - array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::$game['item'])); + array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::game('item'))); } protected function generateContent() @@ -133,16 +133,16 @@ class ItemPage extends genericPage // itemlevel if (in_array($_class, [ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON, ITEM_CLASS_AMMUNITION]) || $this->subject->getField('gemEnchantmentId')) - $infobox[] = Lang::$game['level'].Lang::$main['colon'].$this->subject->getField('itemLevel'); + $infobox[] = Lang::game('level').Lang::main('colon').$this->subject->getField('itemLevel'); // account-wide if ($_flags & ITEM_FLAG_ACCOUNTBOUND) - $infobox[] = Lang::$item['accountWide']; + $infobox[] = Lang::item('accountWide'); // side if ($si = $this->subject->json[$this->typeId]['side']) if ($si != 3) - $infobox[] = Lang::$main['side'].Lang::$main['colon'].'[span class=icon-'.($si == 1 ? 'alliance' : 'horde').']'.Lang::$game['si'][$si].'[/span]'; + $infobox[] = Lang::main('side').Lang::main('colon').'[span class=icon-'.($si == 1 ? 'alliance' : 'horde').']'.Lang::game('si', $si).'[/span]'; // consumable / not consumable if (!$_slot) @@ -158,29 +158,29 @@ class ItemPage extends genericPage if ($this->subject->getField('spellCharges'.$i) >= 0) continue; - $tt = '[tooltip=tooltip_consumedonuse]'.Lang::$item['consumable'].'[/tooltip]'; + $tt = '[tooltip=tooltip_consumedonuse]'.Lang::item('consumable').'[/tooltip]'; break; } if ($hasUse) - $infobox[] = isset($tt) ? $tt : '[tooltip=tooltip_notconsumedonuse]'.Lang::$item['nonConsumable'].'[/tooltip]'; + $infobox[] = isset($tt) ? $tt : '[tooltip=tooltip_notconsumedonuse]'.Lang::item('nonConsumable').'[/tooltip]'; } // related holiday if ($hId = $this->subject->getField('holidayId')) if ($hName = DB::Aowow()->selectRow('SELECT * FROM ?_holidays WHERE id = ?d', $hId)) - $infobox[] = Lang::$game['eventShort'].Lang::$main['colon'].'[url=?event='.$hId.']'.Util::localizedString($hName, 'name').'[/url]'; + $infobox[] = Lang::game('eventShort').Lang::main('colon').'[url=?event='.$hId.']'.Util::localizedString($hName, 'name').'[/url]'; // tool if ($tId = $this->subject->getField('totemCategory')) if ($tName = DB::Aowow()->selectRow('SELECT * FROM ?_totemcategory WHERE id = ?d', $tId)) - $infobox[] = Lang::$item['tool'].Lang::$main['colon'].'[url=?items&filter=cr=91;crs='.$tId.';crv=0]'.Util::localizedString($tName, 'name').'[/url]'; + $infobox[] = Lang::item('tool').Lang::main('colon').'[url=?items&filter=cr=91;crs='.$tId.';crv=0]'.Util::localizedString($tName, 'name').'[/url]'; // extendedCost if (!empty($this->subject->getExtendedCost([], $_reqRating)[$this->subject->id])) { $vendors = $this->subject->getExtendedCost()[$this->subject->id]; - $each = $this->subject->getField('stackable') > 1 ? '[color=q0] ('.Lang::$item['each'].')[/color]' : null; + $each = $this->subject->getField('stackable') > 1 ? '[color=q0] ('.Lang::item('each').')[/color]' : null; $handled = []; $costList = []; foreach ($vendors as $npcId => $data) @@ -225,16 +225,16 @@ class ItemPage extends genericPage } if (count($costList) == 1) - $infobox[] = Lang::$item['cost'].Lang::$main['colon'].$costList[0].$each; + $infobox[] = Lang::item('cost').Lang::main('colon').$costList[0].$each; else if (count($costList) > 1) - $infobox[] = Lang::$item['cost'].$each.Lang::$main['colon'].'[ul][li]'.implode('[/li][li]', $costList).'[/li][/ul]'; + $infobox[] = Lang::item('cost').$each.Lang::main('colon').'[ul][li]'.implode('[/li][li]', $costList).'[/li][/ul]'; if ($_reqRating) { $res = []; $i = 0; $len = 0; - $parts = explode(' ', sprintf(Lang::$item['reqRating'], $_reqRating)); + $parts = explode(' ', sprintf(Lang::item('reqRating'), $_reqRating)); foreach ($parts as $p) { $res[$i][] = $p; @@ -255,17 +255,17 @@ class ItemPage extends genericPage // repair cost if ($_ = $this->subject->getField('repairPrice')) - $infobox[] = Lang::$item['repairCost'].Lang::$main['colon'].'[money='.$_.']'; + $infobox[] = Lang::item('repairCost').Lang::main('colon').'[money='.$_.']'; // avg auction buyout if (in_array($this->subject->getField('bonding'), [0, 2, 3])) if ($_ = Util::getBuyoutForItem($this->typeId)) - $infobox[] = '[tooltip=tooltip_buyoutprice]'.Lang::$item['buyout.'].'[/tooltip]'.Lang::$main['colon'].'[money='.$_.']'.$each; + $infobox[] = '[tooltip=tooltip_buyoutprice]'.Lang::item('buyout.').'[/tooltip]'.Lang::main('colon').'[money='.$_.']'.$each; // avg money contained if ($_flags & ITEM_FLAG_OPENABLE) if ($_ = intVal(($this->subject->getField('minMoneyLoot') + $this->subject->getField('maxMoneyLoot')) / 2)) - $infobox[] = Lang::$item['worth'].Lang::$main['colon'].'[tooltip=tooltip_avgmoneycontained][money='.$_.'][/tooltip]'; + $infobox[] = Lang::item('worth').Lang::main('colon').'[tooltip=tooltip_avgmoneycontained][money='.$_.'][/tooltip]'; // if it goes into a slot it may be disenchanted if ($_slot && $_class != ITEM_CLASS_CONTAINER) @@ -276,49 +276,49 @@ class ItemPage extends genericPage if ($_ < 1) // these are some items, that never went live .. extremely rough emulation here $_ = intVal($this->subject->getField('itemLevel') / 7.5) * 25; - $infobox[] = Lang::$item['disenchantable'].' ([tooltip=tooltip_reqenchanting]'.$_.'[/tooltip])'; + $infobox[] = Lang::item('disenchantable').' ([tooltip=tooltip_reqenchanting]'.$_.'[/tooltip])'; } else - $infobox[] = Lang::$item['cantDisenchant']; + $infobox[] = Lang::item('cantDisenchant'); } if (($_flags & ITEM_FLAG_MILLABLE) && $this->subject->getField('requiredSkill') == 773) - $infobox[] = Lang::$item['millable'].' ([tooltip=tooltip_reqinscription]'.$this->subject->getField('requiredSkillRank').'[/tooltip])'; + $infobox[] = Lang::item('millable').' ([tooltip=tooltip_reqinscription]'.$this->subject->getField('requiredSkillRank').'[/tooltip])'; if (($_flags & ITEM_FLAG_PROSPECTABLE) && $this->subject->getField('requiredSkill') == 755) - $infobox[] = Lang::$item['prospectable'].' ([tooltip=tooltip_reqjewelcrafting]'.$this->subject->getField('requiredSkillRank').'[/tooltip])'; + $infobox[] = Lang::item('prospectable').' ([tooltip=tooltip_reqjewelcrafting]'.$this->subject->getField('requiredSkillRank').'[/tooltip])'; if ($_flags & ITEM_FLAG_DEPRECATED) - $infobox[] = '[tooltip=tooltip_deprecated]'.Lang::$item['deprecated'].'[/tooltip]'; + $infobox[] = '[tooltip=tooltip_deprecated]'.Lang::item('deprecated').'[/tooltip]'; if ($_flags & ITEM_FLAG_NO_EQUIPCD) - $infobox[] = '[tooltip=tooltip_noequipcooldown]'.Lang::$item['noEquipCD'].'[/tooltip]'; + $infobox[] = '[tooltip=tooltip_noequipcooldown]'.Lang::item('noEquipCD').'[/tooltip]'; if ($_flags & ITEM_FLAG_PARTYLOOT) - $infobox[] = '[tooltip=tooltip_partyloot]'.Lang::$item['partyLoot'].'[/tooltip]'; + $infobox[] = '[tooltip=tooltip_partyloot]'.Lang::item('partyLoot').'[/tooltip]'; if ($_flags & ITEM_FLAG_REFUNDABLE) - $infobox[] = '[tooltip=tooltip_refundable]'.Lang::$item['refundable'].'[/tooltip]'; + $infobox[] = '[tooltip=tooltip_refundable]'.Lang::item('refundable').'[/tooltip]'; if ($_flags & ITEM_FLAG_SMARTLOOT) - $infobox[] = '[tooltip=tooltip_smartloot]'.Lang::$item['smartLoot'].'[/tooltip]'; + $infobox[] = '[tooltip=tooltip_smartloot]'.Lang::item('smartLoot').'[/tooltip]'; if ($_flags & ITEM_FLAG_INDESTRUCTIBLE) - $infobox[] = Lang::$item['indestructible']; + $infobox[] = Lang::item('indestructible'); if ($_flags & ITEM_FLAG_USABLE_ARENA) - $infobox[] = Lang::$item['useInArena']; + $infobox[] = Lang::item('useInArena'); if ($_flags & ITEM_FLAG_USABLE_SHAPED) - $infobox[] = Lang::$item['useInShape']; + $infobox[] = Lang::item('useInShape'); // cant roll need if ($this->subject->getField('flagsExtra') & 0x0100) - $infobox[] = '[tooltip=tooltip_cannotrollneed]'.Lang::$item['noNeedRoll'].'[/tooltip]'; + $infobox[] = '[tooltip=tooltip_cannotrollneed]'.Lang::item('noNeedRoll').'[/tooltip]'; // fits into keyring if ($_bagFamily & 0x0100) - $infobox[] = Lang::$item['atKeyring']; + $infobox[] = Lang::item('atKeyring'); /****************/ /* Main Content */ @@ -389,13 +389,13 @@ class ItemPage extends genericPage if (!$altItem->error) { $this->transfer = sprintf( - Lang::$item['_transfer'], + Lang::item('_transfer'), $altItem->id, $altItem->getField('quality'), $altItem->getField('iconString'), $altItem->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) ); } } @@ -968,17 +968,17 @@ class ItemPage extends genericPage // itemlevel $xml->addChild('level', $this->subject->getField('itemLevel')); // quality - $xml->addChild('quality', Lang::$item['quality'][$this->subject->getField('quality')])->addAttribute('id', $this->subject->getField('quality')); + $xml->addChild('quality', Lang::item('quality', $this->subject->getField('quality')))->addAttribute('id', $this->subject->getField('quality')); // class - $x = Lang::$item['cat'][$this->subject->getField('class')]; + $x = Lang::item('cat', $this->subject->getField('class')); $xml->addChild('class')->addCData(is_array($x) ? $x[0] : $x)->addAttribute('id', $this->subject->getField('class')); // subclass - $x = $this->subject->getField('class') == 2 ? Lang::$spell['weaponSubClass'] : Lang::$item['cat'][$this->subject->getField('class')][1]; + $x = $this->subject->getField('class') == 2 ? Lang::spell('weaponSubClass') : Lang::item('cat', $this->subject->getField('class'), 1); $xml->addChild('subclass')->addCData(is_array($x) ? (is_array($x[$this->subject->getField('subClass')]) ? $x[$this->subject->getField('subClass')][0] : $x[$this->subject->getField('subClass')]) : null)->addAttribute('id', $this->subject->getField('subClass')); // icon + displayId $xml->addChild('icon', $this->subject->getField('iconString'))->addAttribute('displayId', $this->subject->getField('displayId')); // inventorySlot - $xml->addChild('inventorySlot', Lang::$item['inventoryType'][$this->subject->getField('slot')])->addAttribute('id', $this->subject->getField('slot')); + $xml->addChild('inventorySlot', Lang::item('inventoryType', $this->subject->getField('slot')))->addAttribute('id', $this->subject->getField('slot')); // tooltip $xml->addChild('htmlTooltip')->addCData($this->subject->renderTooltip()); diff --git a/pages/items.php b/pages/items.php index c7f052c1..0ba752a6 100644 --- a/pages/items.php +++ b/pages/items.php @@ -86,7 +86,7 @@ class ItemsPage extends GenericPage parent::__construct($pageCall, $pageParam); - $this->name = Util::ucFirst(Lang::$game['items']); + $this->name = Util::ucFirst(Lang::game('items')); $this->subCat = $pageParam ? '='.$pageParam : ''; } @@ -122,7 +122,7 @@ class ItemsPage extends GenericPage $this->filter['slot'][$k] = $str; if (isset($this->filter['slot'][INVTYPE_SHIELD])) // "Off Hand" => "Shield" - $this->filter['slot'][INVTYPE_SHIELD] = Lang::$item['armorSubClass'][6]; + $this->filter['slot'][INVTYPE_SHIELD] = Lang::item('armorSubClass', 6); $xCols = $this->filterObj->getForm('extraCols', true); @@ -237,7 +237,7 @@ class ItemsPage extends GenericPage if ($groups) { - $nameSource = Lang::$item['inventoryType']; + $nameSource = Lang::item('inventoryType'); $this->forceTabs = true; } @@ -254,7 +254,7 @@ class ItemsPage extends GenericPage { $l = $levelRef->getField('itemLevel'); $groups[] = $l; - $nameSource[$l] = Lang::$game['level'].' '.$l; + $nameSource[$l] = Lang::game('level').' '.$l; } if ($groups) @@ -262,14 +262,14 @@ class ItemsPage extends GenericPage $l = -end($groups); $groups[] = $l; // push last value as negativ to signal misc group after $this level $extraOpts = ['i' => ['o' => ['itemlevel DESC']]]; - $nameSource[$l] = Lang::$item['tabOther']; + $nameSource[$l] = Lang::item('tabOther'); $this->forceTabs = true; } break; case 3: // source $groups = [1, 2, 3, 4, 5, 10, 11, 12, 0]; - $nameSource = Lang::$game['sources']; + $nameSource = Lang::game('sources'); $this->forceTabs = true; break; @@ -427,8 +427,8 @@ class ItemsPage extends GenericPage } // sort for dropdown-menus - asort(Lang::$game['ra']); - asort(Lang::$game['cl']); + asort(Lang::game('ra')); + asort(Lang::game('cl')); } protected function generateTitle() @@ -438,12 +438,12 @@ class ItemsPage extends GenericPage if (!$this->category) return; - if (isset($this->category[2]) && is_array(Lang::$item['cat'][$this->category[0]][1][$this->category[1]])) - $tPart = Lang::$item['cat'][$this->category[0]][1][$this->category[1]][1][$this->category[2]]; - else if (isset($this->category[1]) && is_array(Lang::$item['cat'][$this->category[0]])) - $tPart = Lang::$item['cat'][$this->category[0]][1][$this->category[1]]; + if (isset($this->category[2]) && is_array(Lang::item('cat', $this->category[0], 1, $this->category[1]))) + $tPart = Lang::item('cat', $this->category[0], 1, $this->category[1], 1, $this->category[2]); + else if (isset($this->category[1]) && is_array(Lang::item('cat', $this->category[0]))) + $tPart = Lang::item('cat', $this->category[0], 1, $this->category[1]); else - $tPart = Lang::$item['cat'][$this->category[0]]; + $tPart = Lang::item('cat', $this->category[0]); array_unshift($this->title, is_array($tPart) ? $tPart[0] : $tPart); } @@ -519,45 +519,45 @@ class ItemsPage extends GenericPage if (!$this->category) { - $menu['slot'] = [Lang::$item['inventoryType'], null]; + $menu['slot'] = [Lang::item('inventoryType'), null]; asort($menu['slot'][0]); } else { - if (isset($this->category[2]) && is_array(Lang::$item['cat'][$this->category[0]][1][$this->category[1]])) - $catList = Lang::$item['cat'][$this->category[0]][1][$this->category[1]][1][$this->category[2]]; - else if (isset($this->category[1]) && is_array(Lang::$item['cat'][$this->category[0]])) - $catList = Lang::$item['cat'][$this->category[0]][1][$this->category[1]]; + if (isset($this->category[2]) && is_array(Lang::item('cat', $this->category[0], 1, $this->category[1]))) + $catList = Lang::item('cat', $this->category[0], 1, $this->category[1], 1, $this->category[2]); + else if (isset($this->category[1]) && is_array(Lang::item('cat', $this->category[0]))) + $catList = Lang::item('cat', $this->category[0], 1, $this->category[1]); else - $catList = Lang::$item['cat'][$this->category[0]]; + $catList = Lang::item('cat', $this->category[0]); switch ($this->category[0]) { case 0: if (!isset($this->category[1])) - $menu['type'] = [Lang::$item['cat'][0][1], null]; + $menu['type'] = [Lang::item('cat', 0, 1), null]; if (!isset($this->category[1]) || in_array($this->category[1], [6, -3])) { - $menu['slot'] = [Lang::$item['inventoryType'], 0x63EFEA]; + $menu['slot'] = [Lang::item('inventoryType'), 0x63EFEA]; asort($menu['slot'][0]); } break; case 2: if (!isset($this->category[1])) - $menu['type'] = [Lang::$spell['weaponSubClass'], null]; + $menu['type'] = [Lang::spell('weaponSubClass'), null]; - $menu['slot'] = [Lang::$item['inventoryType'], 0x262A000]; + $menu['slot'] = [Lang::item('inventoryType'), 0x262A000]; asort($menu['slot'][0]); break; case 4: if (!isset($this->category[1])) { - $menu['slot'] = [Lang::$item['inventoryType'], 0x10895FFE]; - $menu['type'] = [Lang::$item['cat'][4][1], null]; + $menu['slot'] = [Lang::item('inventoryType'), 0x10895FFE]; + $menu['type'] = [Lang::item('cat', 4, 1), null]; } else if (in_array($this->category[1], [1, 2, 3, 4])) - $menu['slot'] = [Lang::$item['inventoryType'], 0x7EA]; + $menu['slot'] = [Lang::item('inventoryType'), 0x7EA]; asort($menu['slot'][0]); break; diff --git a/pages/itemset.php b/pages/itemset.php index 0192b339..df6868db 100644 --- a/pages/itemset.php +++ b/pages/itemset.php @@ -29,7 +29,7 @@ class ItemsetPage extends GenericPage $this->subject = new ItemsetList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::$game['itemset']); + $this->notFound(Lang::game('itemset')); $this->name = $this->subject->getField('name', true); $this->extendGlobalData($this->subject->getJSGlobals()); @@ -49,7 +49,7 @@ class ItemsetPage extends GenericPage protected function generateTitle() { - array_unshift($this->title, $this->name, Util::ucFirst(Lang::$game['itemset'])); + array_unshift($this->title, $this->name, Util::ucFirst(Lang::game('itemset'))); } protected function generateContent() @@ -66,19 +66,19 @@ class ItemsetPage extends GenericPage // unavailable (todo (low): set data) if ($this->subject->getField('cuFlags') & CUSTOM_UNAVAILABLE) - $infobox[] = Lang::$main['unavailable']; + $infobox[] = Lang::main('unavailable'); // holiday if ($h = $this->subject->getField('holidayId')) { - $infobox[] = Lang::$game['eventShort'].Lang::$main['colon'].'[event='.$h.']'; + $infobox[] = Lang::game('eventShort').Lang::main('colon').'[event='.$h.']'; $this->extendGlobalIds(TYPE_WORLDEVENT, $h); } // itemLevel if ($min = $this->subject->getField('minLevel')) { - $foo = Lang::$game['level'].Lang::$main['colon'].$min; + $foo = Lang::game('level').Lang::main('colon').$min; $max = $this->subject->getField('maxLevel'); if ($min < $max) @@ -91,21 +91,21 @@ class ItemsetPage extends GenericPage if ($cl = Lang::getClassString($this->subject->getField('classMask'), $jsg, $qty, false)) { $this->extendGlobalIds(TYPE_CLASS, $jsg); - $t = $qty == 1 ? Lang::$game['class'] : Lang::$game['classes']; - $infobox[] = Util::ucFirst($t).Lang::$main['colon'].$cl; + $t = $qty == 1 ? Lang::game('class') : Lang::game('classes'); + $infobox[] = Util::ucFirst($t).Lang::main('colon').$cl; } // required level if ($lvl = $this->subject->getField('reqLevel')) - $infobox[] = sprintf(Lang::$game['reqLevel'], $lvl); + $infobox[] = sprintf(Lang::game('reqLevel'), $lvl); // type if ($_ty) - $infobox[] = Lang::$game['type'].Lang::$main['colon'].Lang::$itemset['types'][$_ty]; + $infobox[] = Lang::game('type').Lang::main('colon').Lang::itemset('types', $_ty); // tag if ($_ta) - $infobox[] = Lang::$itemset['_tag'].Lang::$main['colon'].'[url=?itemsets&filter=ta='.$_ta.']'.Lang::$itemset['notes'][$_ta].'[/url]'; + $infobox[] = Lang::itemset('_tag').Lang::main('colon').'[url=?itemsets&filter=ta='.$_ta.']'.Lang::itemset('notes', $_ta).'[/url]'; /****************/ /* Main Content */ @@ -186,12 +186,12 @@ class ItemsetPage extends GenericPage $skill = ''; if ($_sk = $this->subject->getField('skillId')) { - $spellLink = sprintf('%s (%s)', $_sk, Lang::$spell['cat'][11][$_sk][0], $this->subject->getField('skillLevel')); - $skill = ' – '.sprintf(Lang::$game['requires'], $spellLink).''; + $spellLink = sprintf('%s (%s)', $_sk, Lang::spell('cat', 11, $_sk, 0), $this->subject->getField('skillLevel')); + $skill = ' – '.sprintf(Lang::game('requires'), $spellLink).''; } $this->bonusExt = $skill; - $this->description = $_ta ? sprintf(Lang::$itemset['_desc'], $this->name, Lang::$itemset['notes'][$_ta], $_cnt) : sprintf(Lang::$itemset['_descTagless'], $this->name, $_cnt); + $this->description = $_ta ? sprintf(Lang::itemset('_desc'), $this->name, Lang::itemset('notes', $_ta), $_cnt) : sprintf(Lang::itemset('_descTagless'), $this->name, $_cnt); $this->unavailable = $this->subject->getField('cuFlags') & CUSTOM_UNAVAILABLE; $this->infobox = $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null; $this->pieces = $pieces; diff --git a/pages/itemsets.php b/pages/itemsets.php index 1ed6014b..064a8a98 100644 --- a/pages/itemsets.php +++ b/pages/itemsets.php @@ -24,7 +24,7 @@ class ItemsetsPage extends GenericPage parent::__construct($pageCall, $pageParam); - $this->name = Util::ucFirst(Lang::$game['itemsets']); + $this->name = Util::ucFirst(Lang::game('itemsets')); } protected function generateContent() @@ -69,8 +69,8 @@ class ItemsetsPage extends GenericPage $this->lvTabs[] = $lv; // sort for dropdown-menus - asort(Lang::$itemset['notes'], SORT_NATURAL); - asort(Lang::$game['cl']); + asort(Lang::itemset('notes'), SORT_NATURAL); + asort(Lang::game('cl')); } protected function generateTitle() @@ -79,7 +79,7 @@ class ItemsetsPage extends GenericPage $form = $this->filterObj->getForm('form'); if (isset($form['cl'])) - array_unshift($this->title, Lang::$game['cl'][$form['cl']]); + array_unshift($this->title, Lang::game('cl', $form['cl'])); } protected function generatePath() diff --git a/pages/maps.php b/pages/maps.php index c2d11ea6..e25dfb37 100644 --- a/pages/maps.php +++ b/pages/maps.php @@ -18,7 +18,7 @@ class MapsPage extends GenericPage { parent::__construct($pageCall, $__); - $this->name = Lang::$maps['maps']; + $this->name = Lang::maps('maps'); } protected function generateContent() diff --git a/pages/more.php b/pages/more.php index c5123971..8b922add 100644 --- a/pages/more.php +++ b/pages/more.php @@ -43,7 +43,7 @@ class MorePage extends GenericPage $this->error(); if ($pageCall == 'help') // ye.. hack .. class definitions only allow static values - $_[2] = Lang::$main['helpTopics'][$_[1]]; + $_[2] = Lang::main('helpTopics', $_[1]); } $this->type = $_[0]; $this->typeId = $_[1]; diff --git a/pages/npc.php b/pages/npc.php index f14a668f..49ec7957 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -30,7 +30,7 @@ class NpcPage extends GenericPage $this->subject = new CreatureList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::$game['npc']); + $this->notFound(Lang::game('npc')); $this->name = $this->subject->getField('name', true); $this->subname = $this->subject->getField('subname', true); @@ -46,7 +46,7 @@ class NpcPage extends GenericPage protected function generateTitle() { - array_unshift($this->title, $this->name, Util::ucFirst(Lang::$game['npc'])); + array_unshift($this->title, $this->name, Util::ucFirst(Lang::game('npc'))); } protected function generateContent() @@ -116,7 +116,7 @@ class NpcPage extends GenericPage foreach ($_ as $i => $e) $ev[] = ($i % 2 ? '[br]' : ' ') . '[event='.$e.']'; - $infobox[] = Util::ucFirst(Lang::$game['eventShort']).Lang::$main['colon'].implode(',', $ev); + $infobox[] = Util::ucFirst(Lang::game('eventShort')).Lang::main('colon').implode(',', $ev); } // Level @@ -130,13 +130,13 @@ class NpcPage extends GenericPage else // Boss Level $level = '??'; - $infobox[] = Lang::$game['level'].Lang::$main['colon'].$level; + $infobox[] = Lang::game('level').Lang::main('colon').$level; // Classification if ($_ = $this->subject->getField('rank')) // != NPC_RANK_NORMAL { - $str = $_typeFlags & 0x4 ? '[span class=icon-boss]'.Lang::$npc['rank'][$_].'[/span]' : Lang::$npc['rank'][$_]; - $infobox[] = Lang::$npc['classification'].Lang::$main['colon'].$str; + $str = $_typeFlags & 0x4 ? '[span class=icon-boss]'.Lang::npc('rank', $_).'[/span]' : Lang::npc('rank', $_); + $infobox[] = Lang::npc('classification').Lang::main('colon').$str; } // Reaction @@ -146,32 +146,32 @@ class NpcPage extends GenericPage if ($r == -1) return 10; return; }; - $infobox[] = Lang::$npc['react'].Lang::$main['colon'].'[color=q'.$_($this->subject->getField('A')).']A[/color] [color=q'.$_($this->subject->getField('H')).']H[/color]'; + $infobox[] = Lang::npc('react').Lang::main('colon').'[color=q'.$_($this->subject->getField('A')).']A[/color] [color=q'.$_($this->subject->getField('H')).']H[/color]'; // Faction $this->extendGlobalIds(TYPE_FACTION, $this->subject->getField('factionId')); - $infobox[] = Util::ucFirst(Lang::$game['faction']).Lang::$main['colon'].'[faction='.$this->subject->getField('factionId').']'; + $infobox[] = Util::ucFirst(Lang::game('faction')).Lang::main('colon').'[faction='.$this->subject->getField('factionId').']'; // Tameable if ($_typeFlags & 0x1) if ($_ = $this->subject->getField('family')) - $infobox[] = sprintf(Lang::$npc['tameable'], '[url=pet='.$_.']'.Lang::$game['fa'][$_].'[/url]'); + $infobox[] = sprintf(Lang::npc('tameable'), '[url=pet='.$_.']'.Lang::game('fa', $_).'[/url]'); // Wealth if ($_ = intVal(($this->subject->getField('minGold') + $this->subject->getField('maxGold')) / 2)) - $infobox[] = Lang::$npc['worth'].Lang::$main['colon'].'[tooltip=tooltip_avgmoneydropped][money='.$_.'][/tooltip]'; + $infobox[] = Lang::npc('worth').Lang::main('colon').'[tooltip=tooltip_avgmoneydropped][money='.$_.'][/tooltip]'; // is Vehicle if ($this->subject->getField('vehicleId')) - $infobox[] = Lang::$npc['vehicle']; + $infobox[] = Lang::npc('vehicle'); // AI if (User::isInGroup(U_GROUP_EMPLOYEE)) { if ($_ = $this->subject->getField('scriptName')) - $infobox[] = 'Script'.Lang::$main['colon'].$_; + $infobox[] = 'Script'.Lang::main('colon').$_; else if ($_ = $this->subject->getField('aiName')) - $infobox[] = 'AI'.Lang::$main['colon'].$_; + $infobox[] = 'AI'.Lang::main('colon').$_; } if (User::isInGroup(U_GROUP_STAFF)) @@ -233,26 +233,26 @@ class NpcPage extends GenericPage $modeRow = '[tr][td]%s  [/td][td]%s[/td][/tr]'; // Health $health = $this->subject->getBaseStats('health'); - $stats['health'] = Util::ucFirst(Lang::$spell['powerTypes'][-2]).Lang::$main['colon'].($health[0] < $health[1] ? $_nf($health[0]).' - '.$_nf($health[1]) : $_nf($health[0])); + $stats['health'] = Util::ucFirst(Lang::spell('powerTypes', -2)).Lang::main('colon').($health[0] < $health[1] ? $_nf($health[0]).' - '.$_nf($health[1]) : $_nf($health[0])); // Mana (may be 0) $mana = $this->subject->getBaseStats('power'); - $stats['mana'] = $mana[0] ? Lang::$spell['powerTypes'][0].Lang::$main['colon'].($mana[0] < $mana[1] ? $_nf($mana[0]).' - '.$_nf($mana[1]) : $_nf($mana[0])) : null; + $stats['mana'] = $mana[0] ? Lang::spell('powerTypes', 0).Lang::main('colon').($mana[0] < $mana[1] ? $_nf($mana[0]).' - '.$_nf($mana[1]) : $_nf($mana[0])) : null; // Armor $armor = $this->subject->getBaseStats('armor'); - $stats['armor'] = Lang::$npc['armor'].Lang::$main['colon'].($armor[0] < $armor[1] ? $_nf($armor[0]).' - '.$_nf($armor[1]) : $_nf($armor[0])); + $stats['armor'] = Lang::npc('armor').Lang::main('colon').($armor[0] < $armor[1] ? $_nf($armor[0]).' - '.$_nf($armor[1]) : $_nf($armor[0])); // Melee Damage $melee = $this->subject->getBaseStats('melee'); if ($_ = $this->subject->getField('dmgSchool')) // magic damage - $stats['melee'] = Lang::$npc['melee'].Lang::$main['colon'].$_nf($melee[0]).' - '.$_nf($melee[1]).' ('.Lang::$game['sc'][$_].')'; + $stats['melee'] = Lang::npc('melee').Lang::main('colon').$_nf($melee[0]).' - '.$_nf($melee[1]).' ('.Lang::game('sc', $_).')'; else // phys. damage - $stats['melee'] = Lang::$npc['melee'].Lang::$main['colon'].$_nf($melee[0]).' - '.$_nf($melee[1]); + $stats['melee'] = Lang::npc('melee').Lang::main('colon').$_nf($melee[0]).' - '.$_nf($melee[1]); // Ranged Damage $ranged = $this->subject->getBaseStats('ranged'); - $stats['ranged'] = Lang::$npc['ranged'].Lang::$main['colon'].$_nf($ranged[0]).' - '.$_nf($ranged[1]); + $stats['ranged'] = Lang::npc('ranged').Lang::main('colon').$_nf($ranged[0]).' - '.$_nf($ranged[1]); if (in_array($mapType, [1, 2])) // Dungeon or Raid { @@ -263,7 +263,7 @@ class NpcPage extends GenericPage if ($dId != $id) continue; - $m = Lang::$npc['modes'][$mapType][$mode]; + $m = Lang::npc('modes', $mapType, $mode); // Health $health = $_altNPCs->getBaseStats('health'); @@ -280,7 +280,7 @@ class NpcPage extends GenericPage // Melee Damage $melee = $_altNPCs->getBaseStats('melee'); if ($_ = $_altNPCs->getField('dmgSchool')) // magic damage - $modes['melee'][] = sprintf($modeRow, $m, $_nf($melee[0]).' - '.$_nf($melee[1]).' ('.Lang::$game['sc'][$_].')'); + $modes['melee'][] = sprintf($modeRow, $m, $_nf($melee[0]).' - '.$_nf($melee[1]).' ('.Lang::game('sc', $_).')'); else // phys. damage $modes['melee'][] = sprintf($modeRow, $m, $_nf($melee[0]).' - '.$_nf($melee[1])); @@ -298,7 +298,7 @@ class NpcPage extends GenericPage // < Stats if ($stats) - $infobox[] = Lang::$npc['stats'].($modes ? ' ('.Lang::$npc['modes'][$mapType][0].')' : null).Lang::$main['colon'].'[ul][li]'.implode('[/li][li]', $stats).'[/li][/ul]'; + $infobox[] = Lang::npc('stats').($modes ? ' ('.Lang::npc('modes', $mapType, 0).')' : null).Lang::main('colon').'[ul][li]'.implode('[/li][li]', $stats).'[/li][/ul]'; /****************/ /* Main Content */ @@ -759,7 +759,7 @@ class NpcPage extends GenericPage foreach ($data as $id => &$d) $d['seat'] = str_replace(',', ', ', $_[$id]); - $xCols = "$[Listview.funcBox.createSimpleCol('seat', '".Lang::$npc['seat']."', '10%', 'seat')]"; + $xCols = "$[Listview.funcBox.createSimpleCol('seat', '".Lang::npc('seat')."', '10%', 'seat')]"; } $this->extendGlobalData($passengers->getJSGlobals(GLOBALINFO_SELF)); @@ -768,7 +768,7 @@ class NpcPage extends GenericPage 'data' => $data, 'params' => array( 'extraCols' => $xCols, - 'name' => Lang::$npc['accessory'], + 'name' => Lang::npc('accessory'), 'id' => 'accessory' ) ); @@ -840,7 +840,7 @@ class NpcPage extends GenericPage 'qty' => $row['qty'], 'name' => $factions->getField('name', true), 'npc' => $row['npc'], - 'cap' => $row['maxRank'] && $row['maxRank'] < REP_EXALTED ? Lang::$game['rep'][$row['maxRank']] : null + 'cap' => $row['maxRank'] && $row['maxRank'] < REP_EXALTED ? Lang::game('rep', $row['maxRank']) : null ); if ($row['spillover']) @@ -862,7 +862,7 @@ class NpcPage extends GenericPage // base NPC if ($base = $this->getRepForId($this->typeId, $spilledParents)) - $reputation[] = [Lang::$npc['modes'][1][0], $base]; + $reputation[] = [Lang::npc('modes', 1, 0), $base]; // difficulty dummys if ($dummyIds) @@ -876,7 +876,7 @@ class NpcPage extends GenericPage // apply by difficulty foreach ($alt as $mode => $dat) - $reputation[] = [Lang::$npc['modes'][$mapType][$mode], $dat]; + $reputation[] = [Lang::npc('modes', $mapType, $mode), $dat]; } // get spillover factions and apply @@ -907,7 +907,7 @@ class NpcPage extends GenericPage 'id' => $spId, 'qty' => $spilledParents[$row['spillover']][0], 'name' => $spilled->getField('name', true), - 'cap' => $spMax && $spMax < REP_EXALTED ? Lang::$game['rep'][$spMax] : null + 'cap' => $spMax && $spMax < REP_EXALTED ? Lang::game('rep', $spMax) : null ); } } @@ -958,7 +958,7 @@ class NpcPage extends GenericPage $line = array( 'range' => $t['range'], 'type' => 2, // [type: 0, 12] say: yellow-ish - 'lang' => !empty($t['language']) ? Lang::$game['languages'][$t['language']] : null, + 'lang' => !empty($t['language']) ? Lang::game('languages', $t['language']) : null, 'text' => sprintf(Util::parseHtmlText(htmlentities($msg)), $this->name), ); diff --git a/pages/npcs.php b/pages/npcs.php index 5abae9fb..245c5077 100644 --- a/pages/npcs.php +++ b/pages/npcs.php @@ -25,12 +25,14 @@ class NpcsPage extends GenericPage parent::__construct($pageCall, $pageParam); - $this->name = Util::ucFirst(Lang::$game['npcs']); + $this->name = Util::ucFirst(Lang::game('npcs')); $this->subCat = $pageParam ? '='.$pageParam : ''; } protected function generateContent() { + $this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']); + $conditions = []; if (!User::isInGroup(U_GROUP_EMPLOYEE)) @@ -80,14 +82,14 @@ class NpcsPage extends GenericPage $this->lvTabs[] = $lv; // sort for dropdown-menus - asort(Lang::$game['fa']); + asort(Lang::game('fa')); } protected function generateTitle() { array_unshift($this->title, $this->name); if ($this->category) - array_unshift($this->title, Lang::$npc['cat'][$this->category[0]]); + array_unshift($this->title, Lang::npc('cat', $this->category[0])); } protected function generatePath() diff --git a/pages/object.php b/pages/object.php index c8195d9e..3d3957e4 100644 --- a/pages/object.php +++ b/pages/object.php @@ -37,7 +37,7 @@ class ObjectPage extends GenericPage $this->subject = new GameObjectList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::$game['gameObject']); + $this->notFound(Lang::game('gameObject')); $this->name = $this->subject->getField('name', true); } @@ -49,7 +49,7 @@ class ObjectPage extends GenericPage protected function generateTitle() { - array_unshift($this->title, $this->name, Util::ucFirst(Lang::$game['gameObject'])); + array_unshift($this->title, $this->name, Util::ucFirst(Lang::game('gameObject'))); } protected function generateContent() @@ -70,7 +70,7 @@ class ObjectPage extends GenericPage foreach ($_ as $i => $e) $ev[] = ($i % 2 ? '[br]' : ' ') . '[event='.$e.']'; - $infobox[] = Util::ucFirst(Lang::$game['eventShort']).Lang::$main['colon'].implode(',', $ev); + $infobox[] = Util::ucFirst(Lang::game('eventShort')).Lang::main('colon').implode(',', $ev); } // Reaction @@ -80,19 +80,19 @@ class ObjectPage extends GenericPage if ($r == -1) return 10; return; }; - $infobox[] = Lang::$npc['react'].Lang::$main['colon'].'[color=q'.$_($this->subject->getField('A')).']A[/color] [color=q'.$_($this->subject->getField('H')).']H[/color]'; + $infobox[] = Lang::npc('react').Lang::main('colon').'[color=q'.$_($this->subject->getField('A')).']A[/color] [color=q'.$_($this->subject->getField('H')).']H[/color]'; // reqSkill switch ($this->subject->getField('typeCat')) { case -3: // Herbalism - $infobox[] = sprintf(Lang::$game['requires'], Lang::$spell['lockType'][2].' ('.$this->subject->getField('reqSkill').')'); + $infobox[] = sprintf(Lang::game('requires'), Lang::spell('lockType', 2).' ('.$this->subject->getField('reqSkill').')'); break; case -4: // Mining - $infobox[] = sprintf(Lang::$game['requires'], Lang::$spell['lockType'][3].' ('.$this->subject->getField('reqSkill').')'); + $infobox[] = sprintf(Lang::game('requires'), Lang::spell('lockType', 3).' ('.$this->subject->getField('reqSkill').')'); break; case -5: // Lockpicking - $infobox[] = sprintf(Lang::$game['requires'], Lang::$spell['lockType'][1].' ('.$this->subject->getField('reqSkill').')'); + $infobox[] = sprintf(Lang::game('requires'), Lang::spell('lockType', 1).' ('.$this->subject->getField('reqSkill').')'); break; default: // requires key .. maybe { @@ -104,7 +104,7 @@ class ObjectPage extends GenericPage continue; $this->extendGlobalIds(TYPE_ITEM, $idx); - $l = Lang::$gameObject['key'].Lang::$main['colon'].'[item='.$idx.']'; + $l = Lang::gameObject('key').Lang::main('colon').'[item='.$idx.']'; } // if no propper item is found use a skill @@ -117,7 +117,7 @@ class ObjectPage extends GenericPage if ($_ = $this->subject->getField('linkedTrap')) { $this->extendGlobalIds(TYPE_OBJECT, $_); - $infobox[] = Lang::$gameObject['trap'].Lang::$main['colon'].'[object='.$_.']'; + $infobox[] = Lang::gameObject('trap').Lang::main('colon').'[object='.$_.']'; } // trap for @@ -125,20 +125,20 @@ class ObjectPage extends GenericPage if (!$trigger->error) { $this->extendGlobalData($trigger->getJSGlobals()); - $infobox[] = Lang::$gameObject['triggeredBy'].Lang::$main['colon'].'[object='.$trigger->id.']'; + $infobox[] = Lang::gameObject('triggeredBy').Lang::main('colon').'[object='.$trigger->id.']'; } // SpellFocus if ($_ = $this->subject->getField('spellFocusId')) if ($sfo = DB::Aowow()->selectRow('SELECT * FROM ?_spellfocusobject WHERE id = ?d', $_)) - $infobox[] = '[tooltip name=focus]'.Lang::$gameObject['focusDesc'].'[/tooltip][span class=tip tooltip=focus]'.Lang::$gameObject['focus'].Lang::$main['colon'].Util::localizedString($sfo, 'name').'[/span]'; + $infobox[] = '[tooltip name=focus]'.Lang::gameObject('focusDesc').'[/tooltip][span class=tip tooltip=focus]'.Lang::gameObject('focus').Lang::main('colon').Util::localizedString($sfo, 'name').'[/span]'; // lootinfo: [min, max, restock] if (($_ = $this->subject->getField('lootStack')) && $_[0]) { - $buff = Lang::$item['charges'].Lang::$main['colon'].$_[0]; + $buff = Lang::item('charges').Lang::main('colon').$_[0]; if ($_[0] < $_[1]) - $buff .= Lang::$game['valueDelim'].$_[1]; + $buff .= Lang::game('valueDelim').$_[1]; // since Veins don't have charges anymore, the timer is questionable $infobox[] = $_[2] > 1 ? '[tooltip name=restock]'.sprintf(Lang::gameObject('restock'), Util::formatTime($_[2] * 1000)).'[/tooltip][span class=tip tooltip=restock]'.$buff.'[/span]' : $buff; @@ -150,13 +150,13 @@ class ObjectPage extends GenericPage if ($_ = $this->subject->getField('mStone')) { $this->extendGlobalIds(TYPE_ZONE, $_[2]); - $m = Lang::$game['meetingStone'].Lang::$main['colon'].'[zone='.$_[2].']'; + $m = Lang::game('meetingStone').Lang::main('colon').'[zone='.$_[2].']'; $l = $_[0]; if ($_[0] > 1 && $_[1] > $_[0]) - $l .= Lang::$game['valueDelim'].min($_[1], MAX_LEVEL); + $l .= Lang::game('valueDelim').min($_[1], MAX_LEVEL); - $infobox[] = $l ? '[tooltip name=meetingstone]'.sprintf(Lang::$game['reqLevel'], $l).'[/tooltip][span class=tip tooltip=meetingstone]'.$m.'[/span]' : $m; + $infobox[] = $l ? '[tooltip name=meetingstone]'.sprintf(Lang::game('reqLevel'), $l).'[/tooltip][span class=tip tooltip=meetingstone]'.$m.'[/span]' : $m; } } @@ -165,19 +165,19 @@ class ObjectPage extends GenericPage { if ($_ = $this->subject->getField('capture')) { - $buff = Lang::$gameObject['capturePoint']; + $buff = Lang::gameObject('capturePoint'); if ($_[2] > 1 || $_[0]) - $buff .= Lang::$main['colon'].'[ul]'; + $buff .= Lang::main('colon').'[ul]'; if ($_[2] > 1) - $buff .= '[li]'.Lang::$game['duration'].Lang::$main['colon'].($_[3] > $_[2] ? Util::FormatTime($_[3] * 1000, true).' - ' : null).Util::FormatTime($_[2] * 1000, true).'[/li]'; + $buff .= '[li]'.Lang::game('duration').Lang::main('colon').($_[3] > $_[2] ? Util::FormatTime($_[3] * 1000, true).' - ' : null).Util::FormatTime($_[2] * 1000, true).'[/li]'; if ($_[1]) - $buff .= '[li]'.Lang::$main['players'].Lang::$main['colon'].$_[0].($_[1] > $_[0] ? ' - '.$_[1] : null).'[/li]'; + $buff .= '[li]'.Lang::main('players').Lang::main('colon').$_[0].($_[1] > $_[0] ? ' - '.$_[1] : null).'[/li]'; if ($_[4]) - $buff .= '[li]'.sprintf(Lang::$spell['range'], $_[4]).'[/li]'; + $buff .= '[li]'.sprintf(Lang::spell('range'), $_[4]).'[/li]'; if ($_[2] > 1 || $_[0]) $buff .= '[/ul]'; @@ -190,9 +190,9 @@ class ObjectPage extends GenericPage if (User::isInGroup(U_GROUP_EMPLOYEE)) { if ($_ = $this->subject->getField('ScriptName')) - $infobox[] = 'Script'.Lang::$main['colon'].$_; + $infobox[] = 'Script'.Lang::main('colon').$_; else if ($_ = $this->subject->getField('AIName')) - $infobox[] = 'AI'.Lang::$main['colon'].$_; + $infobox[] = 'AI'.Lang::main('colon').$_; } diff --git a/pages/objects.php b/pages/objects.php index c01e87fd..4a90c44e 100644 --- a/pages/objects.php +++ b/pages/objects.php @@ -25,7 +25,7 @@ class ObjectsPage extends GenericPage parent::__construct($pageCall, $pageParam); - $this->name = Util::ucFirst(Lang::$game['gameObjects']); + $this->name = Util::ucFirst(Lang::game('gameObjects')); $this->subCat = $pageParam ? '='.$pageParam : ''; } @@ -78,7 +78,7 @@ class ObjectsPage extends GenericPage { array_unshift($this->title, $this->name); if ($this->category) - array_unshift($this->title, Lang::$gameObject['cat'][$this->category[0]]); + array_unshift($this->title, Lang::gameObject('cat', $this->category[0])); } protected function generatePath() diff --git a/pages/pet.php b/pages/pet.php index cfd0a1df..ee5468dd 100644 --- a/pages/pet.php +++ b/pages/pet.php @@ -26,7 +26,7 @@ class PetPage extends GenericPage $this->subject = new PetList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::$game['pet']); + $this->notFound(Lang::game('pet')); $this->name = $this->subject->getField('name', true); } @@ -38,7 +38,7 @@ class PetPage extends GenericPage protected function generateTitle() { - array_unshift($this->title, $this->name, Util::ucFirst(Lang::$game['pet'])); + array_unshift($this->title, $this->name, Util::ucFirst(Lang::game('pet'))); } protected function generateContent() @@ -52,11 +52,11 @@ class PetPage extends GenericPage $infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags')); // level range - $infobox[] = Lang::$game['level'].Lang::$main['colon'].$this->subject->getField('minLevel').' - '.$this->subject->getField('maxLevel'); + $infobox[] = Lang::game('level').Lang::main('colon').$this->subject->getField('minLevel').' - '.$this->subject->getField('maxLevel'); // exotic if ($this->subject->getField('exotic')) - $infobox[] = '[url=?spell=53270]'.Lang::$pet['exotic'].'[/url]'; + $infobox[] = '[url=?spell=53270]'.Lang::pet('exotic').'[/url]'; /****************/ /* Main Content */ diff --git a/pages/pets.php b/pages/pets.php index b2288a7a..f63c3001 100644 --- a/pages/pets.php +++ b/pages/pets.php @@ -23,7 +23,7 @@ class PetsPage extends GenericPage parent::__construct($pageCall, $pageParam); - $this->name = Util::ucFirst(Lang::$game['pets']); + $this->name = Util::ucFirst(Lang::game('pets')); } protected function generateContent() @@ -55,9 +55,9 @@ class PetsPage extends GenericPage protected function generateTitle() { - array_unshift($this->title, Util::ucFirst(Lang::$game['pets'])); + array_unshift($this->title, Util::ucFirst(Lang::game('pets'))); if ($this->category) - array_unshift($this->title, Lang::$pet['cat'][$this->category[0]]); + array_unshift($this->title, Lang::pet('cat', $this->category[0])); } protected function generatePath() diff --git a/pages/profile.php b/pages/profile.php index ee57ddb7..2181fec2 100644 --- a/pages/profile.php +++ b/pages/profile.php @@ -41,7 +41,7 @@ class ProfilePage extends GenericPage if ($foo = DB::Aowow()->selectCell('SELECT 2161862')) $this->profileId = $foo; else - $this->notFound(Util::ucFirst(Lang::$game['profile'])); + $this->notFound(Util::ucFirst(Lang::game('profile'))); $this->isCustom = true; $this->profile = intVal($_[0]); @@ -52,12 +52,12 @@ class ProfilePage extends GenericPage if ($foo = DB::Aowow()->selectCell('SELECT 2161862')) $this->profileId = $foo; else - $this->notFound(Util::ucFirst(Lang::$game['profile'])); + $this->notFound(Util::ucFirst(Lang::game('profile'))); $this->profile = $_; } else if ($_ || !isset($_GET['new'])) - $this->notFound(Util::ucFirst(Lang::$game['profile'])); + $this->notFound(Util::ucFirst(Lang::game('profile'))); $this->subject = new ProfileList(/*stuff*/); } @@ -77,7 +77,7 @@ class ProfilePage extends GenericPage protected function generateTitle() { - array_unshift($this->title, Util::ucFirst(Lang::$game['profile'])); + array_unshift($this->title, Util::ucFirst(Lang::game('profile'))); } protected function generateTooltip($asError = false) diff --git a/pages/profiler.php b/pages/profiler.php index 4060fc7a..99945501 100644 --- a/pages/profiler.php +++ b/pages/profiler.php @@ -22,7 +22,7 @@ class ProfilerPage extends GenericPage protected function generateTitle() { - array_unshift($this->title, Util::ucFirst(Lang::$main['_cpHead'])); + array_unshift($this->title, Util::ucFirst(Lang::main('_cpHead'))); } } diff --git a/pages/profiles.php b/pages/profiles.php index 822f4b74..01572848 100644 --- a/pages/profiles.php +++ b/pages/profiles.php @@ -46,7 +46,7 @@ class ProfilesPage extends GenericPage protected function generateTitle() { - $this->title[] = Util::ucFirst(Lang::$game['profiles']); + $this->title[] = Util::ucFirst(Lang::game('profiles')); } protected function generatePath() @@ -113,8 +113,8 @@ class ProfilesPage extends GenericPage $this->filter = ['query' => 1]; - asort(Lang::$game['cl']); - asort(Lang::$game['ra']); + asort(Lang::game('cl')); + asort(Lang::game('ra')); } private function getTalentDistribution($tString) diff --git a/pages/quest.php b/pages/quest.php index 6df62375..bad87059 100644 --- a/pages/quest.php +++ b/pages/quest.php @@ -30,7 +30,7 @@ class QuestPage extends GenericPage $this->subject = new QuestList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::$game['quest']); + $this->notFound(Lang::game('quest')); $this->name = $this->subject->getField('name', true); } @@ -45,7 +45,7 @@ class QuestPage extends GenericPage protected function generateTitle() { - array_unshift($this->title, $this->name, Util::ucFirst(Lang::$game['quest'])); + array_unshift($this->title, $this->name, Util::ucFirst(Lang::game('quest'))); } protected function generateContent() @@ -66,12 +66,12 @@ class QuestPage extends GenericPage if ($_ = $this->subject->getField('holidayId')) { $this->extendGlobalIds(TYPE_WORLDEVENT, $_); - $infobox[] = Lang::$game['eventShort'].Lang::$main['colon'].'[event='.$_.']'; + $infobox[] = Lang::game('eventShort').Lang::main('colon').'[event='.$_.']'; } // level if ($_level > 0) - $infobox[] = Lang::$game['level'].Lang::$main['colon'].$_level; + $infobox[] = Lang::game('level').Lang::main('colon').$_level; // reqlevel if ($_minLevel) @@ -80,7 +80,7 @@ class QuestPage extends GenericPage if ($_ = $this->subject->getField('maxLevel')) $lvl .= ' - '.$_; - $infobox[] = sprintf(Lang::$game['reqLevel'], $lvl); + $infobox[] = sprintf(Lang::game('reqLevel'), $lvl); } // loremaster (i dearly hope those flags cover every case...) @@ -99,10 +99,10 @@ class QuestPage extends GenericPage case 0: break; case 1: - $infobox[] = Lang::$quest['loremaster'].Lang::$main['colon'].'[achievement='.$loremaster->id.']'; + $infobox[] = Lang::quest('loremaster').Lang::main('colon').'[achievement='.$loremaster->id.']'; break; default: - $lm = Lang::$quest['loremaster'].Lang::$main['colon'].'[ul]'; + $lm = Lang::quest('loremaster').Lang::main('colon').'[ul]'; foreach ($loremaster->iterate() as $id => $__) $lm .= '[li][achievement='.$id.'][/li]'; @@ -114,41 +114,41 @@ class QuestPage extends GenericPage // type (maybe expand uppon?) $_ = []; if ($_flags & QUEST_FLAG_DAILY) - $_[] = Lang::$quest['daily']; + $_[] = Lang::quest('daily'); else if ($_flags & QUEST_FLAG_WEEKLY) - $_[] = Lang::$quest['weekly']; + $_[] = Lang::quest('weekly'); else if ($_specialFlags & QUEST_FLAG_SPECIAL_MONTHLY) - $_[] = Lang::$quest['monthly']; + $_[] = Lang::quest('monthly'); if ($t = $this->subject->getField('type')) - $_[] = Lang::$quest['questInfo'][$t]; + $_[] = Lang::quest('questInfo', $t); if ($_) - $infobox[] = Lang::$game['type'].Lang::$main['colon'].implode(' ', $_); + $infobox[] = Lang::game('type').Lang::main('colon').implode(' ', $_); // side - $_ = Lang::$main['side'].Lang::$main['colon']; + $_ = Lang::main('side').Lang::main('colon'); switch ($_side) { - case 3: $infobox[] = $_.Lang::$game['si'][3]; break; - case 2: $infobox[] = $_.'[span class=icon-horde]'.Lang::$game['si'][2].'[/span]'; break; - case 1: $infobox[] = $_.'[span class=icon-alliance]'.Lang::$game['si'][1].'[/span]'; break; + case 3: $infobox[] = $_.Lang::game('si', 3); break; + case 2: $infobox[] = $_.'[span class=icon-horde]'.Lang::game('si', 2).'[/span]'; break; + case 1: $infobox[] = $_.'[span class=icon-alliance]'.Lang::game('si', 1).'[/span]'; break; } // races if ($_ = Lang::getRaceString($this->subject->getField('reqRaceMask'), $__, $jsg, $n, false)) { $this->extendGlobalIds(TYPE_RACE, $jsg); - $t = $n == 1 ? Lang::$game['race'] : Lang::$game['races']; - $infobox[] = Util::ucFirst($t).Lang::$main['colon'].$_; + $t = $n == 1 ? Lang::game('race') : Lang::game('races'); + $infobox[] = Util::ucFirst($t).Lang::main('colon').$_; } // classes if ($_ = Lang::getClassString($this->subject->getField('reqClassMask'), $jsg, $n, false)) { $this->extendGlobalIds(TYPE_CLASS, $jsg); - $t = $n == 1 ? Lang::$game['class'] : Lang::$game['classes']; - $infobox[] = Util::ucFirst($t).Lang::$main['colon'].$_; + $t = $n == 1 ? Lang::game('class') : Lang::game('classes'); + $infobox[] = Util::ucFirst($t).Lang::main('colon').$_; } // profession / skill @@ -159,17 +159,17 @@ class QuestPage extends GenericPage if ($_ = $this->subject->getField('reqSkillPoints')) $sk .= ' ('.$_.')'; - $infobox[] = Lang::$quest['profession'].Lang::$main['colon'].$sk; + $infobox[] = Lang::quest('profession').Lang::main('colon').$sk; } // timer if ($_ = $this->subject->getField('timeLimit')) - $infobox[] = Lang::$quest['timer'].Lang::$main['colon'].Util::formatTime($_ * 1000); + $infobox[] = Lang::quest('timer').Lang::main('colon').Util::formatTime($_ * 1000); $startEnd = DB::Aowow()->select('SELECT * FROM ?_quests_startend WHERE questId = ?d', $this->typeId); // start - $start = '[icon name=quest_start'.($this->subject->isDaily() ? '_daily' : '').']'.lang::$event['start'].Lang::$main['colon'].'[/icon]'; + $start = '[icon name=quest_start'.($this->subject->isDaily() ? '_daily' : '').']'.Lang::event('start').Lang::main('colon').'[/icon]'; $s = []; foreach ($startEnd as $se) { @@ -184,7 +184,7 @@ class QuestPage extends GenericPage $infobox[] = implode('[br]', $s); // end - $end = '[icon name=quest_end'.($this->subject->isDaily() ? '_daily' : '').']'.lang::$event['end'].Lang::$main['colon'].'[/icon]'; + $end = '[icon name=quest_end'.($this->subject->isDaily() ? '_daily' : '').']'.Lang::event('end').Lang::main('colon').'[/icon]'; $e = []; foreach ($startEnd as $se) { @@ -200,14 +200,14 @@ class QuestPage extends GenericPage // Repeatable if ($_flags & QUEST_FLAG_REPEATABLE || $_specialFlags & QUEST_FLAG_SPECIAL_REPEATABLE) - $infobox[] = Lang::$quest['repeatable']; + $infobox[] = Lang::quest('repeatable'); // sharable | not sharable - $infobox[] = $_flags & QUEST_FLAG_SHARABLE ? Lang::$quest['sharable'] : Lang::$quest['notSharable']; + $infobox[] = $_flags & QUEST_FLAG_SHARABLE ? Lang::quest('sharable') : Lang::quest('notSharable'); // Keeps you PvP flagged if ($this->subject->isPvPEnabled()) - $infobox[] = Lang::$quest['keepsPvpFlag']; + $infobox[] = Lang::quest('keepsPvpFlag'); // difficulty (todo (low): formula unclear. seems to be [minLevel,] -4, -2, (level), +3, +(9 to 15)) if ($_level > 0) @@ -232,7 +232,7 @@ class QuestPage extends GenericPage $_[] = '[color=r4]'.($_level + 3 + ceil(12 * $_level / MAX_LEVEL)).'[/color]'; if ($_) - $infobox[] = Lang::$game['difficulty'].Lang::$main['colon'].implode('[small]  [/small]', $_); + $infobox[] = Lang::game('difficulty').Lang::main('colon').implode('[small]  [/small]', $_); } $this->infobox = '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]'; @@ -337,7 +337,7 @@ class QuestPage extends GenericPage foreach ($extraLists as $el) if ($_ = $listGen($el[1])) - $this->series[] = [$_, sprintf(Util::$dfnString, Lang::$quest[$el[0].'Desc'], Lang::$quest[$el[0]])]; + $this->series[] = [$_, sprintf(Util::$dfnString, Lang::quest($el[0].'Desc'), Lang::quest($el[0]))]; /*******************/ /* Objectives List */ @@ -380,7 +380,7 @@ class QuestPage extends GenericPage 'name' => $olItemData->json[$pair[0]]['name'], 'qty' => $pair[1] > 1 ? $pair[1] : 0, 'quality' => 7 - $olItemData->json[$pair[0]]['quality'], - 'extraText' => $i ? '' : ' ('.Lang::$quest['provided'].')' + 'extraText' => $i ? '' : ' ('.Lang::quest('provided').')' ); } } @@ -425,7 +425,7 @@ class QuestPage extends GenericPage 'id' => $i, 'name' => $pair[1] ?: Util::localizedString($olNPCData->getEntry($i), 'name'), 'qty' => $pair[0] > 1 ? $pair[0] : 0, - 'extraText' => (($_specialFlags & QUEST_FLAG_SPECIAL_SPELLCAST) || $pair[1]) ? '' : ' '.Lang::$achievement['slain'], + 'extraText' => (($_specialFlags & QUEST_FLAG_SPECIAL_SPELLCAST) || $pair[1]) ? '' : ' '.Lang::achievement('slain'), 'proxy' => $pair[2] ); @@ -481,7 +481,7 @@ class QuestPage extends GenericPage 'typeStr' => Util::$typeStrings[TYPE_FACTION], 'id' => $i, 'name' => Util::localizedString($olFactionsData->getEntry($i), 'name'), - 'qty' => sprintf(Util::$dfnString, $val.' '.Lang::$achievement['points'], Lang::getReputationLevelForPoints($val)), + 'qty' => sprintf(Util::$dfnString, $val.' '.Lang::achievement('points'), Lang::getReputationLevelForPoints($val)), 'extraText' => '' ); } @@ -496,17 +496,17 @@ class QuestPage extends GenericPage 'id' => $_, 'name' => SpellList::getName($_), 'qty' => 0, - 'extraText' => ' ('.Lang::$quest['provided'].')' + 'extraText' => ' ('.Lang::quest('provided').')' ); } // required money if ($this->subject->getField('rewardOrReqMoney') < 0) - $this->objectiveList[] = ['text' => Lang::$quest['reqMoney'].Lang::$main['colon'].Util::formatMoney(abs($this->subject->getField('rewardOrReqMoney')))]; + $this->objectiveList[] = ['text' => Lang::quest('reqMoney').Lang::main('colon').Util::formatMoney(abs($this->subject->getField('rewardOrReqMoney')))]; // required pvp kills if ($_ = $this->subject->getField('reqPlayerKills')) - $this->objectiveList[] = ['text' => Lang::$quest['playerSlain'].' ('.$_.')']; + $this->objectiveList[] = ['text' => Lang::quest('playerSlain').' ('.$_.')']; /**********/ /* Mapper */ @@ -560,7 +560,7 @@ class QuestPage extends GenericPage $altQuest->id, $altQuest->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) ); } } @@ -700,10 +700,10 @@ class QuestPage extends GenericPage { $rewards['money'] = Util::formatMoney($questMoney); if ($comp > 0) - $rewards['money'] .= ' ' . sprintf(Lang::$quest['expConvert'], Util::formatMoney($questMoney + $comp), MAX_LEVEL); + $rewards['money'] .= ' ' . sprintf(Lang::quest('expConvert'), Util::formatMoney($questMoney + $comp), MAX_LEVEL); } else if ($questMoney <= 0 && $questMoney + $comp > 0) - $rewards['money'] = sprintf(Lang::$quest['expConvert2'], Util::formatMoney($questMoney + $comp), MAX_LEVEL); + $rewards['money'] = sprintf(Lang::quest('expConvert2'), Util::formatMoney($questMoney + $comp), MAX_LEVEL); // itemChoices if (!empty($this->subject->choices[$this->typeId][TYPE_ITEM])) @@ -788,7 +788,7 @@ class QuestPage extends GenericPage { $extra = null; if ($_ = $rewSpells->getEntry($displ)) - $extra = sprintf(Lang::$quest['spellDisplayed'], $displ, Util::localizedString($_, 'name')); + $extra = sprintf(Lang::quest('spellDisplayed'), $displ, Util::localizedString($_, 'name')); if ($_ = $rewSpells->getEntry($cast)) { @@ -863,7 +863,7 @@ class QuestPage extends GenericPage $letter = DB::Aowow()->selectRow('SELECT * FROM ?_mailtemplate WHERE id = ?d', $_); $mail = array( - 'delay' => $delay ? sprintf(Lang::$quest['mailIn'], Util::formatTime($delay * 1000)) : null, + 'delay' => $delay ? sprintf(Lang::quest('mailIn'), Util::formatTime($delay * 1000)) : null, 'sender' => null, 'text' => $letter ? Util::parseHtmlText(Util::localizedString($letter, 'text')) : null, 'subject' => Util::parseHtmlText(Util::localizedString($letter, 'subject')) @@ -876,7 +876,7 @@ class QuestPage extends GenericPage if ($_ = CreatureList::getName($se['typeId'])) { - $mail['sender'] = sprintf(Lang::$quest['mailBy'], $se['typeId'], $_); + $mail['sender'] = sprintf(Lang::quest('mailBy'), $se['typeId'], $_); break; } } diff --git a/pages/quests.php b/pages/quests.php index 7b8c8475..19c1dfb4 100644 --- a/pages/quests.php +++ b/pages/quests.php @@ -26,7 +26,7 @@ class QuestsPage extends GenericPage parent::__construct($pageCall, $pageParam); - $this->name = Util::ucFirst(Lang::$game['quests']); + $this->name = Util::ucFirst(Lang::game('quests')); $this->subCat = $pageParam ? '='.$pageParam : ''; } @@ -83,10 +83,10 @@ class QuestsPage extends GenericPage array_unshift($this->title, $this->name); if (isset($this->category[1])) - array_unshift($this->title, Lang::$quest['cat'][$this->category[0]][$this->category[1]]); + array_unshift($this->title, Lang::quest('cat', $this->category[0], $this->category[1])); else if (isset($this->category[0])) { - $c0 = Lang::$quest['cat'][$this->category[0]]; + $c0 = Lang::quest('cat', $this->category[0]); array_unshift($this->title, is_array($c0) ? $c0[0] : $c0); } } diff --git a/pages/race.php b/pages/race.php index 3dbade82..e8913fcf 100644 --- a/pages/race.php +++ b/pages/race.php @@ -26,7 +26,7 @@ class RacePage extends GenericPage $this->subject = new CharRaceList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::$game['race']); + $this->notFound(Lang::game('race')); $this->name = $this->subject->getField('name', true); } @@ -38,7 +38,7 @@ class RacePage extends GenericPage protected function generateTitle() { - array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::$game['class'])); + array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::game('class'))); } protected function generateContent() @@ -59,28 +59,28 @@ class RacePage extends GenericPage // side if ($_ = $this->subject->getField('side')) - $infobox[] = Lang::$main['side'].Lang::$main['colon'].'[span class=icon-'.($_ == 2 ? 'horde' : 'alliance').']'.Lang::$game['si'][$_].'[/span]'; + $infobox[] = Lang::main('side').Lang::main('colon').'[span class=icon-'.($_ == 2 ? 'horde' : 'alliance').']'.Lang::game('si', $_).'[/span]'; // faction if ($_ = $this->subject->getField('factionId')) { $fac = new FactionList(array(['ft.id', $_])); $this->extendGlobalData($fac->getJSGlobals()); - $infobox[] = Util::ucFirst(Lang::$game['faction']).Lang::$main['colon'].'[faction='.$fac->id.']'; + $infobox[] = Util::ucFirst(Lang::game('faction')).Lang::main('colon').'[faction='.$fac->id.']'; } // leader if ($_ = $this->subject->getField('leader')) { $this->extendGlobalIds(TYPE_NPC, $_); - $infobox[] = Lang::$class['racialLeader'].Lang::$main['colon'].'[npc='.$_.']'; + $infobox[] = Lang::class('racialLeader').Lang::main('colon').'[npc='.$_.']'; } // start area if ($_ = $this->subject->getField('startAreaId')) { $this->extendGlobalIds(TYPE_ZONE, $_); - $infobox[] = Lang::$class['startZone'].Lang::$main['colon'].'[zone='.$_.']'; + $infobox[] = Lang::class('startZone').Lang::main('colon').'[zone='.$_.']'; } diff --git a/pages/races.php b/pages/races.php index 33d6edea..922e0d17 100644 --- a/pages/races.php +++ b/pages/races.php @@ -20,7 +20,7 @@ class RacesPage extends GenericPage { parent::__construct($pageCall, $pageParam); - $this->name = Util::ucFirst(Lang::$game['races']); + $this->name = Util::ucFirst(Lang::game('races')); } protected function generateContent() @@ -43,7 +43,7 @@ class RacesPage extends GenericPage protected function generateTitle() { - array_unshift($this->title, Util::ucFirst(Lang::$game['races'])); + array_unshift($this->title, Util::ucFirst(Lang::game('races'))); } protected function generatePath() {} diff --git a/pages/screenshot.php b/pages/screenshot.php index 8aa58465..7016b1c7 100644 --- a/pages/screenshot.php +++ b/pages/screenshot.php @@ -22,7 +22,7 @@ class ScreenshotPage extends GenericPage { parent::__construct($pageCall, $pageParam); - $this->name = Lang::$main['ssEdit']; + $this->name = Lang::main('ssEdit'); // do not htmlEscape caption. It's applied as textnode $this->caption = !empty($_POST['screenshotcaption']) ? $_POST['screenshotcaption'] : ''; @@ -133,13 +133,13 @@ class ScreenshotPage extends GenericPage if (!$this->destType) { - $this->error = Lang::$main['ssErrors']['noDest']; + $this->error = Lang::main('ssErrors', 'noDest'); return; } if (User::$banStatus & ACC_BAN_SCREENSHOT) { - $this->error = Lang::$main['ssErrors']['notAllowed']; + $this->error = Lang::main('ssErrors', 'notAllowed'); return; } @@ -152,7 +152,7 @@ class ScreenshotPage extends GenericPage $im = $isPNG ? $this->loadFromPNG() : $this->loadFromJPG(); if (!$im) { - $this->error = Lang::$main['ssErrors']['load']; + $this->error = Lang::main('ssErrors', 'load'); return; } @@ -191,17 +191,17 @@ class ScreenshotPage extends GenericPage $infobox = []; // target - $infobox[] = sprintf(Lang::$main['displayOn'], Util::ucFirst(Lang::$game[Util::$typeStrings[$this->destType]]), Util::$typeStrings[$this->destType], $this->destTypeId); + $infobox[] = sprintf(Lang::main('displayOn'), Util::ucFirst(Lang::game(Util::$typeStrings[$this->destType])), Util::$typeStrings[$this->destType], $this->destTypeId); $this->extendGlobalIds($this->destType, $this->destTypeId); // dimensions - $infobox[] = Lang::$main['originalSize'].Lang::$main['colon'].$oSize[0].' x '.$oSize[1]; - $infobox[] = Lang::$main['targetSize'].Lang::$main['colon'].'[span id=qf-newSize][/span]'; + $infobox[] = Lang::main('originalSize').Lang::main('colon').$oSize[0].' x '.$oSize[1]; + $infobox[] = Lang::main('targetSize').Lang::main('colon').'[span id=qf-newSize][/span]'; // minimum dimensions if (!User::isInGroup(U_GROUP_STAFF)) { - $infobox[] = Lang::$main['minSize'].Lang::$main['colon'].$minCrop.' x '.$minCrop; + $infobox[] = Lang::main('minSize').Lang::main('colon').$minCrop.' x '.$minCrop; $this->cropper['minCrop'] = $minCrop; } @@ -240,35 +240,35 @@ class ScreenshotPage extends GenericPage { // no upload happened or some error occured if (!$_FILES || empty($_FILES['screenshotfile'])) - return Lang::$main['ssErrors']['noUpload']; + return Lang::main('ssErrors', 'noUpload'); switch ($_FILES['screenshotfile']['error']) { case 1: - return sprintf(Lang::$main['ssErrors']['maxSize'], ini_get('upload_max_filesize'));; + return sprintf(Lang::main('ssErrors', 'maxSize'), ini_get('upload_max_filesize'));; case 3: - return Lang::$main['ssErrors']['interrupted']; + return Lang::main('ssErrors', 'interrupted'); case 4: - return Lang::$main['ssErrors']['noFile']; + return Lang::main('ssErrors', 'noFile'); case 6: Util::addNote(U_GROUP_ADMIN, 'ScreenshotPage::validateScreenshot() - temporary upload directory is not set'); - return Lang::$main['intError']; + return Lang::main('intError'); case 7: Util::addNote(U_GROUP_ADMIN, 'ScreenshotPage::validateScreenshot() - could not write temporary file to disk'); - return Lang::$main['genericError']; + return Lang::main('genericError'); } // points to invalid file (hack attempt) if (!is_uploaded_file($_FILES['screenshotfile']['tmp_name'])) { Util::addNote(U_GROUP_ADMIN, 'ScreenshotPage::validateScreenshot() - uploaded file not in upload directory'); - return Lang::$main['genericError']; + return Lang::main('genericError'); } // invalid file $is = getimagesize($_FILES['screenshotfile']['tmp_name']); if (!$is || empty($is['mime'])) - return Lang::$main['ssErrors']['notImage']; + return Lang::main('ssErrors', 'notImage'); // allow jpeg, png switch ($is['mime']) @@ -279,15 +279,15 @@ class ScreenshotPage extends GenericPage case 'image/jpeg': break; default: - return Lang::$main['ssErrors']['wrongFormat']; + return Lang::main('ssErrors', 'wrongFormat'); } // size-missmatch: 4k UHD upper limit; 150px lower limit if ($is[0] < 150 || $is[1] < 150) - return sprintf(Lang::$main['ssErrors']['tooSmall'], 150, 150); + return sprintf(Lang::main('ssErrors', 'tooSmall'), 150, 150); if ($is[0] > 3840 || $is[1] > 2160) - return sprintf(Lang::$main['ssErrors']['tooLarge'], 150, 150); + return sprintf(Lang::main('ssErrors', 'tooLarge'), 150, 150); return null; } @@ -295,7 +295,7 @@ class ScreenshotPage extends GenericPage protected function generatePath() { } protected function generateTitle() { - array_unshift($this->title, Lang::$main['ssUpload']); + array_unshift($this->title, Lang::main('ssUpload')); } } diff --git a/pages/search.php b/pages/search.php index 30fc04f7..da97fa80 100644 --- a/pages/search.php +++ b/pages/search.php @@ -182,7 +182,7 @@ class SearchPage extends GenericPage protected function generateTitle() { - array_unshift($this->title, $this->search, Lang::$main['search']); + array_unshift($this->title, $this->search, Lang::main('search')); } protected function generatePath() { } diff --git a/pages/skill.php b/pages/skill.php index 9cf71958..2f1d452a 100644 --- a/pages/skill.php +++ b/pages/skill.php @@ -27,7 +27,7 @@ class SkillPage extends GenericPage $this->subject = new SkillList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::$game['skill']); + $this->notFound(Lang::game('skill')); $this->name = $this->subject->getField('name', true); $this->cat = $this->subject->getField('typeCat'); @@ -40,7 +40,7 @@ class SkillPage extends GenericPage protected function generateTitle() { - array_unshift($this->title, $this->name, Util::ucFirst(Lang::$game['skill'])); + array_unshift($this->title, $this->name, Util::ucFirst(Lang::game('skill'))); } protected function generateContent() diff --git a/pages/skills.php b/pages/skills.php index 0f3db606..dbb0c6ac 100644 --- a/pages/skills.php +++ b/pages/skills.php @@ -23,7 +23,7 @@ class SkillsPage extends GenericPage parent::__construct($pageCall, $pageParam); - $this->name = Util::ucFirst(Lang::$game['skills']); + $this->name = Util::ucFirst(Lang::game('skills')); } protected function generateContent() @@ -48,7 +48,7 @@ class SkillsPage extends GenericPage protected function generateTitle() { if ($this->category) - array_unshift($this->title, Lang::$skill['cat'][$this->category[0]]); + array_unshift($this->title, Lang::skill('cat', $this->category[0])); } protected function generatePath() diff --git a/pages/spell.php b/pages/spell.php index b437f19d..8166c929 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -33,7 +33,7 @@ class SpellPage extends GenericPage $this->subject = new SpellList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::$game['spell']); + $this->notFound(Lang::game('spell')); $jsg = $this->subject->getJSGlobals(GLOBALINFO_ANY, $extra); $this->extendGlobalData($jsg, $extra); @@ -112,7 +112,7 @@ class SpellPage extends GenericPage protected function generateTitle() { - array_unshift($this->title, $this->name, Util::ucFirst(Lang::$game['spell'])); + array_unshift($this->title, $this->name, Util::ucFirst(Lang::game('spell'))); } protected function generateContent() @@ -137,19 +137,19 @@ class SpellPage extends GenericPage if (!in_array($_cat, [-5, -6])) // not mount or vanity pet { if ($_ = $this->subject->getField('talentLevel')) - $infobox[] = '[li]'.(in_array($_cat, [-2, 7, -13]) ? sprintf(Lang::$game['reqLevel'], $_) : Lang::$game['level'].Lang::$main['colon'].$_).'[/li]'; + $infobox[] = '[li]'.(in_array($_cat, [-2, 7, -13]) ? sprintf(Lang::game('reqLevel'), $_) : Lang::game('level').Lang::main('colon').$_).'[/li]'; else if ($_ = $this->subject->getField('spellLevel')) - $infobox[] = '[li]'.(in_array($_cat, [-2, 7, -13]) ? sprintf(Lang::$game['reqLevel'], $_) : Lang::$game['level'].Lang::$main['colon'].$_).'[/li]'; + $infobox[] = '[li]'.(in_array($_cat, [-2, 7, -13]) ? sprintf(Lang::game('reqLevel'), $_) : Lang::game('level').Lang::main('colon').$_).'[/li]'; } // races if ($_ = Lang::getRaceString($this->subject->getField('reqRaceMask'), $__, $jsg, $n, false)) { - if ($_ != Lang::$game['ra'][0]) // omit: "both" + if ($_ != Lang::game('ra', 0)) // omit: "both" { $this->extendGlobalIds(TYPE_RACE, $jsg); - $t = $n == 1 ? Lang::$game['race'] : Lang::$game['races']; - $infobox[] = '[li]'.Util::ucFirst($t).Lang::$main['colon'].$_.'[/li]'; + $t = $n == 1 ? Lang::game('race') : Lang::game('races'); + $infobox[] = '[li]'.Util::ucFirst($t).Lang::main('colon').$_.'[/li]'; } } @@ -157,8 +157,8 @@ class SpellPage extends GenericPage if ($_ = Lang::getClassString($this->subject->getField('reqClassMask'), $jsg, $n, false)) { $this->extendGlobalIds(TYPE_CLASS, $jsg); - $t = $n == 1 ? Lang::$game['class'] : Lang::$game['classes']; - $infobox[] = '[li]'.Util::ucFirst($t).Lang::$main['colon'].$_.'[/li]'; + $t = $n == 1 ? Lang::game('class') : Lang::game('classes'); + $infobox[] = '[li]'.Util::ucFirst($t).Lang::main('colon').$_.'[/li]'; } // spell focus @@ -166,7 +166,7 @@ class SpellPage extends GenericPage { $bar = DB::Aowow()->selectRow('SELECT * FROM ?_spellfocusobject WHERE id = ?d', $_); $focus = new GameObjectList(array(['spellFocusId', $_], 1)); - $infobox[] = '[li]'.Lang::$game['requires2'].' '.($focus->error ? Util::localizedString($bar, 'name') : '[url=?object='.$focus->id.']'.Util::localizedString($bar, 'name').'[/url]').'[/li]'; + $infobox[] = '[li]'.Lang::game('requires2').' '.($focus->error ? Util::localizedString($bar, 'name') : '[url=?object='.$focus->id.']'.Util::localizedString($bar, 'name').'[/url]').'[/li]'; } // primary & secondary trades @@ -180,7 +180,7 @@ class SpellPage extends GenericPage { $this->extendGlobalData($rSkill->getJSGlobals()); - $bar = sprintf(Lang::$game['requires'], '[skill='.$rSkill->id.']'); + $bar = sprintf(Lang::game('requires'), '[skill='.$rSkill->id.']'); if ($_ = $this->subject->getField('learnedAt')) $bar .= ' ('.$_.')'; @@ -195,7 +195,7 @@ class SpellPage extends GenericPage if (!$rSpell->error) { $this->extendGlobalData($rSpell->getJSGlobals()); - $infobox[] = '[li]'.Lang::$game['requires2'].' [spell='.$rSpell->id.'][/li]'; + $infobox[] = '[li]'.Lang::game('requires2').' [spell='.$rSpell->id.'][/li]'; } } @@ -207,24 +207,24 @@ class SpellPage extends GenericPage if ($_[$i]) $bar[] = '[color=r'.($i + 1).']'.$_[$i].'[/color]'; - $infobox[] = '[li]'.Lang::$game['difficulty'].Lang::$main['colon'].implode(' ', $bar).'[/li]'; + $infobox[] = '[li]'.Lang::game('difficulty').Lang::main('colon').implode(' ', $bar).'[/li]'; } } // accquisition.. 10: starter spell; 7: discovery if (isset($this->subject->sources[$this->subject->id][10])) - $infobox[] = '[li]'.Lang::$spell['starter'].'[/li]'; + $infobox[] = '[li]'.Lang::spell('starter').'[/li]'; else if (isset($this->subject->sources[$this->subject->id][7])) - $infobox[] = '[li]'.Lang::$spell['discovered'].'[/li]'; + $infobox[] = '[li]'.Lang::spell('discovered').'[/li]'; // training cost if ($cost = DB::World()->selectCell('SELECT spellcost FROM npc_trainer WHERE spell = ?d', $this->subject->id)) - $infobox[] = '[li]'.Lang::$spell['trainingCost'].Lang::$main['colon'].'[money='.$cost.'][/li]'; + $infobox[] = '[li]'.Lang::spell('trainingCost').Lang::main('colon').'[money='.$cost.'][/li]'; // used in mode foreach ($this->difficulties as $n => $id) if ($id == $this->typeId) // "Mode" seems to be multilingual acceptable - $infobox[] = '[li]Mode'.Lang::$main['colon'].Lang::$game['modes'][$n].'[/li]'; + $infobox[] = '[li]Mode'.Lang::main('colon').Lang::game('modes', $n).'[/li]'; $effects = $this->createEffects($infobox, $redButtons); $infobox = $infobox ? '[ul]'.implode('', $infobox).'[/ul]' : ''; @@ -260,8 +260,8 @@ class SpellPage extends GenericPage $this->gcd = Util::formatTime($this->subject->getField('startRecoveryTime')); $this->gcdCat = null; // todo (low): nyi; find out how this works [n/a; normal; ..] $this->school = [Util::asHex($this->subject->getField('schoolMask')), Lang::getMagicSchools($this->subject->getField('schoolMask'))]; - $this->dispel = Lang::$game['dt'][$this->subject->getField('dispelType')]; - $this->mechanic = Lang::$game['me'][$this->subject->getField('mechanic')]; + $this->dispel = Lang::game('dt', $this->subject->getField('dispelType')); + $this->mechanic = Lang::game('me', $this->subject->getField('mechanic')); $this->unavailable = $this->subject->getField('cuFlags') & CUSTOM_UNAVAILABLE; $this->redButtons = $redButtons; @@ -285,13 +285,13 @@ class SpellPage extends GenericPage if (!$altSpell->error) { $this->transfer = sprintf( - Lang::$spell['_transfer'], + Lang::spell('_transfer'), $altSpell->id, 1, // quality $altSpell->getField('iconString'), $altSpell->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) ); } } @@ -1447,13 +1447,13 @@ class SpellPage extends GenericPage } $_ = []; - $strs = Lang::$item['inventoryType']; + $strs = Lang::item('inventoryType'); foreach ($strs as $k => $str) if ($invType & 1 << $k && $str) $_[] = $str; - $title[] = Lang::$item['slot'].Lang::$main['colon'].Util::asHex($invType); - $text .= ' '.Lang::$spell['_inSlot'].Lang::$main['colon'].implode(', ', $_); + $title[] = Lang::item('slot').Lang::main('colon').Util::asHex($invType); + $text .= ' '.Lang::spell('_inSlot').Lang::main('colon').implode(', ', $_); } return [$title, $text]; @@ -1538,7 +1538,7 @@ class SpellPage extends GenericPage $foo['icon'] = array( 'id' => $_, - 'name' => $trig->error ? Util::ucFirst(Lang::$game['spell']).' #'.$_ : $trig->getField('name', true), + 'name' => $trig->error ? Util::ucFirst(Lang::game('spell')).' #'.$_ : $trig->getField('name', true), 'count' => 0 ); @@ -1552,15 +1552,15 @@ class SpellPage extends GenericPage $foo['radius'] = $this->subject->getField('effect'.$i.'RadiusMax'); if (!in_array($i, $itemIdx) && !in_array($i, $spellIdx) && !in_array($effAura, [225, 227])) - $foo['value'] = ($effDS && $effDS != 1 ? ($effBP + 1).Lang::$game['valueDelim'] : null).($effBP + $effDS); + $foo['value'] = ($effDS && $effDS != 1 ? ($effBP + 1).Lang::game('valueDelim') : null).($effBP + $effDS); if ($effRPPL != 0) - $foo['value'] = (isset($foo['value']) ? $foo['value'] : '0').sprintf(Lang::$spell['costPerLevel'], $effRPPL); + $foo['value'] = (isset($foo['value']) ? $foo['value'] : '0').sprintf(Lang::spell('costPerLevel'), $effRPPL); if ($this->subject->getField('effect'.$i.'Periode') > 0) $foo['interval'] = Util::formatTime($this->subject->getField('effect'.$i.'Periode')); if ($_ = $this->subject->getField('effect'.$i.'Mechanic')) - $foo['mechanic'] = Lang::$game['me'][$_]; + $foo['mechanic'] = Lang::game('me', $_); if (!empty($procData['chance'])) $foo['procData'] = array( @@ -1581,37 +1581,37 @@ class SpellPage extends GenericPage case 137: // Energize Pct $_ = Lang::spell('powerTypes', $effMV); if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_); + $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); else if (!$_) $_ = $effMV; if ($effMV == POWER_RAGE || $effMV == POWER_RUNIC_POWER) - $foo['value'] = ($effDS && $effDS != 1 ? (($effBP + 1) / 10).Lang::$game['valueDelim'] : null).(($effBP + $effDS) / 10); + $foo['value'] = ($effDS && $effDS != 1 ? (($effBP + 1) / 10).Lang::game('valueDelim') : null).(($effBP + $effDS) / 10); $foo['name'] .= ' ('.$_.')'; break; case 16: // QuestComplete if ($_ = QuestList::getName($effMV)) - $foo['name'] .= Lang::$main['colon'].'('.$_.')'; + $foo['name'] .= Lang::main('colon').'('.$_.')'; else - $foo['name'] .= Lang::$main['colon'].Util::ucFirst(Lang::$game['quest']).' #'.$effMV;; + $foo['name'] .= Lang::main('colon').Util::ucFirst(Lang::game('quest')).' #'.$effMV;; break; case 28: // Summon case 90: // Kill Credit case 134: // Kill Credit2 - $_ = Lang::$game['npc'].' #'.$effMV; + $_ = Lang::game('npc').' #'.$effMV; if ($summon = $this->subject->getModelInfo($this->typeId)) { $_ = '('.$summon['displayName'].')'; $redButtons[BUTTON_VIEW3D] = ['type' => TYPE_NPC, 'displayId' => $summon['displayId']]; } - $foo['name'] .= Lang::$main['colon'].$_; + $foo['name'] .= Lang::main('colon').$_; break; case 33: // Open Lock $_ = Lang::spell('lockType', $effMV); if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_); + $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); else if (!$_) $_ = $effMV; @@ -1629,7 +1629,7 @@ class SpellPage extends GenericPage case 126: // Steal Aura $_ = Lang::game('dt', $effMV); if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_); + $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); else if (!$_) $_ = $effMV; @@ -1638,7 +1638,7 @@ class SpellPage extends GenericPage case 39: // Learn Language $_ = Lang::game('languages', $effMV); if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_); + $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); else if (!$_) $_ = $effMV; @@ -1651,22 +1651,22 @@ class SpellPage extends GenericPage case 105: // Summon Object (slot 2) case 106: // Summon Object (slot 3) case 107: // Summon Object (slot 4) - $_ = Util::ucFirst(Lang::$game['gameObject']).' #'.$effMV; + $_ = Util::ucFirst(Lang::game('gameObject')).' #'.$effMV; if ($summon = $this->subject->getModelInfo($this->typeId)) { $_ = '('.$summon['displayName'].')'; $redButtons[BUTTON_VIEW3D] = ['type' => TYPE_OBJECT, 'displayId' => $summon['displayId']]; } - $foo['name'] .= Lang::$main['colon'].$_; + $foo['name'] .= Lang::main('colon').$_; break; case 74: // Apply Glyph if ($_ = DB::Aowow()->selectCell('SELECT spellId FROM ?_glyphproperties WHERE id = ?d', $effMV)) { if ($n = SpellList::getName($_)) - $foo['name'] .= Lang::$main['colon'].'('.$n.')'; + $foo['name'] .= Lang::main('colon').'('.$n.')'; else - $foo['name'] .= Lang::$main['colon'].Util::ucFirst(Lang::$game['spell']).' #'.$effMV; + $foo['name'] .= Lang::main('colon').Util::ucFirst(Lang::game('spell')).' #'.$effMV; } else $foo['name'] .= ' #'.$effMV;; @@ -1674,14 +1674,14 @@ class SpellPage extends GenericPage case 95: // Skinning switch ($effMV) { - case 0: $_ = Lang::$game['ct'][1].', '.Lang::$game['ct'][2]; break; // Beast, Dragonkin + case 0: $_ = Lang::game('ct', 1).', '.Lang::game('ct', 2); break; // Beast, Dragonkin case 1: - case 2: $_ = Lang::$game['ct'][4]; break; // Elemental (nature based, earth based) - case 3: $_ = Lang::$game['ct'][9]; break; // Mechanic + case 2: $_ = Lang::game('ct', 4); break; // Elemental (nature based, earth based) + case 3: $_ = Lang::game('ct', 9); break; // Mechanic default; $_ = ''; } if (User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_); + $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); else $_ = $effMV; @@ -1690,7 +1690,7 @@ class SpellPage extends GenericPage case 108: // Dispel Mechanic $_ = Lang::game('me', $effMV); if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_); + $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); else if (!$_) $_ = $effMV; @@ -1698,14 +1698,14 @@ class SpellPage extends GenericPage break; case 118: // Require Skill if ($_ = SkillList::getName($effMV)) - $foo['name'] .= Lang::$main['colon'].'('.$_.')'; + $foo['name'] .= Lang::main('colon').'('.$_.')'; else - $foo['name'] .= Lang::$main['colon'].Util::ucFirst(Lang::$game['skill']).' #'.$effMV;; + $foo['name'] .= Lang::main('colon').Util::ucFirst(Lang::game('skill')).' #'.$effMV;; break; case 146: // Activate Rune $_ = Lang::spell('powerRunes', $effMV); if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_); + $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); else if (!$_) $_ = $effMV; @@ -1729,19 +1729,19 @@ class SpellPage extends GenericPage { if ($effAura > 0 && isset(Util::$spellAuraStrings[$effAura])) { - $foo['name'] .= User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'AuraId: '.$effAura, Lang::$main['colon'].Util::$spellAuraStrings[$effAura]) : Lang::$main['colon'].Util::$spellAuraStrings[$effAura]; + $foo['name'] .= User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'AuraId: '.$effAura, Lang::main('colon').Util::$spellAuraStrings[$effAura]) : Lang::main('colon').Util::$spellAuraStrings[$effAura]; $bar = $effMV; switch ($effAura) { case 17: // Mod Stealth Detection if ($_ = Lang::spell('stealthType', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; break; case 19: // Mod Invisibility Detection if ($_ = Lang::spell('invisibilityType', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; break; case 24: // Periodic Energize @@ -1750,7 +1750,7 @@ class SpellPage extends GenericPage case 85: // Mod Power Regeneration case 110: // Mod Power Regeneration Pct if ($_ = Lang::spell('powerTypes', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; break; case 29: // Mod Stat @@ -1764,10 +1764,10 @@ class SpellPage extends GenericPage $_ = []; for ($j = 0; $j < 5; $j++) if ($mask & (1 << $j)) - $_[] = Lang::$game['stats'][$j]; + $_[] = Lang::game('stats', $j); if ($_ = implode(', ', $_)); - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; break; case 36: // Shapeshift @@ -1779,17 +1779,17 @@ class SpellPage extends GenericPage ); if ($st['creatureType'] > 0) - $infobox[] = '[li]'.Lang::$game['type'].Lang::$main['colon'].Lang::$game['ct'][$st['creatureType']].'[/li]'; + $infobox[] = '[li]'.Lang::game('type').Lang::main('colon').Lang::game('ct', $st['creatureType']).'[/li]'; if ($_ = $st['displayName']) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; } break; case 37: // Effect immunity if (isset(Util::$spellEffectStrings[$effMV])) { $_ = Util::$spellEffectStrings[$effMV]; - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; } break; @@ -1797,7 +1797,7 @@ class SpellPage extends GenericPage if (isset(Util::$spellAuraStrings[$effMV])) { $_ = Util::$spellAuraStrings[$effMV]; - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; } break; @@ -1805,22 +1805,22 @@ class SpellPage extends GenericPage case 178: // Mod Debuff Resistance case 245: // Mod Aura Duration By Dispel if ($_ = Lang::game('dt', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; break; case 44: // Track Creature if ($_ = Lang::game('ct', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; break; case 45: // Track Resource if ($_ = Lang::spell('lockType', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; break; case 75: // Language if ($_ = Lang::game('languages', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; break; case 77: // Mechanic Immunity @@ -1830,17 +1830,17 @@ class SpellPage extends GenericPage case 255: // Mod Mechanic Damage Taken Pct case 276: // Mod Mechanic Damage Done Percent if ($_ = Lang::game('me', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].Util::asHex($effMV), $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').Util::asHex($effMV), $_) : $_; break; case 147: // Mechanic Immunity Mask $_ = []; - foreach (Lang::$game['me'] as $k => $str) + foreach (Lang::game('me') as $k => $str) if ($effMV & (1 << $k - 1)) $_[] = $str; if ($_ = implode(', ', $_)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].Util::asHex($effMV), $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').Util::asHex($effMV), $_) : $_; break; case 10: // Mod Threat @@ -1880,7 +1880,7 @@ class SpellPage extends GenericPage case 271: // Mod Damage Percent Taken Form Caster case 310: // Mod Creature AoE Damage Avoidance if ($_ = Lang::getMagicSchools($effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].Util::asHex($effMV), $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').Util::asHex($effMV), $_) : $_; break; case 30: // Mod Skill @@ -1888,41 +1888,41 @@ class SpellPage extends GenericPage if ($_ = SkillList::getName($effMV)) $bar = ' ('.SkillList::getName($effMV).')'; else - $bar = Lang::$main['colon'].Util::ucFirst(Lang::$game['skill']).' #'.$effMV;; + $bar = Lang::main('colon').Util::ucFirst(Lang::game('skill')).' #'.$effMV;; break; case 107: // Flat Modifier case 108: // Pct Modifier if ($_ = Lang::spell('spellModOp', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; break; case 189: // Mod Rating case 220: // Combat Rating From Stat $_ = []; - foreach (Lang::$spell['combatRating'] as $k => $str) + foreach (Lang::spell('combatRating') as $k => $str) if ((1 << $k) & $effMV) $_[] = $str; if ($_ = implode(', ', $_)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].Util::asHex($effMV), $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').Util::asHex($effMV), $_) : $_; break; case 168: // Mod Damage Done Versus case 59: // Mod Damage Done Versus Creature $_ = []; - foreach (Lang::$game['ct'] as $k => $str) + foreach (Lang::game('ct') as $k => $str) if ($effMV & (1 << $k - 1)) $_[] = $str; if ($_ = implode(', ', $_)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].Util::asHex($effMV), $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').Util::asHex($effMV), $_) : $_; break; case 249: // Convert Rune $x = $this->subject->getField('effect'.$i.'MiscValueB'); if ($_ = Lang::spell('powerRunes', $x)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$main['colon'].$x, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$x, $_) : $_; break; case 78: // Mounted @@ -1933,11 +1933,11 @@ class SpellPage extends GenericPage $bar = ' ('.$transform['displayName'].')'; } else - $bar = Lang::$main['colon'].Lang::$game['npc'].' #'.$effMV;; + $bar = Lang::main('colon').Lang::game('npc').' #'.$effMV;; break; case 139: // Force Reaction - $foo['value'] = sprintf(Util::$dfnString, $foo['value'], Lang::$game['rep'][$foo['value']]); + $foo['value'] = sprintf(Util::$dfnString, $foo['value'], Lang::game('rep', $foo['value'])); // DO NOT BREAK case 190: // Mod Faction Reputation Gain $bar = ' ('.FactionList::getName($effMV).')'; @@ -1946,13 +1946,13 @@ class SpellPage extends GenericPage $foo['name'] .= strstr($bar, 'href') || strstr($bar, '#') ? $bar : ($bar ? ' ('.$bar.')' : null); if (in_array($effAura, [174, 220, 182])) - $foo['name'] .= ' ['.sprintf(Util::$dfnString, Lang::$game['stats'][$this->subject->getField('effect'.$i.'MiscValueB')], $this->subject->getField('effect'.$i.'MiscValueB')).']'; + $foo['name'] .= ' ['.sprintf(Util::$dfnString, Lang::game('stats', $this->subject->getField('effect'.$i.'MiscValueB')), $this->subject->getField('effect'.$i.'MiscValueB')).']'; else if ($this->subject->getField('effect'.$i.'MiscValueB') > 0) $foo['name'] .= ' ['.$this->subject->getField('effect'.$i.'MiscValueB').']'; } else if ($effAura > 0) - $foo['name'] .= Lang::$main['colon'].'Unknown Aura ('.$effAura.')'; + $foo['name'] .= Lang::main('colon').'Unknown Aura ('.$effAura.')'; break; } diff --git a/pages/spells.php b/pages/spells.php index 8796e168..84df1d76 100644 --- a/pages/spells.php +++ b/pages/spells.php @@ -90,7 +90,7 @@ class SpellsPage extends GenericPage parent::__construct($pageCall, $pageParam); - $this->name = Util::ucFirst(Lang::$game['spells']); + $this->name = Util::ucFirst(Lang::game('spells')); $this->subCat = $pageParam !== null ? '='.$pageParam : ''; $this->filter = ['classPanel' => false, 'glyphPanel' => false]; } @@ -289,17 +289,17 @@ class SpellsPage extends GenericPage $sf = $this->shortFilter[$this->category[1]]; $txt = ''; if ($sf[0] && $sf[1]) - $txt = sprintf(Lang::$spell['relItems']['crafted'], $sf[0]) . Lang::$spell['relItems']['link'] . sprintf(Lang::$spell['relItems']['recipes'], $sf[1]); + $txt = sprintf(Lang::spell('relItems', 'crafted'), $sf[0]) . Lang::spell('relItems', 'link') . sprintf(Lang::spell('relItems', 'recipes'), $sf[1]); else if ($sf[0]) - $txt = sprintf(Lang::$spell['relItems']['crafted'], $sf[0]); + $txt = sprintf(Lang::spell('relItems', 'crafted'), $sf[0]); else if ($sf[1]) - $txt = sprintf(Lang::$spell['relItems']['recipes'], $sf[1]); + $txt = sprintf(Lang::spell('relItems', 'recipes'), $sf[1]); - $note = Lang::$spell['cat'][$this->category[0]][$this->category[1]]; + $note = Lang::spell('cat', $this->category[0], $this->category[1]); if (is_array($note)) $note = $note[0]; - $tab['params']['note'] = sprintf(Lang::$spell['relItems']['base'], $txt, $note); + $tab['params']['note'] = sprintf(Lang::spell('relItems', 'base'), $txt, $note); $tab['params']['sort'] = "$['skill', 'name']"; } } @@ -329,17 +329,17 @@ class SpellsPage extends GenericPage $sf = $this->shortFilter[$this->category[1]]; $txt = ''; if ($sf[0] && $sf[1]) - $txt = sprintf(Lang::$spell['relItems']['crafted'], $sf[0]) . Lang::$spell['relItems']['link'] . sprintf(Lang::$spell['relItems']['recipes'], $sf[1]); + $txt = sprintf(Lang::spell('relItems', 'crafted'), $sf[0]) . Lang::spell('relItems', 'link') . sprintf(Lang::spell('relItems', 'recipes'), $sf[1]); else if ($sf[0]) - $txt = sprintf(Lang::$spell['relItems']['crafted'], $sf[0]); + $txt = sprintf(Lang::spell('relItems', 'crafted'), $sf[0]); else if ($sf[1]) - $txt = sprintf(Lang::$spell['relItems']['recipes'], $sf[1]); + $txt = sprintf(Lang::spell('relItems', 'recipes'), $sf[1]); - $note = Lang::$spell['cat'][$this->category[0]][$this->category[1]]; + $note = Lang::spell('cat', $this->category[0], $this->category[1]); if (is_array($note)) $note = $note[0]; - $tab['params']['note'] = sprintf(Lang::$spell['relItems']['base'], $txt, $note); + $tab['params']['note'] = sprintf(Lang::spell('relItems', 'base'), $txt, $note); $tab['params']['sort'] = "$['skill', 'name']"; } } @@ -404,10 +404,10 @@ class SpellsPage extends GenericPage $this->lvTabs[] = $tab; // sort for dropdown-menus - asort(Lang::$game['ra']); - asort(Lang::$game['cl']); - asort(Lang::$game['sc']); - asort(Lang::$game['me']); + asort(Lang::game('ra')); + asort(Lang::game('cl')); + asort(Lang::game('sc')); + asort(Lang::game('me')); } protected function generateTitle() @@ -415,16 +415,16 @@ class SpellsPage extends GenericPage $foo = []; $c = $this->category; // shothand if (isset($c[2]) && $c[0] == 11) - array_unshift($foo, Lang::$spell['cat'][$c[0]][$c[1]][$c[2]]); + array_unshift($foo, Lang::spell('cat', $c[0], $c[1], $c[2])); else if (isset($c[1])) { - $_ = in_array($c[0], [-2, -13, 7]) ? Lang::$game['cl'] : Lang::$spell['cat'][$c[0]]; + $_ = in_array($c[0], [-2, -13, 7]) ? Lang::game('cl') : Lang::spell('cat', $c[0])]; array_unshift($foo, is_array($_[$c[1]]) ? $_[$c[1]][0] : $_[$c[1]]); } if (isset($c[0]) && count($foo) < 2) { - $_ = Lang::$spell['cat'][$c[0]]; + $_ = Lang::spell('cat', $c[0]); array_unshift($foo, is_array($_) ? $_[0] : $_); } diff --git a/pages/talent.php b/pages/talent.php index 0c695532..4db7a2b7 100644 --- a/pages/talent.php +++ b/pages/talent.php @@ -25,7 +25,7 @@ class TalentPage extends GenericPage parent::__construct($pageCall, $__); $this->isPetCalc = $pageCall == 'petcalc'; - $this->name = $this->isPetCalc ? Lang::$main['petCalc'] : Lang::$main['talentCalc']; + $this->name = $this->isPetCalc ? Lang::main('petCalc') : Lang::main('talentCalc'); } protected function generateContent() diff --git a/pages/title.php b/pages/title.php index 997b74a4..ae280a1c 100644 --- a/pages/title.php +++ b/pages/title.php @@ -32,7 +32,7 @@ class TitlePage extends GenericPage $this->subject = new TitleList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::$game['title']); + $this->notFound(Lang::game('title')); $this->name = $this->subject->getHtmlizedName(); $this->nameFixed = Util::ucFirst(trim(strtr($this->subject->getField('male', true), ['%s' => '', ',' => '']))); @@ -45,7 +45,7 @@ class TitlePage extends GenericPage protected function generateTitle() { - array_unshift($this->title, $this->nameFixed, Util::ucFirst(Lang::$game['title'])); + array_unshift($this->title, $this->nameFixed, Util::ucFirst(Lang::game('title'))); } protected function generateContent() @@ -57,17 +57,17 @@ class TitlePage extends GenericPage $infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags')); if ($this->subject->getField('side') == SIDE_ALLIANCE) - $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]'; else if ($this->subject->getField('side') == SIDE_HORDE) - $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]'; else - $infobox[] = Lang::$main['side'].Lang::$main['colon'].Lang::$game['si'][SIDE_BOTH]; + $infobox[] = Lang::main('side').Lang::main('colon').Lang::game('si', SIDE_BOTH); if ($g = $this->subject->getField('gender')) - $infobox[] = Lang::$main['gender'].Lang::$main['colon'].'[span class=icon-'.($g == 2 ? 'female' : 'male').']'.Lang::$main['sex'][$g].'[/span]'; + $infobox[] = Lang::main('gender').Lang::main('colon').'[span class=icon-'.($g == 2 ? 'female' : 'male').']'.Lang::main('sex', $g).'[/span]'; if ($e = $this->subject->getField('eventId')) - $infobox[] = Lang::$game['eventShort'].Lang::$main['colon'].'[url=?event='.$e.']'.WorldEventList::getName($e).'[/url]'; + $infobox[] = Lang::game('eventShort').Lang::main('colon').'[url=?event='.$e.']'.WorldEventList::getName($e).'[/url]'; /****************/ /* Main Content */ @@ -91,7 +91,7 @@ class TitlePage extends GenericPage $altTitle->id, $altTitle->getHtmlizedName(), $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/titles.php b/pages/titles.php index 37402ee0..64c2abb3 100644 --- a/pages/titles.php +++ b/pages/titles.php @@ -23,7 +23,7 @@ class TitlesPage extends GenericPage parent::__construct($pageCall, $pageParam); - $this->name = Util::ucFirst(Lang::$game['titles']); + $this->name = Util::ucFirst(Lang::game('titles')); } protected function generateContent() @@ -56,9 +56,9 @@ class TitlesPage extends GenericPage protected function generateTitle() { - array_unshift($this->title, Util::ucFirst(Lang::$game['titles'])); + array_unshift($this->title, Util::ucFirst(Lang::game('titles'))); if ($this->category) - array_unshift($this->title, Lang::$title['cat'][$this->category[0]]); + array_unshift($this->title, Lang::title('cat', $this->category[0])); } protected function generatePath() diff --git a/pages/utility.php b/pages/utility.php index ea18981c..e4310a3c 100644 --- a/pages/utility.php +++ b/pages/utility.php @@ -27,14 +27,14 @@ class UtilityPage extends GenericPage $this->page = $pageCall; $this->rss = isset($_GET['rss']); - $this->name = Lang::$main['utilities'][array_search($pageCall, $this->validPages)]; + $this->name = Lang::main('utilities', array_search($pageCall, $this->validPages)); if ($this->page == 'most-comments') { if ($this->category && in_array($this->category[0], [7, 30])) - $this->name .= Lang::$main['colon'] . sprintf(Lang::$main['mostComments'][1], $this->category[0]); + $this->name .= Lang::main('colon') . sprintf(Lang::main('mostComments', 1), $this->category[0]); else - $this->name .= Lang::$main['colon'] . Lang::$main['mostComments'][0]; + $this->name .= Lang::main('colon') . Lang::main('mostComments', 0); } } @@ -56,7 +56,7 @@ class UtilityPage extends GenericPage /****************/ if (in_array(array_search($this->page, $this->validPages), [0, 1, 2, 3, 11, 12])) - $this->h1Links = ''.Lang::$main['subscribe'].''; + $this->h1Links = ''.Lang::main('subscribe').''; switch ($this->page) { @@ -154,7 +154,7 @@ class UtilityPage extends GenericPage $xml .= "\n". "<![CDATA[".htmlentities($row['subject'])."]]>\n". "".HOST_URL.'?go-to-comment&id='.$row['id']."\n". - "\n". // todo (low): preview should be html-formated + "\n". // todo (low): preview should be html-formated "".date(DATE_RSS, time() - $row['elapsed'])."\n". "".HOST_URL.'?go-to-comment&id='.$row['id']."\n". "\n". @@ -171,12 +171,12 @@ class UtilityPage extends GenericPage if ($this->page == 'most-comments') { if ($this->category && in_array($this->category[0], [7, 30])) - array_unshift($this->title, sprintf(Lang::$main['mostComments'][1], $this->category[0])); + array_unshift($this->title, sprintf(Lang::main('mostComments', 1), $this->category[0])); else - array_unshift($this->title, Lang::$main['mostComments'][0]); + array_unshift($this->title, Lang::main('mostComments', 0)); } - array_unshift($this->title, Lang::$main['utilities'][array_search($this->page, $this->validPages)]); + array_unshift($this->title, Lang::main('utilities', array_search($this->page, $this->validPages))); } protected function generatePath() diff --git a/pages/zone.php b/pages/zone.php index 3cf659b5..84ecd1c1 100644 --- a/pages/zone.php +++ b/pages/zone.php @@ -24,7 +24,7 @@ class ZonePage extends GenericPage $this->subject = new ZoneList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::$game['zone']); + $this->notFound(Lang::game('zone')); $this->name = $this->subject->getField('name', true); } @@ -41,7 +41,7 @@ class ZonePage extends GenericPage // City if ($this->subject->getField('flags') & 0x200000 && !$this->subject->getField('parentArea')) - $infobox[] = Lang::$zone['city']; + $infobox[] = Lang::zone('city'); // Level if ($_ = $this->subject->getField('levelMin')) @@ -49,7 +49,7 @@ class ZonePage extends GenericPage if ($_ < $this->subject->getField('levelMax')) $_ .= ' - '.$this->subject->getField('levelMax'); - $infobox[] = Lang::$game['level'].Lang::$main['colon'].$_; + $infobox[] = Lang::game('level').Lang::main('colon').$_; } // required Level @@ -65,18 +65,18 @@ class ZonePage extends GenericPage else if ($_ == 4) $__ = '[span class=icon-ffa]%s[/span]'; - $infobox[] = Lang::$zone['territory'].Lang::$main['colon'].sprintf($__, lang::$zone['territories'][$_]); + $infobox[] = Lang::zone('territory').Lang::main('colon').sprintf($__, Lang::zone('territories', $_)); // Instance Type - $infobox[] = Lang::$zone['instanceType'].Lang::$main['colon'].'[span class=icon-instance'.$this->subject->getField('type').']'.Lang::$zone['instanceTypes'][$this->subject->getField('type')].'[/span]'; + $infobox[] = Lang::zone('instanceType').Lang::main('colon').'[span class=icon-instance'.$this->subject->getField('type').']'.Lang::zone('instanceTypes', $this->subject->getField('type')).'[/span]'; // Heroic mode if ($_ = $this->subject->getField('levelHeroic')) - $infobox[] = '[icon preset=heroic]'.sprintf(Lang::$zone['hcAvailable'], $_).'[/icon]'; + $infobox[] = '[icon preset=heroic]'.sprintf(Lang::zone('hcAvailable'), $_).'[/icon]'; // number of players if ($_ = $this->subject->getField('maxPlayer')) - $infobox[] = Lang::$zone['numPlayers'].Lang::$main['colon'].($_ == -2 ? '10/25' : $_); + $infobox[] = Lang::zone('numPlayers').Lang::main('colon').($_ == -2 ? '10/25' : $_); // attunement // [li]Attunement: [quest=24712][/li] @@ -462,7 +462,7 @@ class ZonePage extends GenericPage protected function generateTitle() { - array_unshift($this->title, $this->name, Util::ucFirst(Lang::$game['zone'])); + array_unshift($this->title, $this->name, Util::ucFirst(Lang::game('zone'))); } } diff --git a/pages/zones.php b/pages/zones.php index f274def8..5ffc31e7 100644 --- a/pages/zones.php +++ b/pages/zones.php @@ -24,7 +24,7 @@ class ZonesPage extends GenericPage parent::__construct($pageCall, $pageParam); - $this->name = Util::ucFirst(Lang::$game['zones']); + $this->name = Util::ucFirst(Lang::game('zones')); } protected function generateContent() @@ -167,9 +167,9 @@ class ZonesPage extends GenericPage if ($this->category) { if (isset($this->category[1])) - array_unshift($this->title, Lang::$game['expansions'][$this->category[1]]); + array_unshift($this->title, Lang::game('expansions', $this->category[1])); - array_unshift($this->title, Lang::$zone['cat'][$this->category[0]]); + array_unshift($this->title, Lang::zone('cat', $this->category[0])); } } diff --git a/template/bricks/book.tpl.php b/template/bricks/book.tpl.php index aea68c21..c93e9db6 100644 --- a/template/bricks/book.tpl.php +++ b/template/bricks/book.tpl.php @@ -2,7 +2,7 @@ if (!empty($this->pageText)): ?>
-

+

diff --git a/template/bricks/headerMenu.tpl.php b/template/bricks/headerMenu.tpl.php index 56030352..f96143b9 100644 --- a/template/bricks/headerMenu.tpl.php +++ b/template/bricks/headerMenu.tpl.php @@ -2,8 +2,8 @@ if (User::$id): echo ''.User::$displayName.''; else: - echo ''.Lang::$main['signIn'].''; + echo ''.Lang::main('signIn').''; endif; ?> -| -| +| +| diff --git a/template/bricks/infobox.tpl.php b/template/bricks/infobox.tpl.php index e4ff0f5c..807c7b86 100644 --- a/template/bricks/infobox.tpl.php +++ b/template/bricks/infobox.tpl.php @@ -2,7 +2,7 @@ infobox)): ?> - +
@@ -15,7 +15,7 @@ endif; if (!empty($this->contributions)): ?> - +
@@ -34,12 +34,12 @@ endif; if (!empty($this->type) && !empty($this->typeId)): ?> - +
community['vi'])): ?> - +
mail): - echo '

'.sprintf(Lang::$quest['mailDelivery'], $m['sender'], $m['delay'])."

\n"; + echo '

'.sprintf(Lang::quest('mailDelivery'), $m['sender'], $m['delay'])."

\n"; if ($m['subject']): echo '
'.$m['subject']."
\n"; diff --git a/template/bricks/mapper.tpl.php b/template/bricks/mapper.tpl.php index b54cdfa4..dccc5c6f 100644 --- a/template/bricks/mapper.tpl.php +++ b/template/bricks/mapper.tpl.php @@ -1,15 +1,15 @@ map) && empty($this->map)): - echo Lang::$zone['noMap']; + echo Lang::zone('noMap'); elseif (!empty($this->map['data'])): if ($this->type != TYPE_ZONE): - echo '
'.($this->type == TYPE_OBJECT ? Lang::$gameObject['foundIn'] : Lang::$npc['foundIn']).' '; + echo '
'.($this->type == TYPE_OBJECT ? Lang::gameObject('foundIn') : Lang::npc('foundIn')).' '; $n = count($this->map['mapperData']); $i = 0; foreach ($this->map['mapperData'] as $areaId => $areaData): if ($n > 1 && $i++ > 0): - echo $i < $n ? ', ' : Lang::$main['and']; + echo $i < $n ? ', ' : Lang::main('and'); endif; echo ''.$this->map['extra'][$areaId].' ('.reset($areaData)['count'].')'; diff --git a/template/bricks/reagentList.tpl.php b/template/bricks/reagentList.tpl.php index fc0ef46e..641376de 100644 --- a/template/bricks/reagentList.tpl.php +++ b/template/bricks/reagentList.tpl.php @@ -1,4 +1,4 @@ -

+

- - + + redButtons[BUTTON_LINKS])): if ($b = $this->redButtons[BUTTON_LINKS]): echo 'name)."', type: ".$this->type.', typeId: '.$this->typeId.' });">'.Lang::$main['links'].''.Lang::$main['links'].''; + "linkName: '".Util::jsEscape(isset($b['name']) ? $b['name'] : $this->name)."', type: ".$this->type.', typeId: '.$this->typeId.' });">'.Lang::main('links').''.Lang::main('links').''; else: - echo ''.Lang::$main['links'].''.Lang::$main['links'].''; + echo ''.Lang::main('links').''.Lang::main('links').''; endif; endif; @@ -28,46 +28,46 @@ if (isset($this->redButtons[BUTTON_VIEW3D])): foreach ($b as $k => $v) $data[] = $k.': '.json_encode($v, JSON_NUMERIC_CHECK); - echo ''.Lang::$main['view3D'].''.Lang::$main['view3D'].''; + echo ''.Lang::main('view3D').''.Lang::main('view3D').''; } else: - echo ''.Lang::$main['view3D'].''.Lang::$main['view3D'].''; + echo ''.Lang::main('view3D').''.Lang::main('view3D').''; endif; endif; // item comparison tool if (isset($this->redButtons[BUTTON_COMPARE])): if ($b = $this->redButtons[BUTTON_COMPARE]): - echo ''.Lang::$main['compare'].''.Lang::$main['compare'].''; + echo ''.Lang::main('compare').''.Lang::main('compare').''; else: - echo ''.Lang::$main['compare'].''.Lang::$main['compare'].''; + echo ''.Lang::main('compare').''.Lang::main('compare').''; endif; endif; // item upgrade search if (isset($this->redButtons[BUTTON_UPGRADE])): if ($b = $this->redButtons[BUTTON_UPGRADE]): - echo ''.Lang::$main['findUpgrades'].''.Lang::$main['findUpgrades'].''; + echo ''.Lang::main('findUpgrades').''.Lang::main('findUpgrades').''; else: - echo ''.Lang::$main['findUpgrades'].''.Lang::$main['findUpgrades'].''; + echo ''.Lang::main('findUpgrades').''.Lang::main('findUpgrades').''; endif; endif; // goto: talent calculator if (isset($this->redButtons[BUTTON_TALENT])): if ($b = $this->redButtons[BUTTON_TALENT]): - echo ''.($b['pet'] ? Lang::$main['petCalc'] : Lang::$main['talentCalc']).''.($b['pet'] ? Lang::$main['petCalc'] : Lang::$main['talentCalc']).''; + echo ''.($b['pet'] ? Lang::main('petCalc') : Lang::main('talentCalc')).''.($b['pet'] ? Lang::main('petCalc') : Lang::main('talentCalc')).''; else: - echo '{if $b.pet}'.Lang::$main['petCalc'].'else:'.Lang::$main['talentCalc'].'endif;{if $b.pet}'.Lang::$main['petCalc'].'else:'.Lang::$main['talentCalc'].'endif;'; + echo '{if $b.pet}'.Lang::main('petCalc').'else:'.Lang::main('talentCalc').'endif;{if $b.pet}'.Lang::main('petCalc').'else:'.Lang::main('talentCalc').'endif;'; endif; endif; // goto: (sub-)forum if (isset($this->redButtons[BUTTON_FORUM])): if ($b = $this->redButtons[BUTTON_FORUM]): - echo ''.Lang::$main['forum'].''.Lang::$main['forum'].''; + echo ''.Lang::main('forum').''.Lang::main('forum').''; else: - echo ''.Lang::$main['forum'].''.Lang::$main['forum'].''; + echo ''.Lang::main('forum').''.Lang::main('forum').''; endif; endif; diff --git a/template/bricks/rewards.tpl.php b/template/bricks/rewards.tpl.php index 642490f5..230c5949 100644 --- a/template/bricks/rewards.tpl.php +++ b/template/bricks/rewards.tpl.php @@ -4,7 +4,7 @@ if (!isset($offset)) // in case we have m $offset = 0; if ($rewTitle): - echo $rewTitle.Lang::$main['colon'].(isset($extra) ? $extra : null); + echo $rewTitle.Lang::main('colon').(isset($extra) ? $extra : null); endif; if ($rewards): diff --git a/template/bricks/series.tpl.php b/template/bricks/series.tpl.php index 4a7c077f..2f04a9b3 100644 --- a/template/bricks/series.tpl.php +++ b/template/bricks/series.tpl.php @@ -1,4 +1,4 @@ - +
diff --git a/template/bricks/tooltip.tpl.php b/template/bricks/tooltip.tpl.php index 64d6f9f3..a58fe520 100644 --- a/template/bricks/tooltip.tpl.php +++ b/template/bricks/tooltip.tpl.php @@ -9,7 +9,7 @@ $hasBuff = !empty($this->jsGlobals[6][2][$this->typeId]['buff']); // not set wit if ($hasBuff): ?> -

+

$WH.ge('h1-icon-generic').appendChild(Icon.createUser(, 1, null, , false, Icon.getPrivilegeBorder())); -

+

banned): ?>
-

+

    -
  • '.Lang::$account['bannedBy'].''.Lang::$main['colon'].''.$b['by'][1].''; ?>
  • -
  • '.Lang::$account['ends'].''.Lang::$main['colon'].($b['end'] ? date(Lang::$main['dateFmtLong'], $b['end']) : Lang::$account['permanent']); ?>
  • -
  • '.Lang::$account['reason'].''.Lang::$main['colon'].''.($b['reason'] ?: Lang::$account['noReason']).''; ?>
  • +
  • '.Lang::account('bannedBy').''.Lang::main('colon').''.$b['by'][1].''; ?>
  • +
  • '.Lang::account('ends').''.Lang::main('colon').($b['end'] ? date(Lang::main('dateFmtLong'), $b['end']) : Lang::account('permanent')); ?>
  • +
  • '.Lang::account('reason').''.Lang::main('colon').''.($b['reason'] ?: Lang::account('noReason')).''; ?>
banned): else: // profile editing -echo ' '.Lang::$account['editAccount']."\n"; +echo ' '.Lang::account('editAccount')."\n"; ?>
    diff --git a/template/pages/acc-recover.tpl.php b/template/pages/acc-recover.tpl.php index fd6242ad..3a26c370 100644 --- a/template/pages/acc-recover.tpl.php +++ b/template/pages/acc-recover.tpl.php @@ -67,20 +67,20 @@
- + - + - + - +
@@ -117,10 +117,10 @@
error; ?>
- +
- +
diff --git a/template/pages/acc-signIn.tpl.php b/template/pages/acc-signIn.tpl.php index 4ad74630..5228695d 100644 --- a/template/pages/acc-signIn.tpl.php +++ b/template/pages/acc-signIn.tpl.php @@ -32,37 +32,37 @@
-

+

error; ?>
- + - +
- +
- +

-
|
+
|
'.Lang::$account['accCreate']."
\n"; + echo '
'.Lang::account('accCreate')."
\n"; endif; ?> diff --git a/template/pages/acc-signUp.tpl.php b/template/pages/acc-signUp.tpl.php index 867bf04f..b029652a 100644 --- a/template/pages/acc-signUp.tpl.php +++ b/template/pages/acc-signUp.tpl.php @@ -87,27 +87,27 @@ - + - + - + - +
- +
- +
diff --git a/template/pages/achievement.tpl.php b/template/pages/achievement.tpl.php index 981aed31..6c037e67 100644 --- a/template/pages/achievement.tpl.php +++ b/template/pages/achievement.tpl.php @@ -23,7 +23,7 @@ $this->brick('redButtons'); description; - echo '

'.Lang::$achievement['criteria'].($this->criteria['reqQty'] ? ' – '.Lang::$achievement['reqNumCrt'].' '.$this->criteria['reqQty'].' '.Lang::$achievement['outOf'].' '.count($this->criteria['data']).'' : null)."

\n"; + echo '

'.Lang::achievement('criteria').($this->criteria['reqQty'] ? ' – '.Lang::achievement('reqNumCrt').' '.$this->criteria['reqQty'].' '.Lang::achievement('outOf').' '.count($this->criteria['data']).'' : null)."

\n"; ?> @@ -52,7 +52,7 @@ foreach ($this->criteria['data'] as $i => $cr): endif; if (User::isInGroup(U_GROUP_STAFF)): - echo ' ['.$cr['id'].']'; + echo ' ['.$cr['id'].']'; endif; echo ''; @@ -79,12 +79,12 @@ endforeach; rewards): if (!empty($r['item'])): - echo '

'.Lang::$main['rewards']."

\n"; + echo '

'.Lang::main('rewards')."

\n"; $this->brick('rewards', ['rewards' => $r['item'], 'rewTitle' => null]); endif; if (!empty($r['title'])): - echo '

'.Lang::$main['gains']."

\n
    "; + echo '

    '.Lang::main('gains')."

    \n
      "; foreach ($r['title'] as $i): echo '
    • '.$i."
    • \n"; endforeach; @@ -92,7 +92,7 @@ if ($r = $this->rewards): endif; if (empty($r['title']) && empty($r['item']) && $r['text']): - echo '

      '.Lang::$main['rewards']."

      \n" . + echo '

      '.Lang::main('rewards')."

      \n" . '
      • '.$r['text']."
      \n"; endif; endif; @@ -105,7 +105,7 @@ endif; ?> -

      +

brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f
- + - +
- +
 />   />
  - +
        /> - />
-
+
-
- /> /> +
+ /> />
- - + +
diff --git a/template/pages/admin/screenshots.tpl.php b/template/pages/admin/screenshots.tpl.php index 64125a93..4455016b 100644 --- a/template/pages/admin/screenshots.tpl.php +++ b/template/pages/admin/screenshots.tpl.php @@ -24,8 +24,8 @@ $this->brick('pageTemplate'); $str): +foreach (Lang::item('quality') as $k => $str): echo ' \n"; endforeach; ?> @@ -32,8 +32,8 @@ endforeach; if (!empty($f['slot'])): ?>
-
- +
+
- +  /> - +  /> - /> - +
        /> - />
- +   $str): +foreach (Lang::game('cl') as $k => $str): if ($str): echo ' \n"; endif; @@ -105,55 +105,55 @@ endforeach;
-
+
-
- />/> +
+ />/>
-

+

$str): +echo Lang::main('groupBy').Lang::main('colon')."\n"; +foreach (Lang::main('gb') as $k => $str): if ($k): echo ' \n"; else: @@ -166,8 +166,8 @@ endforeach;
- - + +
/> diff --git a/template/pages/itemset.tpl.php b/template/pages/itemset.tpl.php index 8dab5951..7ed3cc64 100644 --- a/template/pages/itemset.tpl.php +++ b/template/pages/itemset.tpl.php @@ -54,28 +54,28 @@ endforeach; if ($this->unavailable): ?>
- + -

bonusExt; ?>

+

bonusExt; ?>

- +
    spells as $i => $s): - echo '
  • '.$s['bonus'].' '.Lang::$itemset['_pieces'].Lang::$main['colon'].''.$s['desc']."
  • \n"; + echo '
  • '.$s['bonus'].' '.Lang::itemset('_pieces').Lang::main('colon').''.$s['desc']."
  • \n"; endforeach; ?>
-

+

-

+

brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f
-
- +
+
$str): +foreach (Lang::itemset('types') as $i => $str): if ($str): echo ' \n"; endif; @@ -45,23 +45,23 @@ endforeach; - + - + - +
 />
 /> - /> - +
        /> - />
  - +
        
-
+
-
- /> /> +
+ /> />
- - + +
diff --git a/template/pages/maps.tpl.php b/template/pages/maps.tpl.php index 8773c6bb..875f6148 100644 --- a/template/pages/maps.tpl.php +++ b/template/pages/maps.tpl.php @@ -15,33 +15,33 @@
@@ -49,8 +49,8 @@
- - + +
diff --git a/template/pages/npc.tpl.php b/template/pages/npc.tpl.php index 44ab106a..b78b4936 100644 --- a/template/pages/npc.tpl.php +++ b/template/pages/npc.tpl.php @@ -21,12 +21,12 @@ $this->brick('article'); if ($this->accessory): - echo '
'.Lang::$npc['accessoryFor'].' '; + echo '
'.Lang::npc('accessoryFor').' '; $n = count($this->accessory); foreach ($this->accessory as $i => $ac): if ($n > 1 && $i > 0): - echo ($i == $n - 1) ? Lang::$main['and'] : ', '; + echo ($i == $n - 1) ? Lang::main('and') : ', '; endif; echo ''.$ac[1].''; endforeach; @@ -35,19 +35,19 @@ if ($this->accessory): endif; if (is_array($this->position)): - echo '
'.Lang::$npc['difficultyPH'].' '.$this->position[1].".
\n"; + echo '
'.Lang::npc('difficultyPH').' '.$this->position[1].".
\n"; ?>
map)): $this->brick('mapper'); else: - echo ' '.Lang::$npc['unkPosition']."\n"; + echo ' '.Lang::npc('unkPosition')."\n"; endif; if ($this->quotes[0]): ?> -

quotes[1]; ?>)

+

quotes[1]; ?>)

'; + echo '
  • '.$itr['qty'].' '.Lang::npc('repWith') . + ' '.$itr['name'].''.($itr['cap'] && $itr['qty'] > 0 ? ' ('.sprintf(Lang::npc('stopsAt'), $itr['cap']).')' : null).'
  • '; endforeach; echo ''; @@ -103,7 +103,7 @@ if ($this->reputation): endforeach; endif; ?> -

    +

    brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f
    -
    - +
    +
    $str): +foreach (Lang::game('fa') as $i => $str): if ($str): echo ' \n"; endif; @@ -46,20 +46,20 @@ endforeach; - + - +
    - +
     />   />
     /> - /> - +
            
    -
    +
    -
    - /> /> +
    + /> />
    - - + +
    diff --git a/template/pages/object.tpl.php b/template/pages/object.tpl.php index 39eef620..35f59818 100644 --- a/template/pages/object.tpl.php +++ b/template/pages/object.tpl.php @@ -23,13 +23,13 @@ $this->brick('article'); if (!empty($this->map)): $this->brick('mapper'); else: - echo Lang::$gameObject['unkPosition']; + echo Lang::gameObject('unkPosition'); endif; $this->brick('book'); ?> -

    +

    brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f
    - +
     />
     />
    -
    +
    -
    - /> /> +
    + /> />
    - - + +
    diff --git a/template/pages/profiler.tpl.php b/template/pages/profiler.tpl.php index 21f716fa..6f3b8800 100644 --- a/template/pages/profiler.tpl.php +++ b/template/pages/profiler.tpl.php @@ -11,41 +11,41 @@ ?>
    -

    +

    -

    +

    -

    +

    -

    +

    -

    +

    -

    +

    - - + +
    -

    +