Add copy with descendants.

This commit is contained in:
Colin Kuskie 2009-11-27 09:46:14 -08:00
parent 2ea377b87d
commit 39ffaba487
4 changed files with 143 additions and 2 deletions

View file

@ -34,8 +34,7 @@ These methods are available from this class:
=head2 duplicate ( $class, $asset )
Duplicates the asset. Extracted out so that it can be subclassed by copy with children,
and copy with descendants.
Duplicates the asset with children,
=cut

View file

@ -0,0 +1,58 @@
package WebGUI::AssetHelper::Copy::WithDescendants;
use strict;
use Class::C3;
use base qw/WebGUI::AssetHelper::Copy/;
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2009 Plain Black Corporation.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=head1 NAME
Package WebGUI::AssetHelper::Copy::WithDescendants
=head1 DESCRIPTION
Copy an Asset to the Clipboard, with all descendants.
=head1 METHODS
These methods are available from this class:
=cut
#-------------------------------------------------------------------
=head2 duplicate ( $class, $asset )
Duplicates the asset with descendants.
=cut
sub duplicate {
my ($class, $asset) = @_;
return $asset->duplicateBranch();
}
#-------------------------------------------------------------------
=head2 getMessage ( )
Returns the name of the i18n message to use
=cut
sub getMessage {
return 'copied asset with descendants';
}
1;

View file

@ -1388,6 +1388,12 @@ Couldn't open %-s because %-s <br />
context => q{%s will be replaced by the title of the asset.},
},
'copied asset with descendants' => {
message => q{Asset %s was copied to the clipboard with all descendants.},
lastUpdated => 0,
context => q{%s will be replaced by the title of the asset.},
},
};
1;