On 29.12.2009 03:18, rbo...@apache.org wrote:
> Author: rbowen
> Date: Tue Dec 29 02:18:55 2009
> New Revision: 894298
>
> URL: http://svn.apache.org/viewvc?rev=894298&view=rev
> Log:
> Adds alternating CSS classes to table rows for trendy striped table
> support.
>
> Modified:
> httpd/httpd/trunk/docs/manual/mod/mod_autoindex.html.en
> httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml
> httpd/httpd/trunk/modules/generators/mod_autoindex.c
>
> Modified: httpd/httpd/trunk/docs/manual/mod/mod_autoindex.html.en
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_autoindex.html.en?rev=894298&r1=894297&r2=894298&view=diff
> ==
> --- httpd/httpd/trunk/docs/manual/mod/mod_autoindex.html.en (original)
> +++ httpd/httpd/trunk/docs/manual/mod/mod_autoindex.html.en Tue Dec 29
> 02:18:55 2009
> @@ -900,6 +900,12 @@
>IndexStyleSheet "/css/style.css"
>
>
> +Using this directive in conjunction with IndexOptions
> +HTMLTable also adds ai-tr-odd and
> +ai-tr-even class declarations to alternating rows of
> +the directory listing table, so that you can style alternate rows of
> +the table differently.
> +
>
> src="../images/up.gif" />
> id="ReadmeName">ReadmeName id="readmename">Directive
>
> 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=894298&r1=894297&r2=894298&view=diff
> ==
> --- httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml (original)
> +++ httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml Tue Dec 29 02:18:55
> 2009
> @@ -934,6 +934,12 @@
>Example
>IndexStyleSheet "/css/style.css"
>
> +
> +Using this directive in conjunction with IndexOptions
> +HTMLTable also adds ai-tr-odd and
> +ai-tr-even class declarations to alternating rows of
> +the directory listing table, so that you can style alternate rows of
> +the table differently.
>
>
>
>
> Modified: httpd/httpd/trunk/modules/generators/mod_autoindex.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_autoindex.c?rev=894298&r1=894297&r2=894298&view=diff
> ==
> --- httpd/httpd/trunk/modules/generators/mod_autoindex.c (original)
> +++ httpd/httpd/trunk/modules/generators/mod_autoindex.c Tue Dec 29 02:18:55
> 2009
> @@ -1482,6 +1482,7 @@
> char direction, const char *colargs)
> {
> int x;
> +int row_count;
> apr_size_t rv;
> char *name = r->uri;
> char *tp;
> @@ -1658,7 +1659,23 @@
> }
>
> if (autoindex_opts & TABLE_INDEXING) {
> -ap_rputs("", r);
> +ap_rputs(" +
> +/* Even/Odd rows for IndexStyleSheet */
> +if (d->style_sheet != NULL) {
> +ap_rputs(" class=\"", r);
> +if ( row_count % 2 == 0 ) {
> +ap_rputs("ai_tr_even", r);
> +}
> +else {
> +ap_rputs("ai_tr_odd", r);
> +}
> +ap_rputs("\"", r);
> +row_count++;
> +}
> +
> +ap_rputs(">", r);
> +
> if (!(autoindex_opts & SUPPRESS_ICON)) {
> ap_rputs("", r);
> if (autoindex_opts & ICONS_ARE_LINKS) {
>
>
>
Please inititialize row_count to 0 to avoid compiler warnings.
Regards
RĂ¼diger