summaryrefslogtreecommitdiff
path: root/nzbget/pre_enqueue.pm
blob: 8d2d7081cea30588931b50bbbdf2f64a90e58270 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package nzbget::pre_enqueue;
use strict;
use Apache2::Const -compile => qw(OK);
use CGI qw(:standard);
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;