summaryrefslogtreecommitdiff
path: root/lib/HtmlSkinner.cc
blob: 098cfb972eaf3317a7d9e5445ed47a8db4203192 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 *  Baltisot
 *  Copyright (C) 1999-2007 Nicolas "Pixel" Noble
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/* $Id: HtmlSkinner.cc,v 1.2 2007-05-30 11:57:09 pixel Exp $ */

#include "HtmlSkinner.h"

HtmlSkinner::HtmlSkinner() {
}

HtmlSkinner::~HtmlSkinner() {
}

String HtmlSkinner::Redirect(const String & location) {
    return "<HTML><HEAD><TITLE>301 - Moved Permanently</TITLE></HEAD>\n"
           "<BODY><center><b><h2>You should be redirected <a href=\"" + location + "\">here</a> shortly</h2></b></center>\n"
            "</BODY></HTML>\n";
}

String HtmlSkinner::Error(const String & location) {
    return "<HTML><HEAD><TITLE>404 - Error</TITLE></HEAD>\n"
           "<BODY><center><b><h2>The server was unable to process your query</h2></b></center>\n"
           "Click <A HREF=\"/\">here</A> to go the main page.</BODY></HTML>\n";
}

String HtmlSkinner::Header(const String & title) {
    return "<HTML><HEAD><TITLE>" + title + "</TITLE>\n"
           "<META http-equiv=\"Content-Style-Type\" content=\"text/css\">\n"
           "<LINK REL=STYLESHEET HREF=\"/image/style.css\" TYPE=\"text/css\">\n"
           "</HEAD><BODY BGCOLOR=\"#aaaaaa\" BACKGROUND=\"/image/grain.png\">\n"
           "<center><TABLE WIDTH=\"50%\" BORDER=3 cellspacing=1 BGCOLOR=\"#ffffff\"><TR><TD>\n"
           "<center><b><h1>" + title + "</h1></b></center></TD></TR></TABLE><P>\n"
           "<TABLE WIDTH=\"80%\" BORDER=2 cellspacing=1 BGCOLOR=\"#ffffff\"><TR><TD>\n";
}

String HtmlSkinner::Footer() {
    return "</TABLE></TD></TR></BODY></HTML>";
}