rewrote the template api and added lots of caching options
This commit is contained in:
parent
6613992f3d
commit
20482def49
24 changed files with 252 additions and 100 deletions
|
|
@ -66,6 +66,7 @@ Package to manipulate WebGUI Attachments.
|
|||
|
||||
$filename = $attachment->save("formImage");
|
||||
$filename = $attachment->saveFromFilesystem($pathToFile);
|
||||
$filename = $attachment->saveFromScalar($content);
|
||||
|
||||
$filename = $attachment->saveFromHashref($hashRef);
|
||||
$hashRef = $attachment->getHashref;
|
||||
|
|
@ -681,6 +682,32 @@ sub saveFromHashref {
|
|||
return $self->getFilename;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 saveFromScalar ( scalar )
|
||||
|
||||
Stores a scalar as a text attachment.
|
||||
|
||||
=over
|
||||
|
||||
=item scalar
|
||||
|
||||
A scalar variable containing the content to write to the filesystem.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub saveFromScalar {
|
||||
my ($self, $content) = @_;
|
||||
$self->getNode->create();
|
||||
open(FILE,">".$self->getPath);
|
||||
print FILE $content;
|
||||
close(FILE);
|
||||
return $self->getFilename;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue