--- loncom/publisher/lonpubdir.pm 2024/08/18 22:25:36 1.160.2.5.2.4 +++ loncom/publisher/lonpubdir.pm 2024/08/22 18:32:56 1.160.2.5.2.5 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Authoring Space Directory Lister # -# $Id: lonpubdir.pm,v 1.160.2.5.2.4 2024/08/18 22:25:36 raeburn Exp $ +# $Id: lonpubdir.pm,v 1.160.2.5.2.5 2024/08/22 18:32:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -354,12 +354,14 @@ sub startpage { my $disk_quota = &Apache::loncommon::get_user_quota($uname,$udom,'author'); #expressed in MB $disk_quota = 1024 * $disk_quota; # convert from MB to kB + my $headertext = &mt('Directory'); + $r->print(&Apache::loncommon::head_subbox( '
' .&Apache::lonhtmlcommon::display_usage($current_disk_usage, $disk_quota,'authoring') .'
' - .&Apache::loncommon::CSTR_pageheader())); + .&Apache::loncommon::CSTR_pageheader('','',$headertext))); my $esc_thisdisfn = &Apache::loncommon::escape_single($thisdisfn); my $doctitle = 'LON-CAPA '.&mt('Authoring Space'); @@ -373,25 +375,6 @@ parent.lastknownpriv='/priv$esc_thisdisf // Confirmation dialogues - function currdiract(theform) { - if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'publish') { - document.publishdir.filename.value = theform.filename.value; - document.publishdir.submit(); - } - if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'editmeta') { - top.location=theform.filename.value+'default.meta' - } - if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'printdir' ) { - 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) { if (theform.file == '') { alert("Please use 'Browse..' to choose a file first, before uploading") @@ -475,19 +458,16 @@ ENDPUBDIRSCRIPT } sub dircontrols { - my ($r,$uname,$udom,$thisdisfn, $current_disk_usage, $disk_quota) = @_; + my ($r,$uname,$udom,$thisdisfn,$current_disk_usage,$disk_quota) = @_; 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 Metadata', sela => 'Select Action', nfil => 'New file', nhtm => 'New HTML file', @@ -504,9 +484,7 @@ sub dircontrols { 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', + crea => 'Create a new subdirectory or document', updc => 'Upload a new document', pick => 'Please select an action to perform using the new filename', shcu => 'Shortcuts', @@ -521,31 +499,25 @@ sub dircontrols { # Calculate free space in bytes. # $disk_quota is in MB and $current_disk_usage is in kB my $free_space = 1024 * ((1024 * $disk_quota) - $current_disk_usage); + $r->print("\n".'
'."\n"); + my %fileoptions = ( + none => "$lt{'sela'}:", + newfile => "$lt{'nfil'}:", + newhtmlfile => "$lt{'nhtm'}:", + newproblemfile => "$lt{'nprb'}:", + newdir => "$lt{'nsub'}:", + newpagefile => "$lt{'npag'}:", + newsequencefile => "$lt{'nseq'}:", + newrightsfile => "$lt{'ncrf'}:", + newstyfile => "$lt{'nsty'}:", + newtaskfile => "$lt{'nbt'}:", + newlibraryfile => "$lt{'nlib'}:", + ); + $fileoptions{'select_form_order'} = ['none','newfile','newhtmlfile','newproblemfile', + 'newpagefile','newsequencefile','newrightsfile', + 'newstyfile','newtaskfile','newlibraryfile','newdir']; + my $selectbox = &Apache::loncommon::select_form('none','action',\%fileoptions); $r->print(< -
-
-
- $lt{'acti'} - - -
-
-
- - -
-
- -
-
-
@@ -562,8 +534,8 @@ sub dircontrols {
$lt{'crea'} - - + + -    + $selectbox  
$lt{'shcu'}: - + file icon - + problem icon - + web page icon - + folder icon -
+
-
+
END }