[Bps-public-commit] r17046 - RT-OnlineDocs/trunk/html/Developer/Perldoc

jesse at bestpractical.com jesse at bestpractical.com
Fri Nov 28 13:02:48 EST 2008


Author: jesse
Date: Fri Nov 28 13:02:48 2008
New Revision: 17046

Modified:
   RT-OnlineDocs/trunk/html/Developer/Perldoc/Body.html
   RT-OnlineDocs/trunk/html/Developer/Perldoc/TOC.html

Log:
RT-Ticket: 12853
RT-Status: resolved
RT-Update: correspond

* Updated RT::OnlineDocs with support for Plugins
    From: ruediger.riediger at sun.com

Modified: RT-OnlineDocs/trunk/html/Developer/Perldoc/Body.html
==============================================================================
--- RT-OnlineDocs/trunk/html/Developer/Perldoc/Body.html	(original)
+++ RT-OnlineDocs/trunk/html/Developer/Perldoc/Body.html	Fri Nov 28 13:02:48 2008
@@ -14,7 +14,8 @@
 <h3><a href="<% $RT::WebURL %>" target="_top">Return to RT</a></h3>
 <%PERL>
 my $dirname = File::Basename::dirname($INC{'RT.pm'});
-my $localdirname = File::Basename::dirname($INC{'RT.pm'})."/../local/lib/";
+my $localdirname = $dirname."/../local/lib/";
+my $plugindir = $dirname."/../local/plugins";
 $n =~ s/::/\//g;
 
 my $show;
@@ -27,6 +28,18 @@
     } elsif ( -r "$localdirname/$n.$ending" ) {
         $show = "$localdirname/$n";
         $suffix = $ending;
+    } else {
+	if(opendir(PLUGINS, $plugindir)) {
+	    while(defined(my $plugin = readdir(PLUGINS))) {
+		next if($plugin =~ /^\./);
+		if( -r $plugindir."/".$plugin."/lib/$n.$ending") {
+		    $show = $plugindir."/".$plugin."/lib/$n";
+		    $suffix = $ending;
+		    last;
+		}
+	    }
+	    closedir(PLUGINS);
+	}
     }
 
     last if $show;

Modified: RT-OnlineDocs/trunk/html/Developer/Perldoc/TOC.html
==============================================================================
--- RT-OnlineDocs/trunk/html/Developer/Perldoc/TOC.html	(original)
+++ RT-OnlineDocs/trunk/html/Developer/Perldoc/TOC.html	Fri Nov 28 13:02:48 2008
@@ -16,19 +16,28 @@
 
 my $dirname = File::Basename::dirname($INC{'RT.pm'});
 my $localdir = $dirname."/../local/lib";
+my $plugindir = $dirname."/../local/plugins";
+my @plugins = ();
+if(opendir(PLUGINS, $plugindir)) {
+    while(defined(my $plugin = readdir(PLUGINS))) {
+	next if($plugin =~ /^\./);
+	push(@plugins, $plugindir."/".$plugin."/lib");
+    }
+    closedir(PLUGINS);
+}
 my @found;
 File::Find::find(
     { untaint => 1,
       wanted => sub {
         return unless /(\w+)\.(?:pm|pod)$/;
-        return if $1 =~ /_(?:_Local|Vendor|Overlay)/;
+        return if $1 =~ /(?:perllocal|_(?:Local|Vendor|Overlay))/;
         my $name = $File::Find::name;
         $name =~ s/.*lib\b.//;
         $name =~ s!\.(?:pm|pod)!!i;
         $name =~ s!\W!::!g;
         push @found, $name;
     },follow => ($^O ne 'MSWin32') },
-    $dirname,$localdir
+    $dirname,$localdir, at plugins
 );
 my ($prev, $indent);
 foreach my $file (sort @found) {



More information about the Bps-public-commit mailing list