# Copyright 2007 Interchange Development Group and others # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. See the LICENSE file for details. UserTag local Order scratch UserTag local attrAlias scratches scratch UserTag local attrAlias value values UserTag local posNumber 1 UserTag local hasEndTag UserTag local addAttr UserTag local Description Tag to localize scratch and/or values for block UserTag local Routine <{extra}; for my $top (qw/ values scratch /, @extra) { exists $Vend::Session->{$top} or do { $delete_top{$top} = 1; next; }; my $v = $Vend::Session->{$top}; unless (ref($v) eq 'HASH') { if(! ref $v) { $settings{$top} = $v; } else { $settings{$top} = dclone($v); } next; } my @values = Text::ParseWords::shellwords($opt->{$top}); for(@values) { if( ! exists $v->{$_}) { $delete{$top}{$_} = 1; } elsif(! ref $v->{$_}) { $settings{$top}{$_} = $v->{$_}; } else { $settings{$top}{$_} = dclone($v->{$_}); } } } my $result = interpolate_html($body); for my $top (qw/ values scratch /, @extra) { if(my $d = $delete_top{$top}) { delete $Vend::Session->{$top}; next; } unless (ref($settings{$top}) eq 'HASH') { $Vend::Session->{$top} = $settings{$top}; next; } my $s = $settings{$top}; my $d = $delete{$top}; my $v = $Vend::Session->{$top}; for(keys %$d) { delete $v->{$_}; } for(keys %$s) { $v->{$_} = $settings{$top}{$_}; } } return $result; } EOR UserTag local Documentation <