Mercurial > pub > Impl
comparison Lib/IMPL/Web/TT/Collection.pm @ 194:4d0e1962161c
Replaced tabs with spaces
IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
author | cin |
---|---|
date | Tue, 10 Apr 2012 20:08:29 +0400 |
parents | d1676be8afcc |
children |
comparison
equal
deleted
inserted
replaced
193:8e8401c0aea4 | 194:4d0e1962161c |
---|---|
5 | 5 |
6 __PACKAGE__->PassThroughArgs; | 6 __PACKAGE__->PassThroughArgs; |
7 | 7 |
8 our $AUTOLOAD; | 8 our $AUTOLOAD; |
9 sub AUTOLOAD { | 9 sub AUTOLOAD { |
10 my $this = shift; | 10 my $this = shift; |
11 my ($method) = ($AUTOLOAD =~ /(\w+)$/); | 11 my ($method) = ($AUTOLOAD =~ /(\w+)$/); |
12 | 12 |
13 return if $method eq 'DESTROY'; | 13 return if $method eq 'DESTROY'; |
14 | 14 |
15 if ( @_ >= 1 ) { | 15 if ( @_ >= 1 ) { |
16 # set | 16 # set |
17 | 17 |
18 if ($method =~ /^add(\w+)/) { | 18 if ($method =~ /^add(\w+)/) { |
19 my ($name,$args) = @_; | 19 my ($name,$args) = @_; |
20 return $this->appendChild($this->document->CreateControl($name,$1,$args)); | 20 return $this->appendChild($this->document->CreateControl($name,$1,$args)); |
21 } | 21 } |
22 | 22 |
23 # we can't assing a node, so this is a dynamic property | 23 # we can't assing a node, so this is a dynamic property |
24 return $this->nodeProperty($method,@_); | 24 return $this->nodeProperty($method,@_); |
25 } else { | 25 } else { |
26 # get | 26 # get |
27 # try a dynamic property first | 27 # try a dynamic property first |
28 if ( my $val = $this->nodeProperty($method) ) { | 28 if ( my $val = $this->nodeProperty($method) ) { |
29 return $val; | 29 return $val; |
30 } else { | 30 } else { |
31 # and return a first child node as last opportunity | 31 # and return a first child node as last opportunity |
32 my @result = $this->selectNodes($method); | 32 my @result = $this->selectNodes($method); |
33 | 33 |
34 return $result[0] if @result; | 34 return $result[0] if @result; |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 return; | 38 return; |
39 } | 39 } |
40 | 40 |
41 1; | 41 1; |