98 |
# -2 if the template didn't succeed finding the mathing atom ($index was -1), |
# -2 if the template didn't succeed finding the mathing atom ($index was -1), |
99 |
# -3 if there is an error setting the values in the atom |
# -3 if there is an error setting the values in the atom |
100 |
sub editAtom { |
sub editAtom { |
101 |
my ($out, $_index, $_ref__args) = @_; |
my ($out, $index, $ref_args) = @_; |
102 |
|
my %args=%$ref_args; |
103 |
eval($templates{$out->{template_name}}{edit_atom}); |
eval($templates{$out->{template_name}}{edit_atom}); |
104 |
$@ and die $@; |
$@ and die $@; |
105 |
# validate($out, @{$out->{atoms}}[$index]); |
# validate($out, @{$out->{atoms}}[$index]); |
111 |
} |
} |
112 |
|
|
113 |
sub findAtomPos { |
sub findAtomPos { |
114 |
my ($out, $_ref_args, $_first_atom, $_last_atom) = @_; |
my ($out, $ref_args, $_first_atom, $_last_atom) = @_; |
115 |
|
my %args=%$ref_args; |
116 |
eval($templates{$out->{template_name}}{find_atom_pos}); |
eval($templates{$out->{template_name}}{find_atom_pos}); |
117 |
} |
} |
118 |
|
|
119 |
sub appendAtom { |
sub appendAtom { |
120 |
my ($out, $_ref_args) = @_; |
my ($out, $ref_args) = @_; |
121 |
|
my %args = %$ref_args; |
122 |
|
my $index = @{$out->{atoms}}; |
123 |
push(@{$out->{atoms}}, {}); |
push(@{$out->{atoms}}, {}); |
124 |
eval($templates{$out->{template_name}}{edit_atom}); |
eval($templates{$out->{template_name}}{edit_atom}); |
125 |
# validate($out, @{$out->{atoms}}[$index]); |
# validate($out, @{$out->{atoms}}[$index]); |