[Bio] / FigKernelPackages / TemplateObject.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/TemplateObject.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Fri Jul 28 02:01:33 2006 UTC revision 1.3, Sun Jul 30 08:14:35 2006 UTC
# Line 160  Line 160 
160      }      }
161      # Now $template is either a null string (FALSE) or the name of the      # Now $template is either a null string (FALSE) or the name of the
162      # template (TRUE). We are ready to create the return object.      # template (TRUE). We are ready to create the return object.
163      my $retVal = { template => $template };      my $retVal = { template => $template,
164                       cgi => $cgi,
165                     };
166      # Next we add the object that will be accepting the HTML strings.      # Next we add the object that will be accepting the HTML strings.
167      if ($template) {      if ($template) {
168          $retVal->{varHash} = {};          $retVal->{varHash} = {};
# Line 252  Line 254 
254      }      }
255  }  }
256    
257    =head3 append
258    
259    C<< $to->append($name, $html); >>
260    
261    Append HTML to a named variable. Unlike L</add>, this method will not destroy a
262    variable's existing value; instead, it will concatenate the new data at the end of the
263    old.
264    
265    =over 4
266    
267    =item name
268    
269    Name of the variable to which the HTML text is to be appended.
270    
271    =item html
272    
273    HTML text to append.
274    
275    =back
276    
277    =cut
278    
279    sub append {
280        # Get the parameters.
281        my ($self, $name, $html) = @_;
282        # Check the mode.
283        if ($self->mode) {
284            # Template mode, so we check for the variable.
285            my $hash = $self->{varHash};
286            if (exists $hash->{$name}) {
287                $hash->{$name} .= $html;
288            } else {
289                $hash->{$name} = $html;
290            }
291        } else {
292            # Raw mode.
293            push @{$self->{html}}, $html;
294        }
295    }
296    
297  =head3 titles  =head3 titles
298    
299  C<< to->titles($parameters); >>  C<< to->titles($parameters); >>
# Line 307  Line 349 
349          $self->add(version =>          $self->add(version =>
350                     FigWebServices::SeedComponents::Framework::get_version({fig => $parameters->{fig_object},                     FigWebServices::SeedComponents::Framework::get_version({fig => $parameters->{fig_object},
351                                                                             fig_disk => $parameters->{fig_disk}}));                                                                             fig_disk => $parameters->{fig_disk}}));
352            # Next, the location tag.
353            $self->add(location_tag => $self->{cgi}->url());
354          # Finally the protein (if any).          # Finally the protein (if any).
355          if (exists $parameters->{peg_id}) {          if (exists $parameters->{peg_id}) {
356              $self->add(feature_id => $parameters->{peg_id});              $self->add(feature_id => $parameters->{peg_id});

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3