--- loncom/publisher/lonpubdir.pm 2004/12/07 22:40:09 1.71
+++ loncom/publisher/lonpubdir.pm 2010/02/12 16:04:18 1.114.2.2
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Construction Space Directory Lister
#
-# $Id: lonpubdir.pm,v 1.71 2004/12/07 22:40:09 raeburn Exp $
+# $Id: lonpubdir.pm,v 1.114.2.2 2010/02/12 16:04:18 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,10 +36,12 @@ use Apache::Constants qw(:common :http :
use Apache::loncacc;
use Apache::loncommon();
use Apache::lonhtmlcommon();
+use Apache::londiff();
use Apache::lonlocal;
use Apache::lonmsg;
use Apache::lonmenu;
use Apache::lonnet;
+use LONCAPA;
sub handler {
@@ -60,8 +62,8 @@ sub handler {
&Apache::loncacc::constructaccess(
$fn,$r->dir_config('lonDefDomain'));
unless (($uname) && ($udom)) {
- $r->log_reason($uname.' at '.$udom.
- ' trying to list directory '.$ENV{'form.filename'}.
+ $r->log_reason($uname.':'.$udom.
+ ' trying to list directory '.$env{'form.filename'}.
' ('.$fn.') - not authorized',
$r->filename);
return HTTP_NOT_ACCEPTABLE;
@@ -72,7 +74,7 @@ sub handler {
$fn=~s/\/$//;
unless ($fn) {
- $r->log_reason($ENV{'user.name'}.' at '.$ENV{'user.domain'}.
+ $r->log_reason($env{'user.name'}.':'.$env{'user.domain'}.
' trying to list empty directory', $r->filename);
return HTTP_NOT_FOUND;
}
@@ -91,9 +93,11 @@ sub handler {
my %bombs=&Apache::lonmsg::all_url_author_res_msg($uname,$udom);
&startpage($r, $uname, $udom, $thisdisfn); # Put out the start of page.
- if ($ENV{'environment.remote'} eq 'off') {
+ if ($env{'environment.remote'} eq 'off') {
&dircontrols($r,$uname,$udom,$thisdisfn); # Put out actions for directory,
# browse/upload + new file page.
+ } else {
+ &pubbuttons($r,$uname,$thisdisfn);
}
&resourceactions($r,$uname,$udom,$thisdisfn); #Put out form used for printing/deletion etc.
@@ -101,15 +105,15 @@ sub handler {
my $numres = 0;
# Start off the directory table.
- $r->print('
Directory Contents:
');
- $r->print(''.
- ''.&mt('Type').' | '.
- ''.&mt('Actions').' | '.
- ''.&mt('Name').' | '.
- ''.&mt('Title').' | '.
- ''.&mt('Status').' | '.
- ''.&mt('Last Modified').
- ' |
');
+ $r->print(''.&mt('Directory Contents:').'
');
+ $r->print(''.
+ ''.&mt('Type').' | '.
+ ''.&mt('Actions').' | '.
+ ''.&mt('Name').' | '.
+ ''.&mt('Title').' | '.
+ ''.&mt('Status').' | '.
+ ''.&mt('Last Modified').
+ ' |
'."\n");
my $filename;
my $dirptr=16384; # Mask indicating a directory in stat.cmode.
@@ -135,7 +139,7 @@ sub handler {
}
closedir(DIR);
- $r->print('