[mirrorbrain-commits] r7754 - trunk/mod_autoindex_mb

From: <poeml_at_mirrorbrain.org>
Date: Wed, 12 Aug 2009 02:40:15 +0200
Author: poeml
Date: Wed Aug 12 02:40:14 2009
New Revision: 7754
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?view=revision&revision=7754

Log:
mod_autoindex_mb:
- implement "Mirrors" and "Metalink" links for configurations with Apache's
  IndexOptions HTMLTable configured.

Modified:
   trunk/mod_autoindex_mb/mod_autoindex_mb.c

Modified: trunk/mod_autoindex_mb/mod_autoindex_mb.c
==============================================================================
--- trunk/mod_autoindex_mb/mod_autoindex_mb.c	Wed Aug 12 01:02:47 2009	(r7753)
+++ trunk/mod_autoindex_mb/mod_autoindex_mb.c	Wed Aug 12 02:40:14 2009	(r7754)
@@ -1616,6 +1616,14 @@
                       colargs, static_columns);
             ++cols;
         }
+        if (autoindex_opts & MIRRORLIST) {
+            ap_rputs("</th><th>Mirrors", r);
+            ++cols;
+        }
+        if (autoindex_opts & METALINK) {
+            ap_rputs("</th><th>Metalinks", r);
+            ++cols;
+        }
         if (!(autoindex_opts & SUPPRESS_RULES)) {
             breakrow = apr_psprintf(r->pool,
                                     "<tr><th colspan=\"%d\">"
@@ -1784,9 +1792,27 @@
                                                         desc_width), NULL);
                     }
                 }
+                else {
+                    ap_rputs("</td><td>&nbsp;", r);
+                }
             }
-            else {
-                ap_rputs("</td><td>&nbsp;", r);
+            if (autoindex_opts & MIRRORLIST) {
+                if (anchor[strlen(anchor)-1] != '/') { /* not for directories */
+                        ap_rvputs(r, " </td><td><a href=\"", anchor, 
+                                  "?mirrorlist\">Mirrors</a>", NULL);
+                }
+                else {
+                    ap_rputs("</td><td>&nbsp;", r);
+                }
+            }
+            if (autoindex_opts & METALINK) {
+                if (anchor[strlen(anchor)-1] != '/') { /* not for directories */
+                        ap_rvputs(r, " </td><td><a href=\"", anchor, 
+                                  ".metalink\">Metalink</a>", NULL);
+                }
+                else {
+                        ap_rputs("</td><td>&nbsp;", r);
+                }
             }
             ap_rputs("</td></tr>\n", r);
         }


_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Wed Aug 12 2009 - 00:40:16 GMT

This archive was generated by hypermail 2.2.0 : Wed Aug 12 2009 - 00:45:28 GMT