package WebGUI::AssetHelper::Revisions; use strict; use Class::C3; use base qw/WebGUI::AssetHelper/; use WebGUI::User; use WebGUI::HTML; =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::Revisions =head1 DESCRIPTION Displays the revisions for this asset. =head1 METHODS These methods are available from this class: =cut #------------------------------------------------------------------- =head2 process ( $class, $asset ) Opens a new tab for displaying revisions of this asset. =cut sub process { my ($class, $asset) = @_; my $session = $asset->session; my $i18n = WebGUI::International->new($session, "Asset"); if (! $asset->canEdit) { return { error => $i18n->get('38', 'WebGUI'), } } return { open_tab => $asset->getUrl('op=assetHelper;className=WebGUI::AssetHelper::Revisions;func=manageRevisions'), }; } #------------------------------------------------------------------- =head2 www_manageRevisions ( $class, $asset ) Displays a table of revision data for this asset, along with links to edit each revision, view it, or delete it. =cut sub www_manageRevisions { my ($class, $asset) = @_; my $session = $asset->session; my $i18n = WebGUI::International->new($session, "Asset"); if (! $asset->canEdit) { return { error => $i18n->get('38', 'WebGUI'), } } my $output = sprintf qq{
| %s | %s | %s |
|---|