--- loncom/publisher/lonpubdir.pm 2005/05/17 00:46:36 1.79 +++ loncom/publisher/lonpubdir.pm 2005/06/23 22:24:54 1.84 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construction Space Directory Lister # -# $Id: lonpubdir.pm,v 1.79 2005/05/17 00:46:36 www Exp $ +# $Id: lonpubdir.pm,v 1.84 2005/06/23 22:24:54 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -279,7 +279,7 @@ parent.lastknownpriv='/~$uname$thisdisfn if (activity == 'obsolete') { 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.makeobsolete.value=1; pubform.submit() } if (activity == 'print') { @@ -290,6 +290,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 +319,53 @@ 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', + rtrv => 'Retrieve Old Version', + pubs => 'Publish with Subdirectories', + 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 +381,24 @@ sub dircontrols {
- +
- + + + + + + + + + +   
@@ -396,6 +433,7 @@ sub resourceactions {
+
@@ -403,6 +441,9 @@ sub resourceactions {
+
+ +
END } @@ -507,6 +548,7 @@ sub putresource { my ($r, $udom, $uname, $filename, $thisdisfn, $resdir, $targetdir, $linkdir, $cmtime,$bombs,$numres) = @_; + &Apache::lonnet::devalidate_cache_new('meta',$targetdir.'/'.$filename); my $pubstatus = 'unpublished'; my $status=&mt('Unpublished'); my $bgcolor='#FFAA99'; @@ -568,6 +610,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').')'; @@ -613,6 +659,7 @@ sub create_pubselect { } $$pub_select .= ' '. +''. ''. '