/** * Build the killlists that are needed for the options selected. */ function killList() { global $smarty; if (isset($this->viewList[$this->view])) { return call_user_func_array($this->viewList[$this->view], array(&$this)); } $scl_id = (int) edkURI::getArg('scl_id'); switch ($this->view) { case "kills": $list = new KillList(); $list->setOrdered(true); $list->addInvolvedPilot($this->pilot); if ($scl_id) { $list->addVictimShipClass($scl_id); } $list->setPageSplit(config::get('killcount')); $pagesplitter = new PageSplitter($list->getCount(), config::get('killcount')); $table = new KillListTable($list); $smarty->assign('splitter', $pagesplitter->generate()); $smarty->assign('kills', $table->generate()); return $smarty->fetch(get_tpl('detail_kl_kills')); break; case "losses": $list = new KillList(); $list->setOrdered(true); $list->addVictimPilot($this->pilot); if ($scl_id) { $list->addVictimShipClass($scl_id); } else { $list->setPodsNoobships(config::get('podnoobs')); } $list->setPageSplit(config::get('killcount')); $pagesplitter = new PageSplitter($list->getCount(), config::get('killcount')); $table = new KillListTable($list); $smarty->assign('splitter', $pagesplitter->generate()); $smarty->assign('losses', $table->generate()); return $smarty->fetch(get_tpl('detail_kl_losses')); break; case "ships_weapons": $shiplist = new TopList_Ship(); $shiplist->addInvolvedPilot($this->pilot); $shiplisttable = new TopTable_Ship($shiplist); $smarty->assign('ships', $shiplisttable->generate()); $weaponlist = new TopList_Weapon(); $weaponlist->addInvolvedPilot($this->pilot); $weaponlisttable = new TopTable_Weapon($weaponlist); $smarty->assign('weapons', $weaponlisttable->generate()); return $smarty->fetch(get_tpl('detail_kl_ships_weapons')); break; case 'history': $pltsum = new pilotSummary($this->plt_id); $smarty->assign('title', Language::get('history')); $smarty->assign('summary', $pltsum->getMonthlySummary()); return $smarty->fetch(get_tpl('detail_history')); break; default: $list = new KillList(); $list->setOrdered(true); if (config::get('comments_count')) { $list->setCountComments(true); } if (config::get('killlist_involved')) { $list->setCountInvolved(true); } $list->setLimit(10); $list->addInvolvedPilot($this->pilot); if ($scl_id) { $list->addVictimShipClass($scl_id); } else { $list->setPodsNoobships(config::get('podnoobs')); } $table = new KillListTable($list); $smarty->assign('kills', $table->generate()); $list = new KillList(); $list->setOrdered(true); if (config::get('comments_count')) { $list->setCountComments(true); } if (config::get('killlist_involved')) { $list->setCountInvolved(true); } $list->setLimit(10); $list->addVictimPilot($this->pilot); if ($scl_id) { $list->addVictimShipClass($scl_id); } else { $list->setPodsNoobships(config::get('podnoobs')); } $table = new KillListTable($list); $smarty->assign('losses', $table->generate()); return $smarty->fetch(get_tpl('detail_kl_default')); break; } return $html; }