--- loncom/publisher/lonpubdir.pm 2019/08/11 15:15:43 1.172 +++ loncom/publisher/lonpubdir.pm 2023/06/11 20:45:40 1.178 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Authoring Space Directory Lister # -# $Id: lonpubdir.pm,v 1.172 2019/08/11 15:15:43 raeburn Exp $ +# $Id: lonpubdir.pm,v 1.178 2023/06/11 20:45:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -67,9 +67,7 @@ sub handler { $r->send_http_header; &Apache::lonhtmlcommon::clear_breadcrumbs(); - my $js = ''; - $r->print(&Apache::loncommon::start_page('Authoring Space', $js). + $r->print(&Apache::loncommon::start_page('Authoring Space'). '
'. '

'. &mt('Your Authoring Space is currently in the location used by LON-CAPA version 2.10 and older, but your domain is using a newer LON-CAPA version ([_1]).',$version).'

'. @@ -106,9 +104,9 @@ sub handler { "$londocroot/priv/$udom/$uname"); # expressed in kB my $disk_quota = &Apache::loncommon::get_user_quota($uname,$udom, $cstr,$crstype); # expressed in MB - # Put out the start of page. - &startpage($r, $uname, $udom, $thisdisfn, $current_disk_usage, $disk_quota, $crsauthor); + + &startpage($r, $uname, $udom, $thisdisfn, $current_disk_usage, $disk_quota, $crsauthor); if (!-d $fn) { if (-e $fn) { @@ -398,7 +396,7 @@ sub startpage { .&Apache::lonhtmlcommon::display_usage($current_disk_usage, $disk_quota,'authoring') .'
' - .&Apache::loncommon::CSTR_pageheader())); + .&Apache::loncommon::CSTR_pageheader('','',&mt('Directory')))); my $esc_thisdisfn = &Apache::loncommon::escape_single($thisdisfn); my $doctitle = 'LON-CAPA '.&mt($title); @@ -412,25 +410,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") @@ -520,13 +499,10 @@ sub dircontrols { 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', @@ -543,58 +519,54 @@ 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', - qs => 'Quick Search', + crea => 'Create a new subdirectory or document', + qs => 'Quick name search', cs => 'Case Sensitive', re => 'Regular Expression', - acti => 'Actions for current directory', updc => 'Upload a new document', pick => 'Please select an action to perform using the new filename', + shcu => 'Shortcuts', ); + my %js_lt = &Apache::lonlocal::texthash( + nanf => 'Name of New File', + nans => 'Name of New Subdirectory', + psfn => 'Please specify file name', + ); + &js_escape(\%js_lt); my $mytype = $lt{'type'}; # avoid conflict with " and ' in javascript # 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->printf(< -
-
-
- $lt{'acti'} - - -
-
-
- - -
-
- -
+
+
+ $lt{'qs'} + + + + %s +
+ + +
- +END + $r->print(< -
+
$lt{'updc'} - - + +
-
+
$lt{'crea'} @@ -621,41 +593,51 @@ sub dircontrols { -    +   
- Quickactions: + $lt{'shcu'}: - + file icon - + problem icon - + web page icon - + folder icon @@ -663,18 +645,6 @@ sub dircontrols {
-
-
- $lt{'qs'} - - - - %s -
- - -
-
END } @@ -682,26 +652,26 @@ END sub resourceactions { my ($r,$uname,$udom,$thisdisfn) = @_; $r->print(< +
-
+
-
+
-
+
-
+
-
+
END @@ -779,7 +749,7 @@ sub putdirectory { } else { $actionitem = '
'. + '" action="/adm/publish">'. '