--- loncom/publisher/lonpubdir.pm 2004/11/08 22:42:20 1.65 +++ loncom/publisher/lonpubdir.pm 2004/12/07 22:35:34 1.70 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construction Space Directory Lister # -# $Id: lonpubdir.pm,v 1.65 2004/11/08 22:42:20 albertel Exp $ +# $Id: lonpubdir.pm,v 1.70 2004/12/07 22:35:34 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -192,29 +192,29 @@ sub startpage { $r->print('LON-CAPA Construction Space'); - my $pagetitle; - my $formaction='/priv/'.$uname.'/'.$thisdisfn; + my $pagetitle; + my $formaction='/priv/'.$uname.$thisdisfn.'/'; $formaction=~s/\/+/\//g; - $pagetitle .= ('
'. - 'Construction Space: '. - &Apache::lonhtmlcommon::crumbs($uname.'/'.$thisdisfn,'top','/priv','','-1'). + $pagetitle .= &Apache::loncommon::help_open_menu('','','','',3,'Authoring'). + 'Construction Space: '. + ''. + &Apache::lonhtmlcommon::crumbs($uname.$thisdisfn.'/','_top','/priv','','+1',1)."
". &Apache::lonhtmlcommon::select_recent('construct','recent', 'this.form.action=this.form.recent.value;this.form.submit()'). - '
'); - &Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction); + ''; + &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); } - $r->print(&Apache::loncommon::help_open_menu('','','','',3,'Authoring')); my $pubdirscript=(< // Store directory location for menu bar to find -parent.lastknownpriv='/~$uname/$thisdisfn/'; +parent.lastknownpriv='/~$uname$thisdisfn/'; // Confirmation dialogues @@ -228,7 +228,7 @@ parent.lastknownpriv='/~$uname/$thisdisf pubrecdir(document.publishdir) } if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'editcat') { - window.location=theform.filename.value+'default.meta' + top.location=theform.filename.value+'default.meta' } if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'printdir' ) { document.printdir.postdata.value=theform.filename.value @@ -266,7 +266,7 @@ parent.lastknownpriv='/~$uname/$thisdisf function SetPubDir(theform,printForm) { if (theform.diraction.options[theform.diraction.selectedIndex].value == "open") { - window.location = theform.filename.value + top.location = theform.filename.value return } if (theform.diraction.options[theform.diraction.selectedIndex].value == "publish") { @@ -276,9 +276,9 @@ parent.lastknownpriv='/~$uname/$thisdisf pubrecdir(theform) } if (theform.diraction.options[theform.diraction.selectedIndex].value == "editcat") { - window.location=theform.filename.value+'default.meta' + 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() @@ -303,17 +303,18 @@ parent.lastknownpriv='/~$uname/$thisdisf } } 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,34 +328,6 @@ 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); @@ -370,9 +343,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 +366,6 @@ sub dircontrols {
- -
@@ -409,7 +380,7 @@ sub dircontrols { - -
@@ -511,6 +478,8 @@ sub putdirectory { %Apache::lonpublisher::metadatakeys=(); my $construct=$here; $construct=~s:^/priv/(\w+)$:/home/$1/public_html:; + my $dirpath = $here; + $dirpath=~s:^/priv/:/~:; &Apache::lonpublisher::metaeval(&Apache::lonnet::getfile( $construct.'/'.$dirname.'/default.meta' )); @@ -529,11 +498,9 @@ sub putdirectory { ''. '
'; $$numdir ++; @@ -647,20 +614,16 @@ sub create_pubselect {
+
'; + $uname.$thisdisfn.'/'.$filename.'">'; $$numres ++; }