forked from jbaicoianu/elation-vrcade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vrcade.php
38 lines (36 loc) · 1.08 KB
/
vrcade.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
<?php
class Component_vrcade extends Component {
public function init() {
OrmManager::LoadModel("vrcade");
$cfg = ConfigManager::singleton();
$cfg->current["page"]["theme"] = "dark";
}
public function controller_vrcade($args) {
$vars = array();
return $this->GetComponentResponse("./vrcade.tpl", $vars);
}
public function controller_games($args) {
$vars = array();
$vars["games"] = array();
$dirroot = "components/vrcade/media/games/";
$dir = opendir($dirroot);
while (($d = readdir($dir)) !== false) {
if ($d[0] != '.') {
$vars["games"][] = $d;
}
}
return $this->GetComponentResponse("./games.tpl", $vars);
}
public function controller_models($args) {
$vars = array();
$vars["models"] = array();
$dirroot = "components/vrcade/media/models/";
$dir = opendir($dirroot);
while (($d = readdir($dir)) !== false) {
if ($d[0] != '.' && file_exists($dirroot . $d . '/' . $d . '.json')) {
$vars["models"][] = $d;
}
}
return $this->GetComponentResponse("./models.tpl", $vars);
}
}