--- loncom/publisher/lonpubdir.pm 2004/11/30 19:08:18 1.66
+++ loncom/publisher/lonpubdir.pm 2004/12/15 19:15:59 1.74
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Construction Space Directory Lister
#
-# $Id: lonpubdir.pm,v 1.66 2004/11/30 19:08:18 raeburn Exp $
+# $Id: lonpubdir.pm,v 1.74 2004/12/15 19:15:59 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.
@@ -193,28 +195,29 @@ sub startpage {
$r->print('
LON-CAPA Construction Space');
my $pagetitle;
- my $formaction='/priv/'.$uname.'/'.$thisdisfn.'/';
+ my $formaction='/priv/'.$uname.$thisdisfn.'/';
$formaction=~s/\/+/\//g;
$pagetitle .= &Apache::loncommon::help_open_menu('','','','',3,'Authoring').
- 'Construction Space: '.
+ 'Construction Space: '.
'';
&Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction);
if ($ENV{'environment.remote'} eq 'off') {
- $ENV{'request.noversionuri'}=$currdir;
+ $ENV{'request.noversionuri'}=$currdir.'/';
$r->print(&Apache::loncommon::bodytag('Construction Space',undef,undef,undef,undef,undef,$pagetitle));
} else {
$r->print($pagetitle);
}
my $pubdirscript=(<
+top.document.title = '$thisdisfn/ - LON-CAPA Construction Space';
// Store directory location for menu bar to find
-parent.lastknownpriv='/~$uname/$thisdisfn/';
+parent.lastknownpriv='/~$uname$thisdisfn/';
// Confirmation dialogues
@@ -278,7 +281,7 @@ parent.lastknownpriv='/~$uname/$thisdisf
if (theform.diraction.options[theform.diraction.selectedIndex].value == "editcat") {
top.location=theform.filename.value+'default.meta'
}
- if (theform.diraction.options[theform.diraction.selectedIndex].value == "print") {
+ if (theform.diraction.options[theform.diraction.selectedIndex].value == "printdir") {
theform.action = '/adm/printout'
theform.postdata.value = theform.filename.value
theform.submit()
@@ -298,22 +301,21 @@ parent.lastknownpriv='/~$uname/$thisdisf
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') {
- alert("Mark as obsolete - still to be implemented")
+ var pubform = document.pubresource
+ pubform.filename.value = theform.filename.value
+ alert("You will be taken to the publication page.\\nCheck the 'Obsolete' checkbox at the bottom of the page, and click 'Finalize Publication'.")
+ pubform.submit()
}
if (activity == 'print') {
- document.printresource.postdata = theform.filename.value
- document.printresource.curseed = getcurseed()
- document.printresource.problemtype = getproblemtype()
+ document.printresource.postdata.value = theform.filename.value
document.printresource.submit()
}
if (activity == 'retrieve') {
- retrieveres.filename.value = theform.filename.value
- retrieveres.submit()
+ document.retrieveres.filename.value = theform.filename.value
+ document.retrieveres.submit()
}
return
}
@@ -327,39 +329,12 @@ parent.lastknownpriv='/~$uname/$thisdisf
document.moveresource.action.value = activity
document.moveresource.submit();
}
-
- function getcurseed() {
- if (parent.document.lonhomework
- &&
- parent.document.lonhomework.rndseed
- &&
- parent.document.lonhomework.rndseed.value) {
- return parent.document.lonhomework.rndseed.value;
- }
- return 0;
- }
-
- function getproblemtype() {
- if (parent.document.lonhomework) {
- var optionelement;
- var valueIndex=0;
- for (var optionIndex=0;
- optionIndex < parent.document.lonhomework.problemtype.options.length;
- optionIndex++)
- {
- optionElement=parent.document.lonhomework.problemtype.options[optionIndex];
- if (optionElement.selected) {
- return optionElement.value;
- }
- }
- }
- return 0;
- }
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.
'
');
}
@@ -370,9 +345,9 @@ sub dircontrols {
$r->print(<
- Actions for current directory |
- Upload a new document |
- Create a new directory or LON-CAPA document |
+ Actions for current directory |
+ Upload a new document |
+ Create a new directory or LON-CAPA document |
@@ -393,8 +368,6 @@ sub dircontrols {
|
@@ -409,7 +382,7 @@ sub dircontrols {
|
-
-
END
}
+sub pubbuttons {
+ my ($r,$uname,$thisdisfn) = @_;
+ $r->print('');
+}
+
sub resourceactions {
my ($r,$uname,$udom,$thisdisfn) = @_;
$r->print(<
';
$$numdir ++;
@@ -647,20 +632,16 @@ sub create_pubselect {
';
+ $uname.$thisdisfn.'/'.$filename.'">';
$$numres ++;
}