/[papo]/papo/neb/neb/Tree/Tag.pm
ViewVC logotype

Diff of /papo/neb/neb/Tree/Tag.pm

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

revision 1.6 by jlenton, Thu Apr 10 05:07:58 2003 UTC revision 1.7 by jlenton, Thu Apr 10 23:01:39 2003 UTC
# Line 12  sub init Line 12  sub init
12  {  {
13      my $self = shift;      my $self = shift;
14      my $name = shift;      my $name = shift;
15        my $location = shift;
16    
17      $self->name($name);      $self->name($name);
18      $self->{ATTRS} = {};      $self->attributes(@_);
19      $self->SUPER::init(@_);      $self->SUPER::init($location);
20      $DEBUG = $main::DEBUG;      $DEBUG = $main::DEBUG;
21  }  }
22    
# Line 50  sub attribute Line 51  sub attribute
51  sub attributes  sub attributes
52  {  {
53      my $self = shift;      my $self = shift;
54    
55        $self->{ATTRS} = {}
56            unless exists $self->{ATTRS};
57    
58      $self->{ATTRS} = { @_ }      $self->{ATTRS} = { @_ }
59          if (@_);          if (@_);
60    
61      return %{$self->{ATTRS}};      return %{$self->{ATTRS}};
62  }  }
63    
64    sub delete
65    {
66        my $self = shift;
67        my $attr = shift;
68    
69        return delete $self->{ATTRS}->{$attr};
70    }
71    
72  sub canonical  sub canonical
73  {  {
74      my $self = shift;      my $self = shift;
# Line 104  sub code_start Line 117  sub code_start
117      my %h = $self->attributes;      my %h = $self->attributes;
118      my $code = '';      my $code = '';
119    
120      $code .= "# Tag::code_start:\n\t" if ($DEBUG);      $code .= ' 'x60 . "### Tag::code_start (" . $self->url . ")\n" if ($DEBUG);
121      $code .= '$OUTPUT .= "<' . $self->name;      $code .= '$OUTPUT .= "<' . $self->name;
122    
123      foreach (sort $attr_sorter keys %h)      foreach (sort $attr_sorter keys %h)
# Line 119  sub code_start Line 132  sub code_start
132          }          }
133      }      }
134                                                        
135      $code .= ">\";";      $code .= ">\";\n";
     $code .= "\# Tag::code_start" if ($DEBUG);  
     $code .= "\n";  
136    
137      return $code;      return $code;
138  }  }
# Line 138  sub code_end Line 149  sub code_end
149      my $self = shift;      my $self = shift;
150      my $code = '';      my $code = '';
151    
     $code .= "# Tag::code_end\n\t" if ($DEBUG);  
152      $code .= sprintf ("\$OUTPUT .= \"%s\";\n", $self->canonical_end);      $code .= sprintf ("\$OUTPUT .= \"%s\";\n", $self->canonical_end);
153        $code .= ' 'x60 . "### Tag::code_end   (" . $self->url . ")\n" if ($DEBUG);
154    
155      return $code;      return $code;
156  }  }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26