4
use lib '/usr/share/mythexport/configs';
5
use lib '/usr/share/mythexport';
4
6
use CGI qw(:standard);
9
my $content = "<form action=\"setup_details.cgi\" method=\"post\"><p>";
12
my $myth = new MythTV();
15
$connect = $myth->{'dbh'};
17
my $dir = '/usr/share/mythexport/configs';
11
19
my $template = HTML::Template->new(filename => 'template/template.tmpl');
13
$content .= "Choose a Device:<br />
14
<input type=\"radio\" id=\"cowon\" name=\"device\" value=\"cowon\" /> Cowon<br />
15
<input type=\"radio\" id=\"android\" name=\"device\" value=\"android\" /> Android<br />
16
<input type=\"radio\" id=\"ipod\" name=\"device\" value=\"ipod\" /> iPod<br />
17
<input type=\"radio\" id=\"psp\" name=\"device\" value=\"psp\" /> PSP<br />
18
<input type=\"radio\" id=\"archos\" name=\"device\" value=\"archos\" /> Archos<br />
19
<input type=\"radio\" id=\"zune\" name=\"device\" value=\"zune\" /> Zune<br />
20
<input type=\"radio\" id=\"xbox360\" name=\"device\" value=\"xbox360\" /> Xbox 360<br />
21
<input type=\"radio\" id=\"laptop\" name=\"device\" value=\"laptop\" /> Laptop<br />
22
<input type=\"radio\" id=\"mp3\" name=\"device\" value=\"mp3\" /> mp3<br />
23
<input type=\"radio\" id=\"symlink\" name=\"device\" value=\"symlink\" /> Symlink<br />
24
<input type=\"radio\" id=\"custom\" name=\"device\" value=\"custom\" /> Custom<br />
25
<input type=\"submit\" id=\"submit\" name=\"submit\" value=\"Submit\" /><br /><br />
27
<a href=\"setup_edit.cgi\">Edit an existing configuration</a>
22
my $query = "SELECT data from settings where value like ?";
23
my $query_handle = $connect->prepare($query);
24
$query_handle->execute("UserJobDesc%") || die "Unable to query mythexport_job_queue table";
26
opendir(my $dh, $dir) || die "can't opendir $dir: $!";
27
my @modules = grep { /\.pm/ && -f "$dir/$_" } readdir($dh);
29
my $content = "<form action=\"newsetupsave.cgi\" method=\"post\"><p>
30
Choose a Configuration:<br /><table border=\"1\">
31
<tr><th> </th><th>Name</th><th>Description</th><th>Devices</th><th>Notes</th></tr>";
34
foreach my $config (@modules) {
35
next if $config eq "ExportBase.pm";
36
(my $class = $config) =~ s/.pm//;
39
my $object = new $class();
40
my $description = $object->Description();
41
my $devices = $object->Devices();
42
my $notes = $object->Notes();
44
$content .= "<tr><td><input type=\"checkbox\" name=\"config\" id=\"$class\" value=\"$class\" /></td>
45
<td>$class</td><td>$description</td><td>$devices</td><td>$notes</td></tr>";
48
$content .= "</table><br />";
50
$content .= "Select a User Jobs:<br />";
52
while(my ($description) = $query_handle->fetchrow_array()) {
53
$content .= "<input type=\"radio\" id=\"radio$i\" name=\"userjob\" value=\"$i\" />$description<br />";
57
$content .= "Description: <input type=\"text\" id=\"description\" name=\"description\" value=\"\" /><br />
58
<span style=\"color:red;\">*WARNING: Proceeding will overwrite any data for this User Job</span><br /><br />
59
Delete Period: <input type=\"text\" id=\"deletePeriod\" name=\"deletePeriod\" value=\"\" /> (number of days to keep exported files, empty will never delete)<br />
60
Podcast Name: <input type=\"text\" id=\"podcastName\" name=\"podcastName\" value=\"\" /> (optional)<br /><br />
61
<input type=\"submit\" id=\"submit\" name=\"submit\" value=\"Submit\" />
30
64
$template->param(CONTENT => $content);