httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject cvs commit: httpd-2.0/modules/generators mod_autoindex.c
Date Thu, 20 Nov 2003 03:45:23 GMT
ianh        2003/11/19 19:45:23

  Modified:    .        CHANGES
               docs/manual/mod mod_autoindex.xml
               modules/generators mod_autoindex.c
  Log:
  mod_autoindex: new directive IndexStyleSheet
  
  Submitted by: Tyler Riddle <triddle_1999 yahoo.com> and Paul Querna <chip force-elite.com>
  
  Revision  Changes    Path
  1.1316    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1315
  retrieving revision 1.1316
  diff -u -r1.1315 -r1.1316
  --- CHANGES	13 Nov 2003 18:34:18 -0000	1.1315
  +++ CHANGES	20 Nov 2003 03:45:22 -0000	1.1316
  @@ -2,6 +2,9 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) mod_autoindex: new directive IndexStyleSheet 
  +    [Tyler Riddle <triddle_1999 yahoo.com>, Paul Querna <chip force-elite.com>]
  +
     *) Fix a long delay with CGI requests and keepalive connections on
        AIX.  [Jeff Trawick]
   
  
  
  
  1.18      +18 -0     httpd-2.0/docs/manual/mod/mod_autoindex.xml
  
  Index: mod_autoindex.xml
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/mod/mod_autoindex.xml,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- mod_autoindex.xml	2 Nov 2003 20:52:24 -0000	1.17
  +++ mod_autoindex.xml	20 Nov 2003 03:45:22 -0000	1.18
  @@ -859,6 +859,24 @@
       order.</p>
   </usage>
   </directivesynopsis>
  +<directivesynopsis>
  +<name>IndexStyleSheet</name>
  +<description>Adds a CSS stylesheet to autoindexes output</description>
  +<syntax>IndexStyleSheet<var>URI</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>IndexStyleSheet</directive> directive adds a stylesheet
  +    to the output of mod_authindex
  +    </p>
  +    <example>
  +      IndexStyleSheet "/css/style.css"
  +    </example>
  +</usage>
  +</directivesynopsis>
   
   <directivesynopsis>
   <name>ReadmeName</name>
  
  
  
  1.126     +17 -1     httpd-2.0/modules/generators/mod_autoindex.c
  
  Index: mod_autoindex.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_autoindex.c,v
  retrieving revision 1.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- mod_autoindex.c	3 Nov 2003 21:57:51 -0000	1.125
  +++ mod_autoindex.c	20 Nov 2003 03:45:22 -0000	1.126
  @@ -159,6 +159,7 @@
   typedef struct autoindex_config_struct {
   
       char *default_icon;
  +    char *style_sheet;
       apr_int32_t opts;
       apr_int32_t incremented_opts;
       apr_int32_t decremented_opts;
  @@ -193,9 +194,19 @@
    */
   static void emit_preamble(request_rec *r, int xhtml, const char *title)
   {
  +    autoindex_config_rec *d;
  +
  +    d = (autoindex_config_rec *) ap_get_module_config(r->per_dir_config,
  +                                                      &autoindex_module);
  +
       ap_rvputs(r, xhtml ? DOCTYPE_XHTML_1_0T : DOCTYPE_HTML_3_2,
                 "<html>\n <head>\n  <title>Index of ", title,
  -              "</title>\n </head>\n <body>\n", NULL);
  +              "</title>\n", NULL);
  +    if (d->style_sheet != NULL) {
  +        ap_rvputs(r, "  <link rel=\"stylesheet\" href=\"", d->style_sheet,
  +                "\" type=\"text/css\"", xhtml ? "/>\n" : ">\n", NULL);
  +    }
  +    ap_rvputs(r, "</head>\n <body>\n", NULL);
   }
   
   static void push_item(apr_array_header_t *arr, char *type, const char *to,
  @@ -599,6 +610,9 @@
       AP_INIT_TAKE1("DefaultIcon", ap_set_string_slot,
                     (void *)APR_OFFSETOF(autoindex_config_rec, default_icon),
                     DIR_CMD_PERMS, "an icon URL"),
  +    AP_INIT_TAKE1("IndexStyleSheet", ap_set_string_slot,
  +                  (void *)APR_OFFSETOF(autoindex_config_rec, style_sheet),
  +                  DIR_CMD_PERMS, "URL to style sheet"),
       {NULL}
   };
   
  @@ -637,6 +651,8 @@
       new = (autoindex_config_rec *) apr_pcalloc(p, sizeof(autoindex_config_rec));
       new->default_icon = add->default_icon ? add->default_icon
                                             : base->default_icon;
  +    new->style_sheet = add->style_sheet ? add->style_sheet
  +                                          : base->style_sheet;
       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