[interchange-cvs] interchange - jon modified code/SystemTag/image.tag

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Wed Sep 10 10:10:00 EDT 2003


User:      jon
Date:      2003-09-10 13:10:00 GMT
Modified:  code/SystemTag image.tag
Log:
Add src_only option to return just the image location that normally goes
in the src="..." attribute of the <img> tag.

Revision  Changes    Path
1.5       +10 -2     interchange/code/SystemTag/image.tag


rev 1.5, prev_rev 1.4
Index: image.tag
===================================================================
RCS file: /var/cvs/interchange/code/SystemTag/image.tag,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -u -r1.4 -r1.5
--- image.tag	22 Jun 2003 14:21:35 -0000	1.4
+++ image.tag	10 Sep 2003 13:10:00 -0000	1.5
@@ -141,6 +141,11 @@
 Image filename to use. May also be a plain sku, or an image basename
 which will be tried with various image suffixes (.jpg, .gif, .png, etc.)
 
+=item src_only
+
+Return only the image source location that would normally go in the
+HTML src="..." attribute of the <img> tag.
+
 =item title
 
 Text to use for the <img title="..."> attribute, used by more recent
@@ -366,6 +371,11 @@
 		}
 	}
 
+	$image = $imagedircurrent . $image unless
+		$image =~ /$absurlre/ or substr($image, 0, 1) eq '/';
+
+	return $image if $opt->{src_only};
+
 	$opt->{title} = $opt->{alt} if ! defined $opt->{title} and $opt->{alt};
 
 	my $opts = '';
@@ -381,8 +391,6 @@
 	if($opt->{extra}) {
 		$opts .= " $opt->{extra}";
 	}
-	$image = $imagedircurrent . $image unless
-		$image =~ /$absurlre/ or substr($image, 0, 1) eq '/';
 	$image =~ s/"/&quot;/g;
 	return qq{<img src="$image"$opts>};
 }







More information about the interchange-cvs mailing list