From f0cd4ebbd531ae640ae57d84e5d3a4c03bc73030 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Wed, 20 Apr 2011 18:29:41 -0500 Subject: [PATCH] add unarchiveall asset helper for collabs --- lib/WebGUI/Asset/Wobject/Collaboration.pm | 41 ++++++++++++----------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 99d3a169b..8c1ce322b 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -957,6 +957,28 @@ sub duplicateBranch { return $newAsset; } +#---------------------------------------------------------------------------- + +=head2 getHelpers ( ) + +Add the collaboration-specific asset helpers + +=cut + +override getHelpers => sub { + my ( $self ) = @_; + my $helpers = super(); + + my $i18n = WebGUI::International->new($self->session, 'Asset_Collaboration'); + $helpers->{ unarchiveAll } = { + label => $i18n->get("unarchive all"), + url => $self->getUrl( 'func=unarchiveAll' ), + confirm => $i18n->get("unarchive confirm"), + }; + + return $helpers; +}; + #------------------------------------------------------------------- =head2 getNewThreadUrl( ) @@ -1595,25 +1617,6 @@ sub view { #------------------------------------------------------------------- -=head2 www_edit - -Override the master class to add an "Unarchive All" link. - -=cut - -sub www_edit { - my $self = shift; - return $self->session->privilege->insufficient() unless $self->canEdit; - return $self->session->privilege->locked() unless $self->canEditIfLocked; - my $i18n = WebGUI::International->new($self->session, 'Asset_Collaboration'); - # Unarchive All needs to be an asset helper - #$self->getAdminConsole->addConfirmedSubmenuItem($self->getUrl('func=unarchiveAll'),$i18n->get("unarchive all"),$i18n->get("unarchive confirm")); - #return $self->getAdminConsole->render($self->getEditForm->toHtml,$i18n->get("assetName")); - super(); -} - -#------------------------------------------------------------------- - =head2 www_search ( ) The web method to display and use the forum search interface.