Mercurial > pub > Impl
changeset 394:2c14f66efa08
minor changes
author | cin |
---|---|
date | Tue, 18 Feb 2014 18:17:20 +0400 |
parents | 69a1f1508696 |
children | 212cc86e470b |
files | Lib/IMPL/Web/Application/ResourceBase.pm Lib/IMPL/Web/View/TTContext.pm |
diffstat | 2 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application/ResourceBase.pm Fri Feb 14 16:41:12 2014 +0400 +++ b/Lib/IMPL/Web/Application/ResourceBase.pm Tue Feb 18 18:17:20 2014 +0400 @@ -36,9 +36,9 @@ unless $args{request}; $this->request( $args{request} ); - $this->parent( $args{parent} ); - $this->model( $args{model} ); - $this->id( $args{id} ); + $this->parent( $args{parent} ) if $args{parent}; + $this->model( $args{model} ) if $args{model}; + $this->id( $args{id} ) if $args{id}; $this->application( $args{request}->application ); # если расположение явно не указано, то оно вычисляется автоматически, @@ -87,6 +87,10 @@ shift->request->security } +sub context { + shift->request->context +} + sub verbs { {} # возвращаем пстой список операций }
--- a/Lib/IMPL/Web/View/TTContext.pm Fri Feb 14 16:41:12 2014 +0400 +++ b/Lib/IMPL/Web/View/TTContext.pm Tue Feb 18 18:17:20 2014 +0400 @@ -98,6 +98,8 @@ my $ext = $this->tt_ext || ""; + #warn "find: $name"; + my $file; foreach my $dir (@inc) { @@ -111,6 +113,8 @@ $file = $ext ? "$file.$ext" : $file; + #warn " file: $file"; + if (exists($this->modules->{$file})) { my $info = $this->modules->{$file}; return $cache->{$name} = $info @@ -298,7 +302,7 @@ initialized => 1 }; } - + return $this->invoke_environment( sub { my $ctx = shift;