File:
0.03.00a/server/base/testtext.inc.php (
View as Code)
1: 2: /* -------------------------------------------------------------
3: This file is part of FreeNATS
4:
5: FreeNATS is (C) Copyright 2008 PurplePixie Systems
6:
7: FreeNATS is free software: you can redistribute it and/or modify
8: it under the terms of the GNU General Public License as published by
9: the Free Software Foundation, either version 3 of the License, or
10: (at your option) any later version.
11:
12: FreeNATS is distributed in the hope that it will be useful,
13: but WITHOUT ANY WARRANTY; without even the implied warranty of
14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: GNU General Public License for more details.
16:
17: You should have received a copy of the GNU General Public License
18: along with FreeNATS. If not, see www.gnu.org/licenses
19:
20: For more information see www.purplepixie.org/freenats
21: -------------------------------------------------------------- */
22:
23: function lText($test)
24: {
25: switch ($test)
26: {
27: case "web": return "Web Size";
28: case "tcp": return "TCP Port Test";
29: case "testloop": return "Test Loop";
30: case "wtime": return "Web Time";
31: case "ICMP": return "Ping Test";
32: case "ping": return "Remote Ping Test";
33: case "testrand": return "Test Random Return";
34: default: return $test;
35: }
36: }
37:
38: function lUnit($test)
39: {
40: global $NATS;
41: switch ($test)
42: {
43: case "web": case "wsize": return "KiloBytes";
44: case "tcp": return "Pass/Fail";
45: case "testloop": return "";
46: case "wtime": return "Seconds";
47: case "ICMP": case "ping":
48: if ($NATS->Cfg->Get("test.icmp.returnms",0)==1) return "Milliseconds";
49: else return "Seconds";
50:
51: case "testrand": return "";
52: default: return "";
53: }
54: }
55:
56: function oText($val)
57: {
58: global $NATS;
59: if (isset($NATS)) $n=true;
60: else $n=false;
61: switch ($val)
62: {
63: case -1:
64: if ($n) return $NATS->Cfg->Get("site.text.untested","Untested");
65: return "Untested";
66: case 0:
67: if ($n) return $NATS->Cfg->Get("site.text.passed","Passed");
68: return "Passed";
69: case 1:
70: if ($n) return $NATS->Cfg->Get("site.text.warning","Warning");
71: return "Warning";
72: case 2:
73: if ($n) return $NATS->Cfg->Get("site.text.failed","Failed");
74: return "Failed";
75: default:
76: if ($n) return $NATS->Cfg->Get("site.text.unknown","Unknown");
77: return "Unknown";
78: }
79: }
80: ?>