Files
aowow/pages/titles.php
Sarjuuk b6c0fa1b89 * improved conditions for BaseType to accept conditions in addition to explicit field names
this allows for better flag matching i.e. [(flags & 0x4) = 0]
  furthermore it is now possible to group conditions to a subset with a different link

* hasDiffCategories() -> hasDiffFields(array $fields)
  now returns a bitmask of the array keys what field does diff
2013-04-20 15:33:05 +02: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->hasDiffFields(['category']))
$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');
?>