3 * html.c: HTML header/footer templating for web interface.
4 * copyright (c) 2006 Ben Stewart.
5 * copyright (c) 2010 Malte S. Stretz.
7 * You may use, modify and redistribute this file under the terms of the
8 * GNU General Public License version 2. (see COPYING.GPL)
19 static const char *relpaths
[] = {
25 void html_open(struct str
*buf
, const char *title
,
26 const unsigned int path_depth
, const int want_graph_js
)
29 assert(path_depth
< (sizeof(relpaths
)/sizeof(*relpaths
)));
30 root
= relpaths
[path_depth
];
36 "<title>%s (darkstat3 %s)</title>\n"
37 "<meta name=\"generator\" content=\"" PACKAGE_STRING
"\">\n"
38 "<meta name=\"robots\" content=\"noindex, noarchive\">\n"
39 "<link rel=\"stylesheet\" href=\"%s/style.css\" type=\"text/css\">\n"
40 , title
, opt_interface
, root
);
44 "<script src=\"%s/graph.js\" type=\"text/javascript\"></script>\n"
50 "<div class=\"menu\">\n"
51 "<ul class=\"menu\">" /* no whitespace (newlines) in list */
52 "<li class=\"label\">" PACKAGE_STRING
"</li>"
53 "<li><a href=\"%s/\">graphs</a></li>"
54 "<li><a href=\"%s/hosts/\">hosts</a></li>"
55 "<li><a href=\"" PACKAGE_URL
"\">homepage</a></li>"
58 "<div class=\"content\">\n"
59 "<h2 class=\"pageheader\">%s</h2>\n"
63 void html_close(struct str
*buf
)
71 /* vim:set ts=4 sw=4 tw=78 expandtab: */