Files
aowow/pages/titles.php
Sarjuuk 58316679bf ordered bricks somewhat
simple listview-pages now use one shared template (instead of having the same file multiple times)

some bug fixing here and there
 - achievement: faction is no longer out of range (need to reparse the faction :/)
 - item: quality is prepended to the name again and wont be left out in case of heirlooms (is 0)
 - general: forgot to change some error()-calls in index
 - and some more wich i forgot..
2013-03-23 13:40:15 +01:00

56 lines
1.5 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
$cat = Util::extractURLParams($pageParam)[0];
$path = [0, 10];
$validCats = [0, 1, 2, 3, 4, 5, 6];
$title = [ucFirst(Lang::$game['titles'])];
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_TITLE, -1, isset($cat) ? $cat : -1, User::$localeId]);
if (!in_array($cat, $validCats))
$smarty->error();
$path[] = $cat; // should be only one parameter anyway
if (isset($cat))
array_unshift($title, Lang::$title['cat'][$cat]);
if (!$smarty->loadCache($cacheKey, $pageData))
{
$titles = new TitleList(isset($cat) ? array(['category', (int)$cat]) : []);
$pageData = array(
'file' => 'title',
'data' => $titles->getListviewData(),
'params' => array(
'tabs' => false
)
);
if ($titles->hasDiffCategories())
$pageData['params']['visibleCols'] = "$['category']";
if (!$titles->hasAnySource())
$pageData['params']['hiddenCols'] = "$['source']";
$smarty->saveCache($cacheKey, $pageData);
}
$page = array(
'tab' => 0, // for g_initHeader($tab)
'title' => implode(" - ", $title),
'path' => "[".implode(", ", $path)."]"
);
$smarty->updatePageVars($page);
$smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData);
$smarty->assign('mysql', DB::Aowow()->getStatistics());
$smarty->display('generic-no-filter.tpl');
?>