[interchange] Added path_only attribute to the [area] tag

Jon Jensen interchange-cvs at icdevgroup.org
Wed Apr 7 20:40:53 UTC 2010


commit 7aa66b0038137e9f578d5077a1e0ffea504321fb
Author: Jon Jensen <jon at endpoint.com>
Date:   Wed Apr 7 14:39:15 2010 -0600

    Added path_only attribute to the [area] tag
    
    This returns the URL without the leading protocol.
    
    Written by David Christensen <david at endpoint.com> on 2008-12-30.

 lib/Vend/Util.pm |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/lib/Vend/Util.pm b/lib/Vend/Util.pm
index 646a119..ecbafba 100644
--- a/lib/Vend/Util.pm
+++ b/lib/Vend/Util.pm
@@ -1316,6 +1316,11 @@ sub vendUrl {
 		$opt->{anchor} =~ s/^#//;
 		$r .= '#' . $opt->{anchor};
 	}
+
+	# return full-path portion of the URL
+	if ($opt->{path_only}) {
+		$r =~ s!^https?://[^/]*!!i;
+	}
 	return $r;
 } 
 



More information about the interchange-cvs mailing list