');
+ $r->print('');
}
+ return '';
}
@@ -201,7 +175,7 @@ sub addcom {
sub handler {
my $r=shift;
if ($r->header_only) {
- $r->content_type('text/html');
+ &Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
return OK;
}
@@ -217,20 +191,34 @@ sub handler {
return HTTP_NOT_ACCEPTABLE;
}
if ($ENV{'form.cid'}) {
- my %cenv=&Apache::lonnet::coursedescription($ENV{'form.cid'});
- if (exists($ENV{'form.state'}) && ($ENV{'form.state'} eq 'csv')) {
+ my %cenv=&Apache::lonnet::coursedescription($ENV{'form.cid'});
+ my $keytype='';
+ if ($cenv{'url'} eq '/res/') {
+ ($cenv{'num'},$cenv{'domain'})=split(/\_/,$ENV{'form.cid'});
+ $keytype='auth';
+ } elsif ($cenv{'keyauth'}) {
+ ($cenv{'num'},$cenv{'domain'})=split(/\W/,$cenv{'keyauth'});
+ $keytype='auth';
+ } else {
+ $keytype='course';
+ }
+ if ($ENV{'form.listkeyscsv'}) {
#
# CSV Output
#
$r->content_type('text/csv');
+ $r->send_http_header;
#
# Do CSV
#
+ &show_key_list($r,1,$ENV{'form.listcom'},
+ $ENV{'form.newonly'},$ENV{'form.checkonly'},%cenv);
+
} else {
#
# Normal web stuff
#
- $r->content_type('text/html');
+ &Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
$r->print(&header());
@@ -248,18 +236,24 @@ sub handler {
$r->print($msg.' ');
}
if ($ENV{'form.listkeys'}) {
- &show_key_list($r,$ENV{'form.listcom'},
+ &show_key_list($r,0,$ENV{'form.listcom'},
$ENV{'form.newonly'},$ENV{'form.checkonly'},%cenv);
}
if ($ENV{'form.addcom'}) {
&addcom(%cenv);
}
# --- Menu
- $r->print('
Key Access
');
- if ($cenv{'keyaccess'} eq 'yes') {
- $r->print('Access to this course is key controlled. ')
+ if ($keytype eq 'course') {
+ $r->print('
'.&mt('Key Access').'
');
+ if ($cenv{'keyaccess'} eq 'yes') {
+ $r->print(&mt('Access to this course is key controlled.').
+' ')
} else {
- $r->print('Access to this course is open, no access keys. ');
+ $r->print(&mt('Access to this course is open, no access keys').' ');
+ }
+ } else {
+ $r->print('
@@ -267,26 +261,27 @@ Number of keys to be generated:
List Keys
-Comments/Remarks/Notes/User/Batch Number:
+Comments/Remarks/Notes/User/Batch Number Filter:
Unused keys only
Used keys only
-
+
+
ENDKEYMENU
$r->print('