[cdca67]: packages / web / 353 / app-bar / app-list.php Maximize Restore History

Download this file

app-list.php    203 lines (178 with data), 6.3 kB

  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
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link href="app-bar.css" rel="stylesheet" type="text/css" media="screen">
<script language="JavaScript" src="app-bar.js"></script>
<title>Elphel Camera Indexpage</title>
</head>
<body id="app_list">
<?php
// Info Window
echo "<div id=\"floatright\">";
echo "<div id=\"camerawindow\">\n";
// camera "live" image
echo "<a href=\"http://".$_SERVER['HTTP_HOST'].":8081/bimg\"><img style=\"text-align:center; border:0;\" width=\"250\" src=\"http://".$_SERVER['HTTP_HOST'].":8081/bimg\"></a><br /><span style=\"font-size:0.9em;\">Camera Live Image</span>";
echo "</div>\n";
echo "<div id=\"infowindow\">\n";
exec('cat /etc/issue', $arr2);
echo "<p><b>Firmware Version:</b> ".$arr2[1]."</p>";
$handle = opendir('/mnt/flash/html/docs/');
while ($file = readdir($handle))
{
if ($file != "." && $file != "..")
{
$sourcefile = $file;
}
}
echo "<p><b>Sourcecode:</b> <a href=\"/docs/".$sourcefile."\">".$sourcefile."</a><br />";
echo "<a href=\"../admin-bin/editcgi.cgi?file=/mnt/flash/html/LICENSE\">GNU GPL License</a></p>";
$s = exec("/bin/bootblocktool -x SERNO");
echo "<p><b>Camera Serial Number:</b> ".substr($s,0,2).":".substr($s,2,2).":".substr($s,4,2).":".substr($s,6,2).":".substr($s,8,2).":".substr($s,10,2)."</p>";
echo "</div>\n";
echo "</div>\n";
// XML LOADING
require_once('xml_simple.php');
function parse_array($element)
{
global $logdata, $logindex;
foreach ($element as $header => $value)
{
if (is_array($value))
{
parse_array($value);
$logindex++;
} else
{
$logdata[$logindex][$header] = $value;
}
}
}
$parser =& new xml_simple('UTF-8');
$def_file = "apps.xml";
$fh = fopen($def_file, r);
$xmldata = fread($fh, filesize($def_file));
$request = $parser->parse($xmldata);
// catch errors
$error_code = 0;
if (!$request) {
$error_code = 1;
echo("XML error: ".$parser->error);
}
$logdata = array();
$logindex = 0;
parse_array($parser->tree);
// FULL SCREEN LIST
echo "<div id=\"list\">";
echo "<div id=\"category_main\"><h2>Main Applications</h2>\n";
for ($i = 0; $i < sizeof($logdata); $i++)
{
if ($logdata[$i]['category'] == "main")
{
if($logdata[$i]['target'] == "newwindow")
{
echo "<a href=\"#\"";
echo " onclick=\"opennewwindow('../".$logdata[$i]['link']."', '".$logdata[$i]['codename']." - ".$_SERVER['REMOTE_ADDR']."')\" ";
if ($site == $logdata[$i]['link'])
echo "class='name current_site'";
else
echo "class='name'";
echo ">".$logdata[$i]['name']."</a>";
echo "<br />\n";
}
else if ($logdata[$i]['target'] == "_blank") {
echo "<a href=\"../".$logdata[$i]['link']."\" target=\"".$logdata[$i]['target']."\" class=\"name\">".$logdata[$i]['name']."</a><br />\n";
}
else {
echo "<a href=\"../index.php?site=".$logdata[$i]['link']."\" class=\"name\">".$logdata[$i]['name']."</a><br />\n";
}
echo "<span class=\"codename\">codename: ".$logdata[$i]['codename']."</span><br />\n";
echo "<span class=\"desc\">".$logdata[$i]['description']."</span><br /><br />\n";
}
}
echo "</div>";
// BETA APPS
echo "<br /><div id=\"category_beta\"><h2>Beta Applications (experimental / still not bug free )</h2>\n";
for ($i = 0; $i < sizeof($logdata); $i++)
{
if ($logdata[$i]['category'] == "beta")
{
if($logdata[$i]['target'] == "newwindow")
{
echo "<a href=\"#\"";
echo " onclick=\"opennewwindow('../".$logdata[$i]['link']."', '".$logdata[$i]['codename']." - ".$_SERVER['REMOTE_ADDR']."')\" ";
if ($site == $logdata[$i]['link'])
echo "class='name current_site'";
else
echo "class='name'";
echo ">".$logdata[$i]['name']."</a>";
echo "<br />\n";
}
else if ($logdata[$i]['target'] == "_blank") {
echo "<a href=\"../".$logdata[$i]['link']."\" target=\"".$logdata[$i]['target']."\" class=\"name\">".$logdata[$i]['name']."</a><br />\n";
}
else {
echo "<a href=\"../index.php?site=".$logdata[$i]['link']."\" class=\"name\">".$logdata[$i]['name']."</a><br />\n";
}
echo "<span class=\"codename\">codename: ".$logdata[$i]['codename']."</span><br />\n";
echo "<span class=\"desc\">".$logdata[$i]['description']."</span><br /><br />\n";
}
}
echo "</div>";
// Advanced Examples
echo "<br /><div id=\"category_advanced\"><h2>Advanced Software Examples</h2>\n";
for ($i = 0; $i < sizeof($logdata); $i++)
{
if ($logdata[$i]['category'] == "advanced_examples")
{
if($logdata[$i]['target'] == "newwindow")
{
echo "<a href=\"#\"";
echo " onclick=\"opennewwindow('../".$logdata[$i]['link']."', '".$logdata[$i]['codename']." - ".$_SERVER['REMOTE_ADDR']."')\" ";
if ($site == $logdata[$i]['link'])
echo "class='name current_site'";
else
echo "class='name'";
echo ">".$logdata[$i]['name']."</a>";
echo "<br />\n";
}
else if ($logdata[$i]['target'] == "_blank") {
echo "<a href=\"../".$logdata[$i]['link']."\" target=\"".$logdata[$i]['target']."\" class=\"name\">".$logdata[$i]['name']."</a><br />\n";
}
else {
echo "<a href=\"../index.php?site=".$logdata[$i]['link']."\" class=\"name\">".$logdata[$i]['name']."</a><br />\n";
}
echo "<span class=\"codename\">codename: ".$logdata[$i]['codename']."</span><br />\n";
echo "<span class=\"desc\">".$logdata[$i]['description']."</span><br /><br />\n";
}
}
echo "</div>";
echo "<br /><div id=\"category_docu\"><h2>Documentation</h2>\n";
for ($i = 0; $i < sizeof($logdata); $i++)
{
if ($logdata[$i]['category'] == "docu")
{
if($logdata[$i]['target'] == "newwindow")
{
echo "<a href=\"#\"";
echo " onclick=\"opennewwindow('".$logdata[$i]['link']."', '".$logdata[$i]['codename']." - ".$_SERVER['REMOTE_ADDR']."')\" ";
if ($site == $logdata[$i]['link'])
echo "class='name current_site'";
else
echo "class='name'";
echo ">".$logdata[$i]['name']."</a>";
echo "<br />\n";
}
else if ($logdata[$i]['target'] == "_blank") {
echo "<a href=\"../".$logdata[$i]['link']."\" target=\"".$logdata[$i]['target']."\" class=\"name\">".$logdata[$i]['name']."</a><br />\n";
}
else {
echo "<a href=\"".$logdata[$i]['link']."\" class=\"name\">".$logdata[$i]['name']."</a><br />\n";
}
echo "<span class=\"desc\">".$logdata[$i]['description']."</span><br /><br />\n";
}
}
echo "</div>";
echo "</div>";
?>
</body>
</html>