85 |
|
|
86 |
my @status; |
my @status; |
87 |
|
|
88 |
push @status, { $self->editor( $class ) => $self->params } if $o->can('status'); |
push @status, { $self->editor( $class ) => $self->params }; |
89 |
|
|
90 |
if ( $self->run eq 'as_markup' && ! $o->can('page') ) { |
if ( $self->run eq 'as_markup' && ! $o->can('page') ) { |
91 |
warn "## using ",ref($o), "->as_markup"; |
warn "## using ",ref($o), "->as_markup"; |
119 |
$body .= Frey::View::Dumper->new( data => $data )->as_markup if defined $data; |
$body .= Frey::View::Dumper->new( data => $data )->as_markup if defined $data; |
120 |
} |
} |
121 |
|
|
122 |
if ( $self->run eq 'as_markup' && $o->can('page') ) { |
warn "## status from $self ",dump(@status); |
123 |
|
|
124 |
|
if ( $o->can('add_status') ) { |
125 |
$o->add_status($_) foreach @status; |
$o->add_status($_) foreach @status; |
|
$html = $o->page if $o->can('page') && |
|
|
warn "got ", length($html), "for page"; |
|
126 |
} |
} |
127 |
|
|
128 |
$self->add_status($_) foreach @status; |
if ( $self->run eq 'as_markup' && $o->can('page') ) { |
129 |
|
$html = $o->page; |
130 |
|
warn "got ", length($html), " for page from $o it's status is ", dump( $o->status ); |
131 |
|
} else { |
132 |
|
$self->add_status($_) foreach @status; |
133 |
|
} |
134 |
}; |
}; |
135 |
|
|
136 |
if ( ref($body) eq 'HASH' ) { |
if ( ref($body) eq 'HASH' ) { |
137 |
$html = $self->page( %$body ); |
$html = $self->page( %$body ); |
138 |
warn "WARNING: old calling method which is depriciated"; |
warn "WARNING: old calling convention with HASH which is depriciated but produced ", length($html), " bytes"; |
139 |
} elsif ( $body && ! $html ) { |
} elsif ( $body && ! $html ) { |
140 |
$html = $self->page( title => $self->class . ' run', body => $body ); |
$html = $self->page( title => $self->class . ' run', body => $body ); |
141 |
|
warn "wrap body of ",length($body), " in page with ", length($html), " bytes"; |
142 |
}; |
}; |
143 |
}; |
}; |
144 |
|
|
145 |
|
$self->status_parts; |
146 |
|
|
147 |
$html = $self->page( title => $self->class, body => $self->error( $@ ) ) if $@; |
$html = $self->page( title => $self->class, body => $self->error( $@ ) ) if $@; |
148 |
|
|
149 |
return $html; |
return $html; |