Files
aowow/pages/pets.php
Sarjuuk 70f703b4b2 Cache:
- implemented Memcached (untested though (tough luck trying to get it to run using win))
 - added config value to select caching method (default: filecache; setting debug to 1 will still disable caching)
 - implemented url-param 'refresh' to clear cache for this page
2014-09-11 00:06:08 +02:00

67 lines
1.7 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
// menuId 8: Pets g_initPath()
// tabid 0: Database g_initHeader()
class PetsPage extends GenericPage
{
use ListPage;
protected $type = TYPE_PET;
protected $tpl = 'list-page-generic';
protected $path = [0, 8];
protected $tabId = 0;
protected $mode = CACHE_TYPE_PAGE;
protected $validCats = [1, 2, 3];
public function __construct($pageCall, $pageParam)
{
$this->getCategoryFromUrl($pageParam);;
parent::__construct($pageCall, $pageParam);
$this->name = Util::ucFirst(Lang::$game['pets']);
}
protected function generateContent()
{
$conditions = [];
if ($this->category)
$conditions[] = ['type', (int)$this->category[0]];
$pets = new PetList($conditions);
if (!$pets->error)
{
$this->extendGlobalData($pets->getJSGlobals(GLOBALINFO_RELATED));
$params = ['visibleCols' => "$['abilities']"];
if (!$pets->hasDiffFields(['type']))
$params['hiddenCols'] = "$['type']";
$this->lvTabs[] = array(
'file' => 'pet',
'data' => $pets->getListviewData(),
'params' => $params
);
};
}
protected function generateTitle()
{
array_unshift($this->title, Util::ucFirst(Lang::$game['pets']));
if ($this->category)
array_unshift($this->title, Lang::$pet['cat'][$this->category[0]]);
}
protected function generatePath()
{
if ($this->category)
$this->path[] = $this->category[0];
}
}
?>