1 | <?php |
||
15 | class StatsMain extends StatisticsPage |
||
16 | { |
||
17 | protected function execute() |
||
18 | { |
||
19 | global $smarty, $filepath; |
||
20 | |||
21 | $files = scandir($filepath . "/includes/statistics/"); |
||
22 | |||
23 | $statsPageDefinitions = preg_grep("/php$/", $files); |
||
|
|||
24 | |||
25 | $statsPages = array(); |
||
26 | |||
27 | foreach ($statsPageDefinitions as $i) { |
||
28 | // TODO: is this require still needed? AutoLoader ftw. |
||
29 | require_once($filepath . "/includes/statistics/" . $i); |
||
30 | $expld = explode('.', $i); |
||
31 | $className = $expld[0]; |
||
32 | |||
33 | /** @var StatisticsPage $statsPageObject */ |
||
34 | $statsPageObject = new $className; |
||
35 | |||
36 | if ($statsPageObject->hideFromMenu() === false) { |
||
37 | $statsPages[] = $statsPageObject; |
||
38 | } |
||
39 | } |
||
40 | |||
41 | $this->smallStats(); |
||
42 | |||
43 | $smarty->assign("statsPages", $statsPages); |
||
44 | |||
45 | $graphList = array("day", "2day", "4day", "week", "2week", "month", "3month"); |
||
46 | $smarty->assign("graphList", $graphList); |
||
47 | |||
48 | return $smarty->fetch("statistics/main.tpl"); |
||
49 | } |
||
50 | |||
51 | public function getPageTitle() |
||
52 | { |
||
53 | return "Account Creation Statistics"; |
||
54 | } |
||
55 | |||
56 | public function getPageName() |
||
57 | { |
||
58 | return "Main"; |
||
59 | } |
||
60 | |||
61 | public function isProtected() |
||
62 | { |
||
63 | return true; |
||
64 | } |
||
65 | |||
66 | public function requiresWikiDatabase() |
||
69 | } |
||
70 | |||
71 | public function requiresSimpleHtmlEnvironment() |
||
72 | { |
||
73 | return false; |
||
74 | } |
||
75 | |||
76 | public function hideFromMenu() |
||
77 | { |
||
78 | return true; |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * Gets the relevant statistics from the database for the small statistics table |
||
83 | */ |
||
84 | private function smallStats() |
||
150 | } |
||
151 | } |
||
152 |