aowow/pages/title.php
Sarjuuk 23e831be25 - removed fixed fields in lv-bricks; title sources and achievement rewards thus are working again
- moved search to /pages
- moved g_dataKey to header.tpl and apply it on nessecary pages (restores TalentCalc)
- Events: fixed relTabs with arbitrary data, when holidayId was 0
- CharClass: get heroClass-status through flags; dropped related DB-field
- Achievements: fixed some criteria not being displayed in tooltips
- Community: applied long forgotten changes to tplVars and use of uppercase ids
- Titles:
 * exclude unused titles from listview
 * restored 'links'-button on detail-page
- Quests:
 * added 'slain' fro proxy-npcs
 * use more wflags (&1 needs more research)
- Factions:
 * fixed order of categories
 * fixed params to QuestList for relTabs
- Profiler:
 * enabled 'profiles that have this char as source' in Profiler
 * removed the exampelChar from project
 * further documented more expected variables; includes/excludes-handling still not entirely clear
 * created datasets for reference data (create with ?build=profiler)
- Localzation:
 * localized profiler for loc3
 * corrected some single words
 * localized custom reward rate - table in factions
- AjaxHandler:
 * new handler for ajax-requests *duh*
 * dropped data.php (index.php now calls to AjaxHandler for these cases)
- moved reading of static files to own function Util::loadStaticFile()
2014-04-13 23:39:34 +02:00

126 lines
4.5 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
require 'includes/community.class.php';
$_id = intVal($pageParam);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_TITLE, $_id, -1, User::$localeId]);
if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
$title = new TitleList(array(['id', $_id]));
if ($title->error)
$smarty->notFound(Lang::$game['title'], $_id);
/***********/
/* Infobox */
/***********/
$infobox = [];
if ($title->getField('side') == SIDE_ALLIANCE)
$infobox[] = Lang::$main['side'].Lang::$colon.'[span class=icon-alliance]'.Lang::$game['si'][SIDE_ALLIANCE].'[/span]';
else if ($title->getField('side') == SIDE_HORDE)
$infobox[] = Lang::$main['side'].Lang::$colon.'[span class=icon-horde]'.Lang::$game['si'][SIDE_HORDE].'[/span]';
else
$infobox[] = Lang::$main['side'].Lang::$colon.Lang::$game['si'][SIDE_BOTH];
if ($g = $title->getField('gender'))
$infobox[] = Lang::$main['gender'].Lang::$colon.'[span class=icon-'.($g == 2 ? 'female' : 'male').']'.Lang::$main['sex'][$g].'[/span]';
if ($e = $title->getField('eventId'))
$infobox[] = Lang::$game['eventShort'].Lang::$colon.'[url=?event='.$e.']'.WorldEventList::getName($e).'[/url]';
/****************/
/* Main Content */
/****************/
$fixedTitle = Util::ucFirst(trim(strtr($title->getField('male', true), ['%s' => '', ',' => ''])));
// menuId 10: Title g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array(
'page' => array(
'title' => $fixedTitle." - ".Util::ucfirst(Lang::$game['title']),
'path' => '[0, 10, '.$title->getField('category').']',
'tab' => 0,
'type' => TYPE_TITLE,
'typeId' => $_id,
'name' => $title->getHtmlizedName(),
'infobox' => $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null,
'expansion' => Util::$expansionString[$title->getField('expansion')],
'redButtons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => ['name' => $fixedTitle]
),
),
'relTabs' => []
);
/**************/
/* Extra Tabs */
/**************/
// tab: sources
if (!empty($title->sources[$_id]))
{
foreach ($title->sources[$_id] as $type => $entries)
{
switch ($type)
{
case 4:
$quests = new QuestList(array(['id', $entries]));
$quests->addGlobalsToJScript(GLOBALINFO_REWARDS);
$pageData['relTabs'][] = array(
'file' => 'quest',
'data' => $quests->getListviewData(),
'params' => array(
'id' => 'reward-from-quest',
'name' => '$LANG.tab_rewardfrom',
'hiddenCols' => "$['experience', 'money']",
'visibleCols' => "$['category']",
'tabs' => '$tabsRelated'
)
);
break;
case 12:
$acvs = new AchievementList(array(['id', $entries]));
$acvs->addGlobalsToJscript();
$pageData['relTabs'][] = array(
'file' => 'achievement',
'data' => $acvs->getListviewData(),
'params' => array(
'id' => 'reward-from-achievement',
'name' => '$LANG.tab_rewardfrom',
'visibleCols' => "$['category']",
'sort' => "$['reqlevel', 'name']",
'tabs' => '$tabsRelated'
)
);
break;
// case 13:
// not displayed
}
}
}
// tab: criteria of (to be added by TC)
$smarty->saveCache($cacheKeyPage, $pageData);
}
$smarty->updatePageVars($pageData['page']);
$smarty->assign('community', CommunityContent::getAll(TYPE_TITLE, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main));
$smarty->assign('lvData', $pageData['relTabs']);
// load the page
$smarty->display('detail-page-generic.tpl');
?>