removing smarty - part IX

- readded search
- moved custom displayers (tooltip, xml) to subclasses
- added more info to footer
This commit is contained in:
Sarjuuk
2014-06-29 16:32:23 +02:00
parent f6b68a4092
commit 663597a7a0
16 changed files with 1009 additions and 638 deletions

View File

@@ -407,6 +407,31 @@ class AchievementPage extends GenericPage
return $x;
}
public function display($override = '')
{
if ($this->mode != CACHETYPE_TOOLTIP)
return parent::display($override);
if (!$this->loadCache($tt))
{
$tt = $this->generateTooltip();
$this->saveCache($tt);
}
header('Content-type: application/x-javascript; charset=utf-8');
die($tt);
}
public function notFound($typeStr)
{
if ($this->mode != CACHETYPE_TOOLTIP)
return parent::notFound($typeStr);
header('Content-type: application/x-javascript; charset=utf-8');
echo $this->generateTooltip(true);
exit();
}
}
?>

View File

@@ -1064,6 +1064,52 @@ class ItemPage extends genericPage
return $root->asXML();
}
public function display($override = '')
{
if ($this->mode == CACHETYPE_TOOLTIP)
{
if (!$this->loadCache($tt))
{
$tt = $this->generateTooltip();
$this->saveCache($tt);
}
header('Content-type: application/x-javascript; charset=utf-8');
die($tt);
}
else if ($this->mode == CACHETYPE_XML)
{
if (!$this->loadCache($xml))
{
$xml = $this->generateXML();
$this->saveCache($xml);
}
header('Content-type: text/xml; charset=utf-8');
die($xml);
}
else
return parent::display($override);
}
public function notFound($typeStr)
{
if ($this->mode == CACHETYPE_TOOLTIP)
{
header('Content-type: application/x-javascript; charset=utf-8');
echo $this->generateTooltip(true);
exit();
}
else if ($this->mode == CACHETYPE_XML)
{
header('Content-type: text/xml; charset=utf-8');
echo $this->generateXML(true);
exit();
}
else
return parent::notFound($typeStr);
}
}
?>

View File

@@ -94,6 +94,8 @@ class ItemsPage extends GenericPage
$this->addJS('?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
$this->hasGroupedTabs = false;
$conditions = [];
/*******************/
/* evaluate filter */
/*******************/
@@ -415,6 +417,9 @@ class ItemsPage extends GenericPage
{
array_unshift($this->title, $this->name);
if (!$this->category)
return;
if (isset($this->category[2]))
$tPart = Lang::$item['cat'][$this->category[0]][1][$this->category[1]][1][$this->category[2]];
else if (isset($this->category[1]))

View File

@@ -491,6 +491,31 @@ class ObjectPage extends GenericPage
return $x;
}
public function display($override = '')
{
if ($this->mode != CACHETYPE_TOOLTIP)
return parent::display($override);
if (!$this->loadCache($tt))
{
$tt = $this->generateTooltip();
$this->saveCache($tt);
}
header('Content-type: application/x-javascript; charset=utf-8');
die($tt);
}
public function notFound($typeStr)
{
if ($this->mode != CACHETYPE_TOOLTIP)
return parent::notFound($typeStr);
header('Content-type: application/x-javascript; charset=utf-8');
echo $this->generateTooltip(true);
exit();
}
}
?>

View File

@@ -51,12 +51,11 @@ class RacePage extends GenericPage
[7952, 33554], null, [16264, 33557], [17584, 33657]
);
/***********/
/* Infobox */
/***********/
$infobox = []; // unfortunately, all of this is custom data :/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// side
if ($_ = $this->subject->getField('side'))

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,11 @@ if (!defined('AOWOW_REVISION'))
die('illegal access');
/*
icons: data/interface/calendar/calendar_[a-z]start.blp
*/
// menuId 10: Title g_initPath()
// tabId 0: Database g_initHeader()
class TitlePage extends GenericPage