X-Git-Url: https://git.p6c8.net/devedit.git/blobdiff_plain/5a4bc87c675dd76627a0d413707139f2e0530eea..03d83644ce2d958fe3e0466fa272c67f0566f4ab:/modules/Tool.pm

diff --git a/modules/Tool.pm b/modules/Tool.pm
index fc1b3b4..0b15f90 100644
--- a/modules/Tool.pm
+++ b/modules/Tool.pm
@@ -6,7 +6,7 @@ package Tool;
 # Some shared sub routines
 #
 # Author:        Patrick Canterino <patshaping@gmx.net>
-# Last modified: 2003-12-02
+# Last modified: 2004-02-03
 #
 
 use strict;
@@ -24,6 +24,7 @@ use base qw(Exporter);
 @EXPORT = qw(check_path
              clean_path
              devedit_reload
+             equal_url
              file_name
              upper_path);
 
@@ -125,6 +126,28 @@ sub devedit_reload($)
  return \$header;
 }
 
+# equal_url()
+#
+# Create URL equal to a file or directory
+#
+# Params: 1. HTTP root
+#         2. Relative path
+#
+# Return: Formatted link (String)
+
+sub equal_url($$)
+{
+ my ($root,$path) = @_;
+ my $url;
+
+ $root =~ s!/$!!;
+ $path =~ s!^/!!;
+ $url  =  $root."/".$path;
+ #$url  =  encode_entities($url);
+
+ return $url;
+}
+
 # file_name()
 #
 # Returns the last path of a path