3 # Display a list of messages for answering machine use.
4 # - If there is no Index file, assume just standard.rmd
5 # - Allow uploading in different formats, with modem conversion
7 require './vgetty-lib.pl';
8 &ui_print_header(undef, $text{'messages_title'}, "");
10 @conf = &get_config();
11 $dir = &messages_dir(\@conf);
12 $index = &messages_index(\@conf);
16 push(@messages, &rmd_file_info("$dir/$_"));
20 $bak = &find_value("backup_message", \@conf);
21 $info = &rmd_file_info("$dir/$bak");
22 push(@messages, $info) if ($info);
25 print "$text{'messages_desc'}<p>\n";
27 print "<form action=delete.cgi method=post>\n";
28 print "<input type=hidden name=mode value=1>\n";
29 print &select_all_link("del", 0, $text{'received_all'})," \n";
30 print &select_invert_link("del", 0, $text{'received_invert'}),"\n";
31 print "<table border width=100%>\n";
32 print "<tr $tb> <td><br></td> ",
33 "<td><b>$text{'messages_file'}</b></td> ",
34 "<td><b>$text{'received_size'}</b></td> ",
35 "<td><b>$text{'received_speed'}</b></td> ",
36 "<td><b>$text{'received_type'}</b></td> </tr>\n";
37 foreach $r (sort { $a->{'file'} <=> $b->{'file'} } @messages) {
39 print "<td><input type=checkbox name=del ",
40 "value='$r->{'file'}'></td>\n";
41 print "<td><a href='listen.cgi/voicemail.wav?file=",
42 &urlize($r->{'file'}),"&mode=1'>",
43 $r->{'file'},"</a></td>\n";
44 print "<td>",int($r->{'size'}/1024)." kB","</td>\n";
45 print "<td>$r->{'speed'}</td>\n";
46 print "<td>",&text('pvfdesc', $r->{'type'}, $r->{'bits'}),
51 print &select_all_link("del", 0, $text{'received_all'})," \n";
52 print &select_invert_link("del", 0, $text{'received_invert'}),"<p>\n";
53 print "<input type=submit value='$text{'received_delete'}'></form>\n";
56 print "<p><b>$text{'messages_none'}</b> <p>\n";
60 print "$text{'messages_updesc'}<p>\n";
61 print "<form action=upload.cgi method=post enctype=multipart/form-data>\n";
62 print "<input type=submit value='$text{'messages_upload'}'>\n";
63 print "<input name=wav type=file>\n";
64 print "$text{'messages_fmt'} <select name=format>\n";
65 foreach $f (&list_rmd_formats()) {
66 printf "<option value='%s' %s>%s\n",
68 $f->{'index'} == $config{'format'} ? "selected" : "",
71 print "</select></form>\n";
73 &ui_print_footer("", $text{'index_return'});