summaryrefslogtreecommitdiff
path: root/lib/Table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Table.cc')
-rw-r--r--lib/Table.cc33
1 files changed, 20 insertions, 13 deletions
diff --git a/lib/Table.cc b/lib/Table.cc
index 776caae..30f3127 100644
--- a/lib/Table.cc
+++ b/lib/Table.cc
@@ -1,5 +1,8 @@
#include "Table.h"
#include "HttpServ.h"
+#include "CopyJob.h"
+#include "Buffer.h"
+#include "config.h"
Table::Table(const String & titre, const String & url, String * heads, String * cells, int nbc, int nbl, Action * na) :
Action(url), tit(titre), hds(heads), cls(cells), nc(nbc), nl(nbl), Next(na) { }
@@ -8,34 +11,38 @@ String Table::GetTitle(void) {
return tit;
}
-void Table::Do(Variables * v, Handle * h) {
- SendHead(h);
+Task * Table::Do(Variables * v, Handle * h) {
+ Handle * b = new Buffer();
+ Task * t = new CopyJob(b, h, -1, true);
+
+ SendHead(b);
- (*h) << "<center><TABLE BORDER=0>" << endnl;
+ (*b) << "<center><TABLE BORDER=0>" << endnl;
if (hds) {
- (*h) << "<TR>" << endnl;
+ (*b) << "<TR>" << endnl;
for (int i = 0; i < nc; i++) {
- (*h) << "<TH BGCOLOR=\"#bbbbbb\">" << hds[i] << "</TH>" << endnl;
+ (*b) << "<TH BGCOLOR=\"#bbbbbb\">" << hds[i] << "</TH>" << endnl;
}
- (*h) << "</TR>" << endnl;
+ (*b) << "</TR>" << endnl;
}
for (int l = 0; l < nl; l++) {
- (*h) << "<TR>" << endnl;
+ (*b) << "<TR>" << endnl;
for (int c = 0; c < nc; c++) {
- (*h) << "<TD BGCOLOR=\"#" << (l % 2 ? "cccccc" : "dddddd") << "\">" << cls[l * nc + c] << "</TD>" << endnl;
+ (*b) << "<TD BGCOLOR=\"#" << (l % 2 ? "cccccc" : "dddddd") << "\">" << cls[l * nc + c] << "</TD>" << endnl;
}
- (*h) << "</TR>" << endnl;
+ (*b) << "</TR>" << endnl;
}
- (*h) << "</TABLE>"
+ (*b) << "</TABLE>"
"<FORM METHOD=\"POST\" ACTION=\"/bin/" << (Next ? Next->GetURL() : "start") << "\">" << endnl <<
"<INPUT TYPE=\"SUBMIT\" VALUE=\" Ok \">" << endnl;
-(*h) << "</FORM></CENTER>" << endnl;
+(*b) << "</FORM></CENTER>" << endnl;
-
- SendFoot(h);
+ SendFoot(b);
Accessed();
+
+ return t;
}