-
Notifications
You must be signed in to change notification settings - Fork 217
/
Copy pathpets.php
71 lines (55 loc) · 1.87 KB
/
pets.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
// menuId 8: Pets g_initPath()
// tabid 0: Database g_initHeader()
class PetsPage extends GenericPage
{
use TrListPage;
protected $type = Type::PET;
protected $tpl = 'list-page-generic';
protected $path = [0, 8];
protected $tabId = 0;
protected $mode = CACHE_TYPE_PAGE;
protected $validCats = [0, 1, 2];
public function __construct($pageCall, $pageParam)
{
$this->getCategoryFromUrl($pageParam);
parent::__construct($pageCall, $pageParam);
$this->name = Util::ucFirst(Lang::game('pets'));
}
protected function generateContent()
{
$conditions = [];
if (!User::isInGroup(U_GROUP_EMPLOYEE))
$conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
if ($this->category)
$conditions[] = ['type', (int)$this->category[0]];
$data = [];
$pets = new PetList($conditions);
if (!$pets->error)
{
$this->extendGlobalData($pets->getJSGlobals(GLOBALINFO_RELATED));
$data = array(
'data' => array_values($pets->getListviewData()),
'visibleCols' => ['abilities'],
'computeDataFunc' => '$_'
);
if (!$pets->hasDiffFields('type'))
$data['hiddenCols'] = ['type'];
};
$this->lvTabs[] = [PetList::$brickFile, $data, 'petFoodCol'];
}
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];
}
}
?>