From 5672cee9642293b1460f354f066fec09d481405e Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Wed, 23 Feb 2011 16:44:56 -0600 Subject: [PATCH] remove cut and duplicate asset methods --- lib/WebGUI/AssetClipboard.pm | 93 ------------------------------------ 1 file changed, 93 deletions(-) diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm index 61a3e9a7a..71168381c 100644 --- a/lib/WebGUI/AssetClipboard.pm +++ b/lib/WebGUI/AssetClipboard.pm @@ -355,99 +355,6 @@ sub pasteInFork { $self->paste( $_->getId ) for @roots; } ## end sub pasteInFork - -#------------------------------------------------------------------- - -=head2 www_cut ( ) - -If the current user canEdit, it puts $self into the clipboard and calls www_view on it's container. -Otherwise returns AdminConsole rendered insufficient privilege. - -=cut - -sub www_cut { - my $self = shift; - return $self->session->privilege->insufficient() unless $self->canEdit; - return $self->session->privilege->vitalComponent - if $self->get('isSystem'); - $self->cut; - my $asset = $self->getContainer; - if ($self->getId eq $asset->getId) { - $asset = $self->getParent; - } - $self->session->asset($asset); - return $asset->www_view; - - -} - -#------------------------------------------------------------------- - -=head2 www_cutList ( ) - -Checks to see if the current user canEdit the parent containting the assets that -are being cut. If that's not true, or if the CSRF token is missing, then -return insufficient privileges. - -Cuts the list of assets in the C form variable, checking each one for edit privileges -and to see if it's a system asset. - -Returns the user to either the screen set by the C form variable, or to -the Asset Manager. - -=cut - -sub www_cutList { - my $self = shift; - my $session = $self->session; - return $session->privilege->insufficient() unless $self->canEdit && $session->form->validToken; - foreach my $assetId ($session->form->param("assetId")) { - my $asset = WebGUI::Asset->newById($session,$assetId); - if ($asset->canEdit && !$asset->get('isSystem')) { - $asset->cut; - } - } - if ($session->form->process("proceed") ne "") { - my $method = "www_".$session->form->process("proceed"); - return $self->$method(); - } - return $self->www_manageAssets(); -} - -#------------------------------------------------------------------- - -=head2 www_duplicateList ( ) - -Checks to see if the current user canEdit the parent containting the assets that -are being duplicated. If that's not true, or if the CSRF token is missing, then -return insufficient privileges. - -Duplicates (copy and paste immediately) the list of assets in the C -form variable, checking each one for edit privileges. - -Returns the user to either the screen set by the C form variable, or to -the Asset Manager. - -=cut - -sub www_duplicateList { - my $self = shift; - my $session = $self->session; - return $session->privilege->insufficient() unless $self->canEdit && $session->form->validToken; - foreach my $assetId ($session->form->param("assetId")) { - my $asset = WebGUI::Asset->newById($session,$assetId); - if ($asset->canEdit) { - my $newAsset = $asset->duplicate({skipAutoCommitWorkflows => 1}); - $newAsset->update({ title=>$newAsset->getTitle.' (copy)'}); - } - } - if ($session->form->process("proceed") ne "") { - my $method = "www_".$session->form->process("proceed"); - return $self->$method(); - } - return $self->www_manageAssets(); -} - #------------------------------------------------------------------- =head2 www_emptyClipboard ( )