--- loncom/publisher/lonpubdir.pm 2005/05/20 18:28:22 1.81 +++ loncom/publisher/lonpubdir.pm 2005/07/14 21:31:34 1.88 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construction Space Directory Lister # -# $Id: lonpubdir.pm,v 1.81 2005/05/20 18:28:22 www Exp $ +# $Id: lonpubdir.pm,v 1.88 2005/07/14 21:31:34 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -111,7 +111,7 @@ sub handler { ''.&mt('Title').''. ''.&mt('Status').''. ''.&mt('Last Modified'). - ''); + ''."\n"); my $filename; my $dirptr=16384; # Mask indicating a directory in stat.cmode. @@ -233,6 +233,11 @@ parent.lastknownpriv='/~$uname$thisdisfn document.printdir.postdata.value=theform.filename.value document.printdir.submit(); } + if (theform.dirtask.options[theform.dirtask.selectedIndex].value == "delete") { + var delform = document.delresource + delform.filename.value = theform.filename.value + delform.submit() + } } function checkUpload(theform) { @@ -259,6 +264,11 @@ parent.lastknownpriv='/~$uname$thisdisfn theform.postdata.value = theform.filename.value theform.submit() } + if (theform.diraction.options[theform.diraction.selectedIndex].value == "delete") { + var delform = document.delresource + delform.filename.value = theform.filename.value + delform.submit() + } return } function SetResChoice(theform) { @@ -290,6 +300,10 @@ parent.lastknownpriv='/~$uname$thisdisfn document.retrieveres.filename.value = theform.filename.value document.retrieveres.submit() } + if (activity == 'cleanup') { + document.cleanup.filename.value = theform.filename.value + document.cleanup.submit() + } return } function changename(theform,activity) { @@ -315,21 +329,54 @@ ENDPUBDIRSCRIPT sub dircontrols { my ($r,$uname,$udom,$thisdisfn) = @_; + my %lt=&Apache::lonlocal::texthash( + cnpd => 'Cannot publish directory', + cnrd => 'Cannot retrieve directory', + mcdi => 'Must create new subdirectory inside a directory', + pubr => 'Publish this Resource', + pubd => 'Publish this Directory', + dedr => 'Delete Directory', + rtrv => 'Retrieve Old Version', + list => 'List Directory', + uplo => 'Upload file', + dele => 'Delete', + edit => 'Edit Catalog Information', + sela => 'Select Action', + nfil => 'New file', + nhtm => 'New HTML file', + nprb => 'New problem', + npag => 'New assembled page', + nseq => 'New assembled sequence', + ncrf => 'New custom rights file', + nsty => 'New style file', + nlib => 'New library file', + nsub => 'New subdirectory', + renm => 'Rename current file to', + move => 'Move current file to', + copy => 'Copy current file to', + type => 'Type Name Here', + go => 'Go', + prnt => 'Print contents of directory', + crea => 'Create a new directory or LON-CAPA document', + acti => 'Actions for current directory', + updc => 'Upload a new document' + ); $r->print(< - Actions for current directory - Upload a new document - Create a new directory or LON-CAPA document + $lt{'acti'} + $lt{'updc'} + $lt{'crea'}
- + + + + +
@@ -345,23 +392,24 @@ sub dircontrols {
- +
- + + + + + + + + + +   
@@ -377,7 +425,7 @@ sub pubbuttons { '
'. ''. -'
'); } @@ -404,6 +452,9 @@ sub resourceactions {
+
+ +
END } @@ -473,15 +524,15 @@ sub putdirectory { $actionitem = '
'. - ''. ''. ''. ''. - ''. ''. ''. + ''. ''. - ''. + ''. ''. ''. '
'; @@ -489,9 +540,9 @@ sub putdirectory { } $r->print(''. ''. + $Apache::lonnet::perlvar{'lonIconsURL'}.'/folder_closed.gif" alt="folder" />'. ''.$actionitem.''. - ''. + ''. $disfilename.''. ''.($kaputt?&Apache::lonhtmlcommon::authorbombs($resdir.'/'.$disfilename.'/'):'').$Apache::lonpublisher::metadatafields{'title'}.' '. $Apache::lonpublisher::metadatafields{'subject'}.' '. @@ -557,7 +608,7 @@ sub putresource { } } $title.="\n".'
'. - ($$bombs{$targetdir.'/'.$filename}?'':'Edit Metadata').''; + ($$bombs{$targetdir.'/'.$filename}?'bomb':'Edit Metadata').''; $status.="\n".'
'.&mt('Retrieve').''; } @@ -570,6 +621,10 @@ sub putresource { $editlink=' ('.&mt('EditXML').')'; $editlink2='
('.&mt('Edit').')'; } + if ($filename=~/\.(problem|exam|quiz|assess|survey|form|library|xml|html|htm|xhtml|xhtm|sty)$/) { + $editlink.=' ('.&mt('Clean Up').')'; + } if ($filename=~/\.(zip|tar|bz2|gz|tar.gz|tar.bz2|tgz)$/) { $editlink=' ('.&mt('Decompress').')'; @@ -578,7 +633,7 @@ sub putresource { &create_pubselect($r,\$pub_select,$udom,$uname,$thisdisfn,$filename,$resdir,$pubstatus,$publish_button,$numres); $r->print(''. ''.($filename=~/[\#\~]$/?' ': - ''). + '').''. ''.$pub_select.''. ''. ''. @@ -595,7 +650,7 @@ sub create_pubselect { my ($r,$pub_select,$udom,$uname,$thisdisfn,$filename,$resdir,$pubstatus,$publish_button,$numres) = @_; $$pub_select = '
- '. ''; if ($pubstatus eq 'obsolete' || $pubstatus eq 'unpublished') { @@ -615,10 +670,11 @@ sub create_pubselect { } $$pub_select .= ' '. +''. ''. '
'; + &HTML::Entities::encode($uname.$thisdisfn.'/'.$filename,'<>&"').'" />'; $$numres ++; }