From 9eadb2642a44b8be4b1613a5e6fe82d64cf89e40 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 27 Nov 2009 09:37:10 -0800 Subject: [PATCH] Make the message subclassable, too. --- lib/WebGUI/AssetHelper/Copy.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/AssetHelper/Copy.pm b/lib/WebGUI/AssetHelper/Copy.pm index 36c00aab6..a57182506 100644 --- a/lib/WebGUI/AssetHelper/Copy.pm +++ b/lib/WebGUI/AssetHelper/Copy.pm @@ -46,6 +46,18 @@ sub duplicate { #------------------------------------------------------------------- +=head2 getMessage ( ) + +Returns the name of the i18n message to use + +=cut + +sub getMessage { + return 'copied asset'; +} + +#------------------------------------------------------------------- + =head2 process ( $class, $asset ) Copies the asset to the clipboard. There are no privilege or safety checks, since all operations @@ -62,7 +74,7 @@ sub process { $newAsset->update({ title=>sprintf("%s (%s)",$asset->getTitle,$i18n->get('copy'))}); $newAsset->cut; - my $message = sprintf($i18n->get('copied asset'), $asset->getTitle); + my $message = sprintf($i18n->get($class->getMessage()), $asset->getTitle); my $payload = { message => $message,