merged with SVN HEAD
This commit is contained in:
commit
5222ad6be1
74 changed files with 10757 additions and 434 deletions
|
|
@ -14,6 +14,8 @@ package WebGUI::Asset;
|
|||
|
||||
=cut
|
||||
|
||||
use Carp qw( croak confess );
|
||||
|
||||
use WebGUI::AssetBranch;
|
||||
use WebGUI::AssetClipboard;
|
||||
use WebGUI::AssetExportHtml;
|
||||
|
|
@ -1337,12 +1339,12 @@ Loads an asset module if it's not already in memory. This is a class method. Ret
|
|||
|
||||
sub loadModule {
|
||||
my ($class, $session, $className) = @_;
|
||||
(my $module = $className . '.pm') =~ s{::|'}{/}g;
|
||||
(my $module = $className . '.pm') =~ s{::|'}{/}g;
|
||||
if (eval { require $module; 1 }) {
|
||||
return $className;
|
||||
}
|
||||
$session->errorHandler->error("Couldn't compile asset package: ".$className.". Root cause: ".$@);
|
||||
return;
|
||||
$session->errorHandler->error("Couldn't compile asset package: ".$className.". Root cause: ".$@);
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -1753,6 +1755,7 @@ A specific revision date for the asset to retrieve. If not specified, the most r
|
|||
sub newByDynamicClass {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
confess "newByDynamicClass requires WebGUI::Session" unless $session;
|
||||
my $assetId = shift;
|
||||
my $revisionDate = shift;
|
||||
return unless defined $assetId;
|
||||
|
|
@ -1896,6 +1899,7 @@ sub processPropertiesFromFormPost {
|
|||
$self->session->db->beginTransaction;
|
||||
$self->update(\%data);
|
||||
$self->session->db->commit;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1984,6 +1988,16 @@ sub publish {
|
|||
$cache->deleteChunk(["asset",$id]);
|
||||
}
|
||||
$self->{_properties}{state} = "published";
|
||||
|
||||
# Also publish any shortcuts to this asset that are in the trash
|
||||
my $shortcuts
|
||||
= WebGUI::Asset::Shortcut->getShortcutsForAssetId($self->session, $self->getId, {
|
||||
returnObjects => 1,
|
||||
statesToInclude => ['trash','trash-limbo'],
|
||||
});
|
||||
for my $shortcut ( @$shortcuts ) {
|
||||
$shortcut->publish;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2073,6 +2087,9 @@ Updates the properties of an existing revision. If you want to create a new revi
|
|||
|
||||
Hash reference of properties and values to set.
|
||||
|
||||
NOTE: C<keywords> is a special property that uses the WebGUI::Keyword API
|
||||
to set the keywords for this asset.
|
||||
|
||||
=cut
|
||||
|
||||
sub update {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue