";
return $result;
}
@@ -116,6 +116,8 @@ sub insertlist {
"
+ } else {
+ $result=" ";
}
}
return $result;
@@ -189,5 +191,37 @@ sub insert_startouttext {
return "\n\n";
}
+# Returns a 1 if the toekn has been modified and you should rebuild the tag
+# side-effects, will modify the $token if new values are found
+sub get_new_args {
+ my ($token,$parstack,$safeeval,@args)=@_;
+ my $rebuild=0;
+ foreach my $arg (@args) {
+ my $value=&Apache::lonxml::get_param($arg,$parstack,$safeeval);
+ my $newvalue=$ENV{"form.$Apache::lonxml::curdepth.$arg"};
+ &Apache::lonxml::debug(" for:$arg: cur is :$value: new is :$newvalue:");
+ if ($value ne $newvalue) {
+ $token->[2]->{$arg}=$newvalue;
+ $rebuild=1;
+ }
+ }
+ return $rebuild;
+}
+
+sub rebuild_tag {
+ my ($token) = @_;
+ my $result;
+ if ($token->[0] eq 'S') {
+ $result = '<'.$token->[1];
+ while (my ($key,$val)= each(%{$token->[2]})) {
+ &Apache::lonxml::debug("setting :$key: to :$val:");
+ $result.=' '.$key.'="'.$val.'"';
+ }
+ $result.=">";
+ } elsif ( $token->[0] eq 'E' ) {
+ $result = ''.$token->[1].'>';
+ }
+ return $result;
+}
1;
__END__