Files
aowow/pages/itemsets.php
Sarjuuk e0f4e9403a removing smarty - part XI
- readded npc/npcs, itemset/itemsets, skill/skills
- reduced size of conditions-column
2014-07-03 21:20:46 +02:00

87 lines
2.5 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
// menuId 2: Itemset g_initPath()
// tabId 0: Database g_initHeader()
class ItemsetsPage extends GenericPage
{
use ListPage;
protected $type = TYPE_ITEMSET;
protected $tpl = 'itemsets';
protected $path = [0, 2];
protected $tabId = 0;
protected $mode = CACHETYPE_PAGE;
protected $js = ['filters.js'];
public function __construct($pageCall, $pageParam)
{
$this->getCategoryFromUrl($pageParam);;
parent::__construct();
$this->name = Util::ucFirst(Lang::$game['itemsets']);
}
protected function generateContent()
{
$itemsetFilter = new ItemsetListFilter();
$itemsets = new ItemsetList($itemsetFilter->getConditions());
$this->extendGlobalData($itemsets->getJSGlobals());
// recreate form selection
$this->filter = array_merge($itemsetFilter->getForm('form'), $this->filter);
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
$this->filter['fi'] = $itemsetFilter->getForm();
$this->addJS('?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
$lv = array(
'file' => 'itemset',
'data' => $itemsets->getListviewData(), // listview content
'params' => []
);
if (!empty($this->filter['fi']['extraCols']))
$lv['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
// create note if search limit was exceeded
if ($itemsets->getMatches() > CFG_SQL_LIMIT_DEFAULT)
{
$lv['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), CFG_SQL_LIMIT_DEFAULT);
$lv['params']['_truncated'] = 1;
}
if ($itemsetFilter->error)
$lv['params']['_errors'] = '$1';
$this->lvData = $lv;
// sort for dropdown-menus
asort(Lang::$itemset['notes'], SORT_NATURAL);
asort(Lang::$game['cl']);
}
protected function generateTitle()
{
array_unshift($this->title, $this->name);
$form = (new ItemsetListFilter())->getForm('form');
if (isset($form['cl']))
array_unshift($this->title, Lang::$game['cl'][$form['cl']]);
}
protected function generatePath()
{
$form = (new ItemsetListFilter())->getForm('form');
if (isset($form['cl']))
$this->path[] = $form['cl'];
}
}
?>