Changeset 1427 for branches/release-30/lib/MT/Template.pm
- Timestamp:
- 02/28/08 22:31:24 (21 months ago)
- Files:
-
- 1 modified
-
branches/release-30/lib/MT/Template.pm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-30/lib/MT/Template.pm
r1372 r1427 9 9 use strict; 10 10 use base qw( MT::Object ); 11 use MT::Util qw( weaken ); 11 12 12 13 use constant NODE => 'MT::Template::Node'; … … 143 144 require MT::Template::Context; 144 145 my $ctx = $tmpl->{context} ||= MT::Template::Context->new; 145 $ctx->stash('template',$tmpl);146 weaken($ctx->{__stash}{'template'} = $tmpl); 146 147 return $ctx; 147 148 } … … 616 617 my $tmpl = shift; 617 618 my ($tag, $attr) = @_; 618 return bless [ $tag, $attr, undef, undef, undef, undef, $tmpl ], NODE; 619 my $node = bless [ $tag, $attr, undef, undef, undef, undef, $tmpl ], NODE; 620 weaken($node->[6]); 621 return $node; 619 622 } 620 623 … … 622 625 my $tmpl = shift; 623 626 my ($text) = @_; 624 return bless [ 'TEXT', $text, undef, undef, undef, undef, $tmpl ], NODE; 627 my $node = bless [ 'TEXT', $text, undef, undef, undef, undef, $tmpl ], NODE; 628 weaken($node->[6]); 629 return $node; 625 630 } 626 631 … … 740 745 741 746 use strict; 747 use MT::Util qw( weaken ); 742 748 743 749 sub setAttribute { … … 823 829 my $node = shift; 824 830 $node->[5] = shift if @_; 831 weaken($node->[5]); 825 832 $node->[5]; 826 833 }
