1 # Copyright 2004-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: values_space.tag,v 1.5 2007-03-30 23:40:57 pajamian Exp $
10 UserTag values-space Order name
11 UserTag values-space addAttr
12 UserTag values-space Version $Revision: 1.5 $
13 UserTag values-space Routine <<EOR
15 my ($name, $opt) = @_;
16 return $Vend::ValuesSpace unless defined $name;
18 my $old_name = $Vend::ValuesSpace;
20 if ($old_name eq '') {
21 $old_ref = $Vend::Session->{values};
24 $old_ref = $Vend::Session->{values_repository}{$old_name} ||= {};
28 $::Values = $Vend::Session->{values};
31 $::Values = $Vend::Session->{values_repository}{$name} ||= {};
33 $Vend::ValuesSpace = $name;
35 %$::Values = () if $opt->{clear};
38 if ($opt->{copy_all}) {
39 @copy = keys %$old_ref;
41 elsif ($opt->{copy}) {
42 @copy = grep /\S/, split / /, $opt->{copy};
44 $::Values->{$_} = $old_ref->{$_} for @copy;
46 #Debug("changed values space from $old_name to $name; new contents:\n" . ::uneval($::Values));
47 return $opt->{show} ? $old_name : '';