aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/UserStatistics/HTMLUtil.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/UserStatistics/HTMLUtil.cs185
1 files changed, 185 insertions, 0 deletions
diff --git a/OpenSim/Region/UserStatistics/HTMLUtil.cs b/OpenSim/Region/UserStatistics/HTMLUtil.cs
new file mode 100644
index 0000000..ed8cc98
--- /dev/null
+++ b/OpenSim/Region/UserStatistics/HTMLUtil.cs
@@ -0,0 +1,185 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Region.UserStatistics
6{
7 public static class HTMLUtil
8 {
9
10 public static void TR_O(ref StringBuilder o, string pclass)
11 {
12 o.Append("<tr");
13 if (pclass.Length > 0)
14 {
15 GenericClass(ref o, pclass);
16 }
17 o.Append(">\n\t");
18 }
19 public static void TR_C(ref StringBuilder o)
20 {
21 o.Append("</tr>\n");
22 }
23
24 public static void TD_O(ref StringBuilder o, string pclass)
25 {
26 o.Append("<td");
27 if (pclass.Length > 0)
28 {
29 GenericClass(ref o, pclass);
30 }
31 o.Append(">");
32 }
33 public static void TD_C(ref StringBuilder o)
34 {
35 o.Append("</td>");
36 }
37 public static void TABLE_O(ref StringBuilder o, string pclass)
38 {
39 o.Append("<table");
40 if (pclass.Length > 0)
41 {
42 GenericClass(ref o, pclass);
43 }
44 o.Append(">\n\t");
45 }
46 public static void TABLE_C(ref StringBuilder o)
47 {
48 o.Append("</table>\n");
49 }
50
51 public static void BLOCKQUOTE_O(ref StringBuilder o, string pclass)
52 {
53 o.Append("<blockquote");
54 if (pclass.Length > 0)
55 {
56 GenericClass(ref o, pclass);
57 }
58 o.Append(" />\n");
59 }
60
61 public static void BLOCKQUOTE_C(ref StringBuilder o)
62 {
63 o.Append("</blockquote>\n");
64 }
65
66 public static void BR(ref StringBuilder o)
67 {
68 o.Append("<br />\n");
69 }
70
71 public static void HR(ref StringBuilder o, string pclass)
72 {
73 o.Append("<hr");
74 if (pclass.Length > 0)
75 {
76 GenericClass(ref o, pclass);
77 }
78 o.Append(" />\n");
79 }
80
81 public static void UL_O(ref StringBuilder o, string pclass)
82 {
83 o.Append("<ul");
84 if (pclass.Length > 0)
85 {
86 GenericClass(ref o, pclass);
87 }
88 o.Append(" />\n");
89 }
90
91 public static void UL_C(ref StringBuilder o)
92 {
93 o.Append("</ul>\n");
94 }
95
96 public static void OL_O(ref StringBuilder o, string pclass)
97 {
98 o.Append("<ol");
99 if (pclass.Length > 0)
100 {
101 GenericClass(ref o, pclass);
102 }
103 o.Append(" />\n");
104 }
105
106 public static void OL_C(ref StringBuilder o)
107 {
108 o.Append("</ol>\n");
109 }
110
111 public static void LI_O(ref StringBuilder o, string pclass)
112 {
113 o.Append("<li");
114 if (pclass.Length > 0)
115 {
116 GenericClass(ref o, pclass);
117 }
118 o.Append(" />\n");
119 }
120
121 public static void LI_C(ref StringBuilder o)
122 {
123 o.Append("</li>\n");
124 }
125
126 public static void GenericClass(ref StringBuilder o, string pclass)
127 {
128 o.Append(" class=\"");
129 o.Append(pclass);
130 o.Append("\"");
131 }
132
133 public static void InsertProtoTypeAJAX(ref StringBuilder o)
134 {
135 o.Append("<script type=\"text/javascript\" src=\"prototype.js\"></script>\n");
136 o.Append("<script type=\"text/javascript\" src=\"updater.js\"></script>\n");
137 }
138
139 public static void InsertPeriodicUpdaters(ref StringBuilder o, string[] divID, int[] seconds, string[] reportfrag)
140 {
141 o.Append("<script type=\"text/javascript\">\n");
142 o.Append(
143 @"
144 // <![CDATA[
145 document.observe('dom:loaded', function() {
146 /*
147 first arg : div to update
148 second arg : interval to poll in seconds
149 third arg : file to get data
150 */
151");
152 for (int i = 0; i < divID.Length; i++)
153 {
154
155 o.Append("new updater('");
156 o.Append(divID[i]);
157 o.Append("', ");
158 o.Append(seconds[i]);
159 o.Append(", '");
160 o.Append(reportfrag[i]);
161 o.Append("');\n");
162 }
163
164 o.Append(@"
165 });
166 // ]]>
167 </script>");
168
169 }
170
171 public static void HtmlHeaders_O ( ref StringBuilder o)
172 {
173 o.Append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n");
174 o.Append("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"nl\">");
175 o.Append("<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />");
176
177
178 }
179 public static void HtmlHeaders_C ( ref StringBuilder o)
180 {
181 o.Append("</HEAD>");
182 o.Append("<BODY>");
183 }
184 }
185}