Files
aowow/includes/class.faction.php
Sarjuuk 49800da2c8 Moved most code related to jsGlobals to template. (Except for Globals, that belong to the object already created, it makes zero sense to look them up again from the template.)
I'm not overly happy with passing the templateObject to each typeObject, but it works .. for now.
Effectively this should reduce db-lookups as each type should be looked up only twice at max (once for relevant data on the page and maybe again to get related jsGlobals for the template)
also removed BaseType::addRewardsToJscript() get it with BaseType::addGlobalsToJscript() and the appropriate addMask

* added ListviewHelper::getSetFields() wich is more appropriate in some cases (like reagents for spells should be shown even if they are all the same)
* load bricks as needed, removed the if-blocks (maybe add the filename to every TypeClass..?)
2013-07-11 21:47:00 +02:00

46 lines
902 B
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
class FactionList extends BaseType
{
public static $type = TYPE_FACTION;
public static function getName($id)
{
$n = DB::Aowow()->SelectRow('
SELECT
name_loc0,
name_loc2,
name_loc3,
name_loc6,
name_loc8
FROM
?_factions
WHERE
factionID = ?d',
$id
);
return Util::localizedString($n, 'name');
}
public function reactsAgainst($faction)
{
// see factionTemplate
/*
1: friendly
0: neutral
-1: hostile
*/
}
public function getListviewData() { }
public function addGlobalsToJScript(&$template, $addMask = 0) { }
public function renderTooltip() { }
}
?>