version 1.177, 2023/06/11 19:46:01
|
version 1.178, 2023/06/11 20:45:40
|
Line 104 sub handler {
|
Line 104 sub handler {
|
"$londocroot/priv/$udom/$uname"); # expressed in kB |
"$londocroot/priv/$udom/$uname"); # expressed in kB |
my $disk_quota = &Apache::loncommon::get_user_quota($uname,$udom, |
my $disk_quota = &Apache::loncommon::get_user_quota($uname,$udom, |
$cstr,$crstype); # expressed in MB |
$cstr,$crstype); # expressed in MB |
my $diraction; |
|
if (-d $fn) { |
|
$diraction = &diractions($thisdisfn); |
|
} |
|
|
|
# Put out the start of page. |
# Put out the start of page. |
|
|
&startpage($r, $uname, $udom, $thisdisfn, $current_disk_usage, $disk_quota, $crsauthor, $diraction); |
&startpage($r, $uname, $udom, $thisdisfn, $current_disk_usage, $disk_quota, $crsauthor); |
|
|
if (!-d $fn) { |
if (!-d $fn) { |
if (-e $fn) { |
if (-e $fn) { |
Line 366 my $result = "<script type=\"text/javasc
|
Line 361 my $result = "<script type=\"text/javasc
|
# $crstype - Course type, if this is for "course author" |
# $crstype - Course type, if this is for "course author" |
|
|
sub startpage { |
sub startpage { |
my ($r, $uname, $udom, $thisdisfn, $current_disk_usage, $disk_quota, $crsauthor, $diraction) = @_; |
my ($r, $uname, $udom, $thisdisfn, $current_disk_usage, $disk_quota, $crsauthor) = @_; |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
|
Line 396 sub startpage {
|
Line 391 sub startpage {
|
|
|
$disk_quota = 1024 * $disk_quota; # convert from MB to kB |
$disk_quota = 1024 * $disk_quota; # convert from MB to kB |
|
|
my $heading = &mt('Directory'); |
|
$r->print(&Apache::loncommon::head_subbox( |
$r->print(&Apache::loncommon::head_subbox( |
'<div style="float:right;padding-top:0;margin-top;0">' |
'<div style="float:right;padding-top:0;margin-top;0">' |
.&Apache::lonhtmlcommon::display_usage($current_disk_usage, |
.&Apache::lonhtmlcommon::display_usage($current_disk_usage, |
$disk_quota,'authoring') |
$disk_quota,'authoring') |
.'</div>' |
.'</div>' |
.&Apache::loncommon::CSTR_pageheader('','',$heading,$diraction))); |
.&Apache::loncommon::CSTR_pageheader('','',&mt('Directory')))); |
|
|
my $esc_thisdisfn = &Apache::loncommon::escape_single($thisdisfn); |
my $esc_thisdisfn = &Apache::loncommon::escape_single($thisdisfn); |
my $doctitle = 'LON-CAPA '.&mt($title); |
my $doctitle = 'LON-CAPA '.&mt($title); |
Line 416 parent.lastknownpriv='/priv$esc_thisdisf
|
Line 410 parent.lastknownpriv='/priv$esc_thisdisf
|
|
|
// Confirmation dialogues |
// 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) { |
function checkUpload(theform) { |
if (theform.file == '') { |
if (theform.file == '') { |
alert("Please use 'Browse..' to choose a file first, before uploading") |
alert("Please use 'Browse..' to choose a file first, before uploading") |
Line 517 ENDPUBDIRSCRIPT
|
Line 492 ENDPUBDIRSCRIPT
|
$r->print($pubdirscript); |
$r->print($pubdirscript); |
} |
} |
|
|
sub diractions { |
|
my ($thisdisfn) = @_; |
|
my %lt=&Apache::lonlocal::texthash( |
|
acti => 'Actions for current directory', |
|
sela => 'Select Action', |
|
pubd => 'Publish this Directory', |
|
prnt => 'Print contents of directory', |
|
edit => 'Edit Metadata', |
|
dedr => 'Delete Directory', |
|
); |
|
return <<END; |
|
<div style="display:inline-block;padding-left:20px"> |
|
<b>$lt{'acti'}</b><br /> |
|
<form name="curractions" method="post" action=""> |
|
<select name="dirtask" onchange="currdiract(this.form)"> |
|
<option>$lt{'sela'}</option> |
|
<option value="publish">$lt{'pubd'}</option> |
|
<option value="editmeta">$lt{'edit'}</option> |
|
<option value="printdir">$lt{'prnt'}</option> |
|
<option value="delete">$lt{'dedr'}</option> |
|
</select> |
|
<input type="hidden" name="filename" value="/priv$thisdisfn/" /> |
|
</form> |
|
<form name="publishdir" method="post" action="/adm/publish"> |
|
<input type="hidden" name="pubrec" value="" /> |
|
<input type="hidden" name="filename" value="" /> |
|
</form> |
|
<form name="printdir" method="post" action="/adm/printout"> |
|
<input type="hidden" name="postdata" value="" /> |
|
</form> |
|
</div> |
|
END |
|
|
|
} |
|
|
|
sub dircontrols { |
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( |
my %lt=&Apache::lonlocal::texthash( |
Line 662 END
|
Line 602 END
|
<a href="javascript:void(0)" onclick="javascript:validate_action('problemtempl')"> |
<a href="javascript:void(0)" onclick="javascript:validate_action('problemtempl')"> |
<img src="/adm/lonIcons/problem.gif" title="Create new problem from template" alt="problem icon" /></a> |
<img src="/adm/lonIcons/problem.gif" title="Create new problem from template" alt="problem icon" /></a> |
<a href="javascript:void(0)" onclick="javascript:validate_action('blankhtml')"> |
<a href="javascript:void(0)" onclick="javascript:validate_action('blankhtml')"> |
<img src="/adm/lonIcons/html.gif" title="Create new blank HTML file" alt="web page icon" /></a> |
<img src="/adm/lonIcons/html.gif" title="Create new blank HTML file" alt="web page icon" /></a> |
<a href="javascript:void(0)" onclick="javascript:validate_action('folder')"> |
<a href="javascript:void(0)" onclick="javascript:validate_action('folder')"> |
<img src="/adm/lonIcons/navmap.folder.closed.gif" title="Create new subdirectory" alt="folder icon" /></a> |
<img src="/adm/lonIcons/navmap.folder.closed.gif" title="Create new subdirectory" alt="folder icon" /></a> |
</span> |
</span> |