httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r689261 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_autoindex.xml modules/generators/mod_autoindex.c
Date Tue, 26 Aug 2008 22:10:06 GMT
Author: niq
Date: Tue Aug 26 15:10:06 2008
New Revision: 689261

URL: http://svn.apache.org/viewvc?rev=689261&view=rev
Log:
Add option to insert something in autoindex head.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml
    httpd/httpd/trunk/modules/generators/mod_autoindex.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=689261&r1=689260&r2=689261&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Aug 26 15:10:06 2008
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) mod_autoindex: add configuration option to insert string
+     in HTML HEAD. [Nick Kew]
+
   *) mod_ssl: implement dynamic mutex callbacks for the benefit of
      OpenSSL.  [Sander Temme]
 

Modified: httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml?rev=689261&r1=689260&r2=689261&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml Tue Aug 26 15:10:06 2008
@@ -938,6 +938,26 @@
 </directivesynopsis>
 
 <directivesynopsis>
+<name>IndexHeadInsert</name>
+<description>Inserts text in the HEAD section of an index page.</description>
+<syntax>IndexHeadInsert <var>"markup ..."</var></syntax>
+<contextlist><context>server config</context><context>virtual host</context>
+<context>directory</context><context>.htaccess</context>
+</contextlist>
+<override>Indexes</override>
+
+<usage>
+    <p>The <directive>IndexHeadInsert</directive> directive specifies a
+    string to insert in the <var>&lt;head&gt;</var> section of the HTML
+    generated for the index page.</p>
+    <example>
+      <title>Example</title>
+      IndexHeadInsert "&lt;link rel=\"sitemap\" href=\"/sitemap.html\"&gt;"
+    </example>
+</usage>
+</directivesynopsis>
+
+<directivesynopsis>
 <name>ReadmeName</name>
 <description>Name of the file that will be inserted at the end
 of the index listing</description>

Modified: httpd/httpd/trunk/modules/generators/mod_autoindex.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_autoindex.c?rev=689261&r1=689260&r2=689261&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_autoindex.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_autoindex.c Tue Aug 26 15:10:06 2008
@@ -119,6 +119,7 @@
 
     char *default_icon;
     char *style_sheet;
+    char *head_insert;
     apr_int32_t opts;
     apr_int32_t incremented_opts;
     apr_int32_t decremented_opts;
@@ -176,6 +177,9 @@
         ap_rvputs(r, "  <link rel=\"stylesheet\" href=\"", d->style_sheet,
                 "\" type=\"text/css\"", xhtml ? " />\n" : ">\n", NULL);
     }
+    if (d->head_insert != NULL) {
+        ap_rputs(d->head_insert, r);
+    }
     ap_rvputs(r, " </head>\n <body>\n", NULL);
 }
 
@@ -594,6 +598,9 @@
     AP_INIT_TAKE1("IndexStyleSheet", ap_set_string_slot,
                   (void *)APR_OFFSETOF(autoindex_config_rec, style_sheet),
                   DIR_CMD_PERMS, "URL to style sheet"),
+    AP_INIT_TAKE1("IndexHeadInsert", ap_set_string_slot,
+                  (void *)APR_OFFSETOF(autoindex_config_rec, head_insert),
+                  DIR_CMD_PERMS, "String to insert in HTML HEAD section"),
     {NULL}
 };
 
@@ -634,6 +641,8 @@
                                           : base->default_icon;
     new->style_sheet = add->style_sheet ? add->style_sheet
                                           : base->style_sheet;
+    new->head_insert = add->head_insert ? add->head_insert
+                                          : base->head_insert;
     new->icon_height = add->icon_height ? add->icon_height : base->icon_height;
     new->icon_width = add->icon_width ? add->icon_width : base->icon_width;
 



Mime
View raw message