forked from Runalyze/Runalyze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
84 lines (73 loc) · 1.92 KB
/
index.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
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* RUNALYZE
*
* @author Hannes Christiansen
* @copyright http://www.runalyze.de/
*/
if (!file_exists('config.php')) {
include 'install.php';
exit();
}
require 'inc/class.Frontend.php';
$Frontend = new Frontend();
?>
<div id="container">
<div id="main">
<div id="data-browser" class="panel">
<div id="data-browser-inner">
<?php
$DataBrowser = new DataBrowser();
$DataBrowser->display();
?>
</div>
</div>
<div id="statistics" class="panel">
<ul id="statistics-nav">
<?php
$Factory = new PluginFactory();
$Stats = $Factory->activePlugins( PluginType::Stat );
foreach ($Stats as $i => $key) {
$Plugin = $Factory->newInstance($key);
if ($Plugin !== false) {
echo '<li'.($i == 0 ? ' class="active"' : '').'>'.$Plugin->getLink().'</li>';
}
}
if (PluginStat::hasVariousStats()) {
echo '<li class="with-submenu">';
echo '<a href="#">'.__('Miscellaneous').'</a>';
echo '<ul class="submenu">';
$VariousStats = $Factory->variousPlugins();
foreach ($VariousStats as $key) {
$Plugin = $Factory->newInstance($key);
if ($Plugin !== false) {
echo '<li>'.$Plugin->getLink().'</li>';
}
}
echo '</ul>';
echo '</li>';
}
?>
</ul>
<div id="statistics-inner">
<?php
if (isset($_GET['id'])) {
$View = new TrainingView(new TrainingObject(Request::sendId()));
$View->display();
} elseif (isset($_GET['pluginid'])) {
$Factory->newInstanceFor((int)$_GET['pluginid'])->display();
} else {
if (empty($Stats)) {
echo __('<em>There are no statistics available. Active a plugin in your configuration.</em>');
} else {
$Factory->newInstance($Stats[0])->display();
}
}
?>
</div>
</div>
</div>
<div id="panels">
<?php $Frontend->displayPanels(); ?>
</div>
</div>