--- apache_1.3.33/src/modules/standard/mod_autoindex.c.org 2005-08-11 10:15:59.000000000 +0900 +++ apache_1.3.33/src/modules/standard/mod_autoindex.c 2005-08-16 11:51:20.000000000 +0900 @@ -39,6 +39,14 @@ * Handling configuration directives... */ +#ifndef DOCTYPE_XHTML_1_0S + /** XHTML 1.0 Strict Doctype */ + #define DOCTYPE_XHTML_1_0S "\n" +#endif + #define HRULE 1 #define NO_HRULE 0 #define FRONT_MATTER 1 @@ -113,6 +121,8 @@ int icon_width; int icon_height; char *default_order; + char *encoding; + char *css; array_header *icon_list; array_header *alt_list; @@ -153,11 +163,22 @@ * We include the DOCTYPE because we may be using features therefrom (i.e., * HEIGHT and WIDTH attributes on the icons if we're FancyIndexing). */ -static void emit_preamble(request_rec *r, char *title) +static void emit_preamble(request_rec *r, char *title, autoindex_config_rec *d ) { - ap_rvputs(r, DOCTYPE_HTML_3_2, - "\n
\n\n", r);
+ ap_rputs("\n", r);
while (!feof(f)) {
do {
n = fread(buf, sizeof(char), IOBUFSIZE, f);
@@ -934,7 +986,7 @@
c = i + 1;
}
}
- ap_rputs("\n", r);
+ ap_rputs("\n", r);
}
/* See mod_include */
@@ -950,8 +1002,8 @@
* instead of a text document, meaning nothing will be displayed, but
* oh well.
*/
-static void emit_head(request_rec *r, char *header_fname, int suppress_amble,
- char *title)
+static void emit_head(request_rec *r, autoindex_config_rec *autoindex_conf,
+ int suppress_amble, char *title)
{
FILE *f;
request_rec *rr = NULL;
@@ -961,6 +1013,7 @@
const char *r_accept_enc;
table *hdrs = r->headers_in;
+ char *header_fname = find_header(autoindex_conf, r);
/*
* If there's a header file, send a subrequest to look for it. If it's
* found and html do the subrequest, otherwise handle it
@@ -993,7 +1046,7 @@
emit_H1 = 0;
if (! suppress_amble) {
- emit_preamble(r, title);
+ emit_preamble(r, title, autoindex_conf);
}
/* See mod_include */
@@ -1020,7 +1073,7 @@
* where it belongs.
*/
if ((f = ap_pfopen(r->pool, rr->filename, "r")) != 0) {
- emit_preamble(r, title);
+ emit_preamble(r, title, autoindex_conf);
emit_amble = 0;
do_emit_plain(r, f);
ap_pfclose(r->pool, f);
@@ -1042,10 +1095,12 @@
}
if (emit_amble) {
- emit_preamble(r, title);
+ emit_preamble(r, title, autoindex_conf);
}
if (emit_H1) {
- ap_rvputs(r, "", r);
- if ((tp = find_default_icon(d, "^^BLANKICON^^"))) {
- ap_rvputs(r, "
icon_width && d->icon_height) {
- ap_rprintf
- (
- r,
- " HEIGHT=\"%d\" WIDTH=\"%d\"",
- d->icon_height,
- d->icon_width
- );
- }
- ap_rputs("> ", r);
- }
+
+ ap_rputs( "| ", r ); emit_link(r, "Name", K_NAME, keyid, direction, static_columns); - ap_rputs(pad_scratch + 4, r); + ap_rputs( " | \n", r ); + /* * Emit the guaranteed-at-least-one-space-between-columns byte. */ ap_rputs(" ", r); if (!(autoindex_opts & SUPPRESS_LAST_MOD)) { + ap_rputs( "\t", r ); emit_link(r, "Last modified", K_LAST_MOD, keyid, direction, static_columns); - ap_rputs(" ", r); + ap_rputs( " | \n", r ); } if (!(autoindex_opts & SUPPRESS_SIZE)) { + ap_rputs( "\t", r ); emit_link(r, "Size", K_SIZE, keyid, direction, static_columns); - ap_rputs(" ", r); + ap_rputs( " | \n", r ); } if (!(autoindex_opts & SUPPRESS_DESC)) { + ap_rputs( "\t", r ); emit_link(r, "Description", K_DESC, keyid, direction, static_columns); + ap_rputs( " | \n", r ); } - ap_rputs("\n
|---|---|---|---|
| ", r);
if (autoindex_opts & ICONS_ARE_LINKS) {
- ap_rvputs(r, "", NULL);
+ ap_rvputs(r, "", NULL);
}
if ((ar[x]->icon) || d->default_icon) {
- ap_rvputs(r, " | \n", NULL);
/*
* The blank before the storm.. er, before the next field.
*/
ap_rputs(" ", r);
if (!(autoindex_opts & SUPPRESS_LAST_MOD)) {
+ ap_rputs( "\t", r ); if (ar[x]->lm != -1) { char time_str[MAX_STRING_LEN]; struct tm *ts = localtime(&ar[x]->lm); strftime(time_str, MAX_STRING_LEN, "%d-%b-%Y %H:%M ", ts); ap_rputs(time_str, r); } - else { - /*Length="22-Feb-1998 23:42 " (see 4 lines above) */ - ap_rputs(" ", r); - } + ap_rputs( " | \n", r ); } if (!(autoindex_opts & SUPPRESS_SIZE)) { + ap_rputs( "\t", r ); ap_send_size(ar[x]->size, r); - ap_rputs(" ", r); + ap_rputs( " | \n", r ); } if (!(autoindex_opts & SUPPRESS_DESC)) { + ap_rputs( "\t", r ); if (ar[x]->desc) { ap_rputs(terminate_description(d, ar[x]->desc, autoindex_opts, desc_width), r); } + ap_rputs( " | \n", r ); } + ap_rputs( "