summaryrefslogtreecommitdiff
path: root/nzbget/pre_enqueue.pm
diff options
context:
space:
mode:
Diffstat (limited to 'nzbget/pre_enqueue.pm')
-rw-r--r--nzbget/pre_enqueue.pm36
1 files changed, 36 insertions, 0 deletions
diff --git a/nzbget/pre_enqueue.pm b/nzbget/pre_enqueue.pm
new file mode 100644
index 0000000..dda8967
--- /dev/null
+++ b/nzbget/pre_enqueue.pm
@@ -0,0 +1,36 @@
+package nzbget::pre_enqueue;
+use strict;
+use Apache2::Const -compile => qw(OK);
+use CGI qw(:standard);
+use CGI::Carp 'fatalsToBrowser';
+use local::db;
+use local::menu;
+
+sub handler
+{
+ my @cat = local::db::category->retrieve_all();
+ die "Ungültige category" if not @cat;
+
+ print header;
+ my $menu = new local::menu(%ENV);
+ print $menu->start_html('nzbget pre_enqueue');
+ print CGI::start_form(-action=>'enqueue');
+ print table({class=>'nohigh'},
+ Tr(td(param('title'))),
+ Tr(td(param('description'))),
+ ),
+ table({class=>'nohigh'},
+ Tr(td(['name',textfield('name').hidden('description',param('description')).hidden('url',param('url')).hidden('title',param('title'))])),
+ Tr(td(['category',
+ CGI::popup_menu(
+ -name=>'cat',
+ -values=>[0,map {$_->name()} @cat],
+ -labels => {0=>'---', map { ($_->category_id() => $_->name() ) } @cat}
+ )])),
+ Tr(td([' ',submit("Download starten")])),
+ );
+ print CGI::end_form;
+ print $menu->end_html();
+ return Apache2::Const::OK;
+}
+1;