29 using System.Collections.Generic;
32 namespace OpenSim.
Region.UserStatistics
34 public static class HTMLUtil
37 public static void TR_O(ref StringBuilder o,
string pclass)
40 if (pclass.Length > 0)
42 GenericClass(ref o, pclass);
47 public static void TR_C(ref StringBuilder o)
52 public static void TD_O(ref StringBuilder o,
string pclass)
54 TD_O(ref o, pclass, 0, 0);
57 public static void TD_O(ref StringBuilder o,
string pclass,
int rowspan,
int colspan)
60 if (pclass.Length > 0)
62 GenericClass(ref o, pclass);
66 o.Append(
" rowspan=\"");
72 o.Append(
" colspan=\"");
79 public static void TD_C(ref StringBuilder o)
84 public static void TABLE_O(ref StringBuilder o,
string pclass)
87 if (pclass.Length > 0)
89 GenericClass(ref o, pclass);
94 public static void TABLE_C(ref StringBuilder o)
96 o.Append(
"</table>\n");
99 public static void BLOCKQUOTE_O(ref StringBuilder o,
string pclass)
101 o.Append(
"<blockquote");
102 if (pclass.Length > 0)
104 GenericClass(ref o, pclass);
109 public static void BLOCKQUOTE_C(ref StringBuilder o)
111 o.Append(
"</blockquote>\n");
114 public static void BR(ref StringBuilder o)
116 o.Append(
"<br />\n");
119 public static void HR(ref StringBuilder o,
string pclass)
122 if (pclass.Length > 0)
124 GenericClass(ref o, pclass);
129 public static void UL_O(ref StringBuilder o,
string pclass)
132 if (pclass.Length > 0)
134 GenericClass(ref o, pclass);
139 public static void UL_C(ref StringBuilder o)
144 public static void OL_O(ref StringBuilder o,
string pclass)
147 if (pclass.Length > 0)
149 GenericClass(ref o, pclass);
154 public static void OL_C(ref StringBuilder o)
159 public static void LI_O(ref StringBuilder o,
string pclass)
162 if (pclass.Length > 0)
164 GenericClass(ref o, pclass);
169 public static void LI_C(ref StringBuilder o)
174 public static void GenericClass(ref StringBuilder o,
string pclass)
176 o.Append(
" class=\"");
181 public static void InsertProtoTypeAJAX(ref StringBuilder o)
183 o.Append(
"<script type=\"text/javascript\" src=\"prototype.js\"></script>\n");
184 o.Append(
"<script type=\"text/javascript\" src=\"updater.js\"></script>\n");
187 public static void InsertPeriodicUpdaters(ref StringBuilder o,
string[] divID,
int[] seconds,
string[] reportfrag)
189 o.Append(
"<script type=\"text/javascript\">\n");
193 document.observe('dom:loaded', function() {
195 first arg : div to update
196 second arg : interval to poll in seconds
197 third arg : file to get data
200 for (
int i = 0; i < divID.Length; i++)
203 o.Append(
"new updater('");
206 o.Append(seconds[i]);
208 o.Append(reportfrag[i]);
218 public static void HtmlHeaders_O(ref StringBuilder o)
220 o.Append(
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n");
221 o.Append(
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"nl\">");
222 o.Append(
"<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />");
225 public static void HtmlHeaders_C(ref StringBuilder o)
231 public static void AddReportLinks(ref StringBuilder o, Dictionary<string, IStatsController> reports,
string pClass)
234 foreach (
string str
in reports.Keys)
236 if (reports[str].ReportName.Length > 0)
240 o.Append(
"| ");
242 A(ref o, reports[str].ReportName, str, pClass);
243 o.Append(
" ");
249 public static void A(ref StringBuilder o,
string linktext,
string linkhref,
string pClass)
252 if (pClass.Length > 0)
254 GenericClass(ref o, pClass);
256 o.Append(
" href=\"");