aowow/pages/itemsets.php
Sarjuuk 732226b44a BaseType:
- dropped property "names" and changed getField to return localized Fields if specified. Dropped stupid getNameFieldName() in the process as it was now obsolete.
 - made property "matches" private. Access through getMatches() that will execute the query _only_ when needed (which is basically always anyway (so much for optimization))

SpellList: parsing
 - ""fixed"" behavior of the amount-switch $l when used on russian text. It has 3 options instead of 2, no idea what the last one is for though
 - fixed extra leading whitespace occuring when parsing formulas

Lang:
 - removed offset from getMagicShools(), apparently it is unneeded :o

Util:
 - changed the output of formatTime() in the long version to be more correct in layout
 - initialized values in parseTime() to prevent empty strings returned by formatTime()
 - added asBin() and asHex() - helper to improve display of bitmasks (Spells are coming!)
 - update Spell-Effects/Auras and added misc strings to display different MiscValue-content

Filter:
 - removed escapes from $_POST-handler. If the input is erronous it should be corrected/ignored/noted by the $_GET-handler

Smarty:
 - added optinal parameter to saveCache(), loadCache() to better handle filter variables

Search:
 - changed $maxResults to 10 for OpenSearches in an effort to lower execution time and appied limits to all queries
 - changed result calculation for OpenSearch. It should now stick to it's limit of 10 results for the list
 - simplified WorldEvent search

global.js:
 - backported function to parse title-tag of dfn-elements into mouseover-tooltips
 - shortened document.getElementByTagName(x) calls to gE(document, x)
2013-04-26 17:02:35 +02:00

68 lines
2.2 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
require 'includes/class.filter.php';
$filter = [];
$path = [0, 2];
$filterHash = !empty($_GET['filter']) ? sha1(serialize($_GET['filter'])) : -1;
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_ITEMSET, -1, $filterHash, User::$localeId]);
if (!$smarty->loadCache($cacheKey, $pageData))
{
$itemsets = new ItemsetList([], true); // class selection is via filter, nothing applies here
$itemsets->addGlobalsToJscript($pageData);
// recreate form selection
$filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
$filter['setCr'] = $itemsets->filterGetSetCriteria();
$filter = array_merge($itemsets->filterGetForm(), $filter);
if (isset($filter['cl']))
$path[] = $filter['cl'];
// listview content
$pageData['data'] = $itemsets->getListviewData();
$pageData['params'] = ['tabs' => false];
// create note if search limit was exceeded
if ($itemsets->getMatches() > $AoWoWconf['sqlLimit'])
{
$pageData['params']['note'] = '$'.sprintf(Util::$filterResultString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), $AoWoWconf['sqlLimit']);
$pageData['params']['_truncated'] = 1;
}
if ($itemsets->filterGetError())
$pageData['params']['_errors'] = '$1';
$smarty->saveCache($cacheKey, $pageData);
}
$page = array(
'tab' => 0, // for g_initHeader($tab)
'subCat' => $pageParam ? '='.$pageParam : '',
'title' => ucFirst(Lang::$game['itemsets']),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'reqJS' => array(
array('path' => 'template/js/filters.js', 'conditional' => false),
array('path' => '?data=weight-presets', 'conditional' => false),
)
);
// sort for dropdown-menus
asort(Lang::$itemset['notes'], SORT_NATURAL);
asort(Lang::$game['cl']);
$smarty->updatePageVars($page);
$smarty->assign('filter', $filter);
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$itemset, Lang::$item));
$smarty->assign('mysql', DB::Aowow()->getStatistics());
$smarty->assign('lvData', $pageData);
$smarty->display('itemsets.tpl');
?>