Assorted away-tpope updates
[tpope-extra.git] / drupal / modules / cvsfilter.module
1 <?php
2 // $Id$
3 // -*- php -*- vim: ft=php
4
5 function cvsfilter_help($section) {
6   switch ($section) {
7     case 'admin/modules#description':
8     case 'admin/system/modules#description':
9       return t("Automatically points cvs: style URLs at the appropriate location.");
10       break;
11   }
12 }
13
14 function cvsfilter_filter($op, $delta = 0, $format = -1, $text = "") {
15   switch ($op) {
16     case "name":
17       return t("CVS Filter");
18     case "list":
19       return array(0 => t("CVS Filter"));
20     case 'description':
21       return cvsfilter_help('admin/modules#description');
22     case "settings":
23       return form_group(t("URL Filter"), t("CVS Filter is enabled.  This means that cvs: style URLs will automatically be pointed at the appropriate location."));
24     case "process":
25       $text = preg_replace("/<a href=\"cvs:\/\/([^\"\/]*)\/?([^\"]*)\">/i", '<a href="http://www.sexygeek.us/cgi-bin/cvsweb/\2?cvsroot=\1">', $text);
26       $text = preg_replace("/<a href=\"cvs:([^\"]*)\">/i", '<a href="http://www.sexygeek.us/cgi-bin/cvsweb/\1?cvsroot=tpope">', $text);
27       return $text;
28     default:
29       return $text;
30   }
31   return $text;
32 }
33
34
35 ?>