File:
0.02.74a/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: switch ($test)
41: {
42: case "web": return "Bytes";
43: case "tcp": return "Pass/Fail";
44: case "testloop": return "";
45: case "wtime": return "Seconds";
46: case "ICMP": return "Seconds";
47: case "ping": return "Seconds";
48: case "testrand": return "";
49: default: return "";
50: }
51: }
52:
53: function oText($val)
54: {
55: global $NATS;
56: if (isset($NATS)) $n=true;
57: else $n=false;
58: switch ($val)
59: {
60: case -1:
61: if ($n) return $NATS->Cfg->Get("site.text.untested","Untested");
62: return "Untested";
63: case 0:
64: if ($n) return $NATS->Cfg->Get("site.text.passed","Passed");
65: return "Passed";
66: case 1:
67: if ($n) return $NATS->Cfg->Get("site.text.warning","Warning");
68: return "Warning";
69: case 2:
70: if ($n) return $NATS->Cfg->Get("site.text.failed","Failed");
71: return "Failed";
72: default:
73: if ($n) return $NATS->Cfg->Get("site.text.unknown","Unknown");
74: return "Unknown";
75: }
76: }
77: ?>