bug fixes for widgets and exports. snippets were exported as index.html or the
like, and widget toolboxes weren't popping up in a widgetized view.
This commit is contained in:
parent
f5ad94c95e
commit
5dfc9e3bfc
8 changed files with 774 additions and 142 deletions
|
|
@ -107,6 +107,43 @@ sub definition {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 exportGetUrlAsPath ( index )
|
||||
|
||||
Translates a URL into an appropriate path and filename for exporting.
|
||||
Overridden here to return a filename corresponding to the URL of this asset
|
||||
as-is.
|
||||
|
||||
=head3 index
|
||||
|
||||
index filename passed from L</exportAsHtml>
|
||||
|
||||
=cut
|
||||
|
||||
sub exportGetUrlAsPath {
|
||||
my $self = shift;
|
||||
|
||||
# we don't use this, but get it anyway
|
||||
my $index = shift || 'index.html';
|
||||
|
||||
my $config = $self->session->config;
|
||||
|
||||
# make sure that the export path is valid
|
||||
WebGUI::Asset->exportCheckPath($self->session);
|
||||
|
||||
# if we're still here, it's valid. get it.
|
||||
my $exportPath = $config->get('exportPath');
|
||||
|
||||
# get the asset's URL as a URI::URL object for easy parsing of components
|
||||
my $url = URI::URL->new($config->get("sitename")->[0] . $self->getUrl);
|
||||
my @pathComponents = $url->path_components;
|
||||
shift @pathComponents; # first item is the empty string
|
||||
my $filename = pop @pathComponents;
|
||||
|
||||
# return a path with the filename part of the URL. No fancy twiddling needed.
|
||||
return Path::Class::File->new($exportPath, @pathComponents, $filename);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getToolbar ( )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue