--- loncom/publisher/lonpubdir.pm 2004/12/07 22:32:47 1.69 +++ loncom/publisher/lonpubdir.pm 2004/12/22 21:04:52 1.75 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construction Space Directory Lister # -# $Id: lonpubdir.pm,v 1.69 2004/12/07 22:32:47 raeburn Exp $ +# $Id: lonpubdir.pm,v 1.75 2004/12/22 21:04:52 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -94,6 +94,8 @@ sub handler { 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. @@ -212,6 +214,7 @@ sub startpage { } my $pubdirscript=(< +top.document.title = '$thisdisfn/ - LON-CAPA Construction Space'; // Store directory location for menu bar to find parent.lastknownpriv='/~$uname$thisdisfn/'; @@ -266,7 +269,7 @@ parent.lastknownpriv='/~$uname$thisdisfn function SetPubDir(theform,printForm) { if (theform.diraction.options[theform.diraction.selectedIndex].value == "open") { - top.location = theform.filename.value + top.location = theform.openname.value return } if (theform.diraction.options[theform.diraction.selectedIndex].value == "publish") { @@ -298,9 +301,7 @@ parent.lastknownpriv='/~$uname$thisdisfn if (activity == 'delete') { var delform = document.delresource delform.filename.value = theform.filename.value - if (confirm("Are you sure you want to delete "+theform.filename.value+"?")) { - delform.submit() - } + delform.submit() } if (activity == 'obsolete') { var pubform = document.pubresource @@ -332,7 +333,8 @@ parent.lastknownpriv='/~$uname$thisdisfn ENDPUBDIRSCRIPT $r->print($pubdirscript); - if (($uname ne $ENV{'user.name'}) || ($udom ne $ENV{'user.domain'})) { + if ((($uname ne $ENV{'user.name'}) || ($udom ne $ENV{'user.domain'})) && + $ENV{'environment.remote'} ne 'off') { $r->print('

'.&mt('Co-Author').': '.$uname.' at '.$udom. '

'); } @@ -380,7 +382,7 @@ sub dircontrols { '. + ''. + ''. + ''. + ''. +''); +} + sub resourceactions { my ($r,$uname,$udom,$thisdisfn) = @_; $r->print(<'.&mt('Print directory'). ''. ''. + ''. ''. ''. ''.