Build bundle UI via edit bundle admin console.
This commit is contained in:
parent
6314228b59
commit
61c7c7a46e
2 changed files with 39 additions and 4 deletions
|
|
@ -135,6 +135,27 @@ sub www_addFile {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_buildBundle ( )
|
||||||
|
|
||||||
|
Builds a bundle, identified by the form variable, bundleId.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub www_buildBundle {
|
||||||
|
my $session = shift;
|
||||||
|
return $session->privilege->insufficient() unless canView($session);
|
||||||
|
my $bundle = WebGUI::FilePump::Bundle->new($session, $session->form->get("bundleId"));
|
||||||
|
return www_editBundle($session) unless $bundle;
|
||||||
|
my ($code, $error) = $bundle->build;
|
||||||
|
if ($error) {
|
||||||
|
my $i18n = WebGUI::International->new($session, 'FilePump');
|
||||||
|
$error = sprintf $i18n->get('build error'), $error;
|
||||||
|
}
|
||||||
|
return www_editBundle($session, $error);
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 www_deleteBundle ( )
|
=head2 www_deleteBundle ( )
|
||||||
|
|
||||||
Deletes a bundle, identified by the form variable, bundleId.
|
Deletes a bundle, identified by the form variable, bundleId.
|
||||||
|
|
@ -215,10 +236,12 @@ A reference to the current session.
|
||||||
sub www_editBundle {
|
sub www_editBundle {
|
||||||
my ($session, $error) = @_;
|
my ($session, $error) = @_;
|
||||||
return $session->privilege->insufficient() unless canView($session);
|
return $session->privilege->insufficient() unless canView($session);
|
||||||
my $bundle = WebGUI::FilePump::Bundle->new($session, $session->form->get("bundleId"));
|
my $bundleId = $session->form->get("bundleId");
|
||||||
|
my $bundle = WebGUI::FilePump::Bundle->new($session, $bundleId);
|
||||||
|
return www_addBundle($session) unless $bundle;
|
||||||
my $i18n = WebGUI::International->new($session, 'FilePump');
|
my $i18n = WebGUI::International->new($session, 'FilePump');
|
||||||
if (!defined $bundle) {
|
if ($error) {
|
||||||
return www_addBundle($session);
|
$error = qq|<div class="error">$error</div>\n|;
|
||||||
}
|
}
|
||||||
my $tableStub = <<EOTABLE;
|
my $tableStub = <<EOTABLE;
|
||||||
<h2>%s</h2>
|
<h2>%s</h2>
|
||||||
|
|
@ -229,7 +252,6 @@ sub www_editBundle {
|
||||||
<p>%s</p>
|
<p>%s</p>
|
||||||
EOTABLE
|
EOTABLE
|
||||||
my $output = '';
|
my $output = '';
|
||||||
my $bundleId = $bundle->getId;
|
|
||||||
my $dt = $session->datetime;
|
my $dt = $session->datetime;
|
||||||
my $url = $session->url;
|
my $url = $session->url;
|
||||||
my $lastModifiedi18n = $i18n->get('last modified');
|
my $lastModifiedi18n = $i18n->get('last modified');
|
||||||
|
|
@ -265,6 +287,7 @@ EOTABLE
|
||||||
my $ac = WebGUI::AdminConsole->new($session,'filePump');
|
my $ac = WebGUI::AdminConsole->new($session,'filePump');
|
||||||
$ac->addSubmenuItem($session->url->page('op=filePump;'), $i18n->get('list bundles'));
|
$ac->addSubmenuItem($session->url->page('op=filePump;'), $i18n->get('list bundles'));
|
||||||
$ac->addSubmenuItem($session->url->page('op=filePump;func=addBundle'), $i18n->get('add a bundle'));
|
$ac->addSubmenuItem($session->url->page('op=filePump;func=addBundle'), $i18n->get('add a bundle'));
|
||||||
|
$ac->addSubmenuItem($session->url->page('op=filePump;func=buildBundle;bundleId='.$bundleId), $i18n->get('build this bundle'));
|
||||||
return $ac->render($error.$output, 'File Pump');
|
return $ac->render($error.$output, 'File Pump');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,18 @@ our $I18N = {
|
||||||
context => q|Edit bundle label.|
|
context => q|Edit bundle label.|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'build this bundle' => {
|
||||||
|
message => q|Build this bundle|,
|
||||||
|
lastUpdated => 1242495011,
|
||||||
|
context => q|Edit bundle label.|
|
||||||
|
},
|
||||||
|
|
||||||
|
'build error' => {
|
||||||
|
message => q|Problem fetching this URI: %s|,
|
||||||
|
lastUpdated => 1242495011,
|
||||||
|
context => q|Edit bundle error label.|
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue