[interchange-cvs] interchange - jon modified code/UserTag/history_scan.tag

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Mon Feb 3 08:37:01 2003


User:      jon
Date:      2003-02-03 13:36:52 GMT
Modified:  code/UserTag history_scan.tag
Log:
Handle 'default' option correctly when 'pageonly' option is given.

Clean up POD a bit.

Revision  Changes    Path
1.10      +20 -15    interchange/code/UserTag/history_scan.tag


rev 1.10, prev_rev 1.9
Index: history_scan.tag
===================================================================
RCS file: /var/cvs/interchange/code/UserTag/history_scan.tag,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -u -r1.9 -r1.10
--- history_scan.tag	2 Feb 2003 16:28:15 -0000	1.9
+++ history_scan.tag	3 Feb 2003 13:36:51 -0000	1.10
@@ -11,16 +11,18 @@
 visited page.
 
 Options:
+
 	default=      Page to return if nothing else matches
 	exclude=      A RegEx of page names to skip
 	pageonly=1    Return just the name of a page, not a link to it.
 	count=#N      Skip the #N most recently visited pages
-	var_exclude   A list of parameters that should NOT be included in the 
-			   links returned.
+	var_exclude   A list of parameters that should NOT be included in the
+	              links returned.
 
 Examples:
 
-A continue shopping button from an email by Jeff Dafoe
+A continue shopping button from an email by Jeff Dafoe:
+
 	[button
 	  text="Continue shopping"
 	  src="__THEME_IMG_DIR__/continueshopping.gif"
@@ -33,18 +35,18 @@
 	[/button]
 
 
-A simple login form that returns to the calling page when login was successful.
+A simple login form that returns to the calling page when login was successful:
+
 	<FORM ACTION="[process secure=1]" METHOD=POST>
-	<INPUT TYPE=hidden   NAME=mv_todo  	VALUE=return>
-	<INPUT TYPE=hidden   NAME=mv_click 	VALUE=Login>
-	<INPUT TYPE=hidden   NAME=mv_failpage 	VALUE="login">
-	<INPUT TYPE=hidden   NAME=mv_successpage 
-		VALUE="[history-scan exclude="^/ord|^/multi/|^/process|^/login|^/logout" pageonly=1]">   
-	<INPUT TYPE=hidden   NAME=mv_nextpage 	VALUE="index">
-	<INPUT TYPE=hidden   NAME=mv_session_id VALUE="[data session id]">
-	<INPUT TYPE=text     NAME=mv_username 	VALUE="[read-cookie MV_USERNAME]">
-	<INPUT TYPE=password NAME=mv_password 	VALUE="">
-	<INPUT TYPE=submit   NAME=submit	VALUE="Log In">
+	<INPUT TYPE=hidden   NAME=mv_todo        VALUE=return>
+	<INPUT TYPE=hidden   NAME=mv_click       VALUE=Login>
+	<INPUT TYPE=hidden   NAME=mv_failpage    VALUE="login">
+	<INPUT TYPE=hidden   NAME=mv_successpage VALUE="[history-scan exclude="^/ord|^/multi/|^/process|^/login|^/logout" pageonly=1]">
+	<INPUT TYPE=hidden   NAME=mv_nextpage    VALUE="index">
+	<INPUT TYPE=hidden   NAME=mv_session_id  VALUE="[data session id]">
+	<INPUT TYPE=text     NAME=mv_username    VALUE="[read-cookie MV_USERNAME]">
+	<INPUT TYPE=password NAME=mv_password    VALUE="">
+	<INPUT TYPE=submit   NAME=submit         VALUE="Log In">
 	</FORM>
 
 
@@ -81,7 +83,10 @@
 		($href, $cgi) = @{$ref->[$i]};
 		last;
 	}
-	return $Tag->area($default) if ! $href;
+	unless ($href) {
+		return $default if $opt->{pageonly};
+		return $Tag->area($default);
+	}
 	$href =~ s|/+|/|g;
 	if ($opt->{pageonly}) {
 		$href =~ s|^/||;