version 1.160.2.5.2.3, 2024/02/28 04:58:02
|
version 1.160.2.6, 2024/07/03 21:05:49
|
Line 290 sub handler {
|
Line 290 sub handler {
|
} |
} |
|
|
# Print the sorted resources |
# Print the sorted resources |
my %editors = &Apache::loncommon::permitted_editors(); |
|
foreach my $filename (@sorted_files) { |
foreach my $filename (@sorted_files) { |
if ($filehash->{$filename}->{"cmode"}&$dirptr) { # Directories |
if ($filehash->{$filename}->{"cmode"}&$dirptr) { # Directories |
&putdirectory($r, $thisdisfn, $linkdir, $filename, |
&putdirectory($r, $thisdisfn, $linkdir, $filename, |
Line 303 sub handler {
|
Line 302 sub handler {
|
$filehash->{$filename}->{"linkfilename"}, |
$filehash->{$filename}->{"linkfilename"}, |
$filehash->{$filename}->{"fulltitle"}, |
$filehash->{$filename}->{"fulltitle"}, |
$filehash->{$filename}->{"status"}, |
$filehash->{$filename}->{"status"}, |
$filehash->{$filename}->{"pubstatus"}, |
$filehash->{$filename}->{"pubstatus"}); |
\%editors); |
|
} |
} |
} |
} |
|
|
Line 509 sub dircontrols {
|
Line 507 sub dircontrols {
|
acti => 'Actions for current directory', |
acti => 'Actions for current directory', |
updc => 'Upload a new document', |
updc => 'Upload a new document', |
pick => 'Please select an action to perform using the new filename', |
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 |
my $mytype = $lt{'type'}; # avoid conflict with " and ' in javascript |
# Calculate free space in bytes. |
# Calculate free space in bytes. |
# $disk_quota is in MB and $current_disk_usage is in kB |
# $disk_quota is in MB and $current_disk_usage is in kB |
Line 544 sub dircontrols {
|
Line 549 sub dircontrols {
|
<fieldset> |
<fieldset> |
<legend>$lt{'updc'}</legend> |
<legend>$lt{'updc'}</legend> |
<input type="hidden" name="filename" value="/priv$thisdisfn/" /> |
<input type="hidden" name="filename" value="/priv$thisdisfn/" /> |
<input type="file" name="upfile" class="LC_flUpload" size="20" /> |
<input type="file" name="upfile" class="LC_flUpload" /> |
<input type="hidden" id="LC_free_space" value="$free_space" /> |
<input type="hidden" id="LC_free_space" value="$free_space" /> |
<input type="button" value="$lt{'uplo'}" onclick="checkUpload(this.form)" /> |
<input type="button" value="$lt{'uplo'}" onclick="checkUpload(this.form)" /> |
</fieldset> |
</fieldset> |
Line 579 sub dircontrols {
|
Line 584 sub dircontrols {
|
<option value="newtaskfile">$lt{'nbt'}:</option> |
<option value="newtaskfile">$lt{'nbt'}:</option> |
<option value="newlibraryfile">$lt{'nlib'}:</option> |
<option value="newlibraryfile">$lt{'nlib'}:</option> |
<option value="newdir">$lt{'nsub'}:</option> |
<option value="newdir">$lt{'nsub'}:</option> |
</select> <input type="text" name="newfilename" placeholder="$lt{'type'}" value="" onfocus="if (this.value == is.empty()) this.value=''" /> <input type="button" value="Go" onclick="validate_go();" /> |
</select> <input type="text" id="newnameid" name="newfilename" placeholder="$lt{'type'}" value="" onfocus="if (this.value == is.empty()) this.value=''" /> <input type="button" value="Go" onclick="validate_go();" /> |
<br /> |
<br /> |
<span>Quickactions: |
<span>$lt{'shcu'}: |
<input type="hidden" name="mode"/> |
<input type="hidden" name="mode"/> |
<a href="javascript:void(0)" onclick="javascript:validate_action('blank')"> |
<a href="javascript:void(0)" onclick="javascript:validate_action('blank')"> |
<img src="/adm/lonIcons/unknown.gif" title="Create blank problem file"></a> |
<img src="/adm/lonIcons/unknown.gif" title="Create blank problem file"></a> |
Line 594 sub dircontrols {
|
Line 599 sub dircontrols {
|
</span> |
</span> |
<script type="text/javascript"> |
<script type="text/javascript"> |
function validate_action(action){ |
function validate_action(action){ |
|
if (document.getElementById('newnameid')) { |
if (document.getElementsByName(\'newfilename\')[0].value != \'\'){ |
if (document.getElementById('newnameid').value == '') { |
if (action == "blank") { |
var newname; |
document.fileaction.action.value=\'newproblemfile\'; |
var prompttext = "$js_lt{'nanf'}"; |
document.fileaction.mode.value=\'blank\'; |
if (action == 'folder') { |
} else if (action == "problemtempl") { |
prompttext = "$js_lt{'nans'}"; |
document.fileaction.action.value=\'newproblemfile\'; |
} |
validate_go(); |
newname=prompt(prompttext); |
} else if (action == "blankhtml") { |
if (newname != '') { |
document.fileaction.action.value=\'newhtmlfile\'; |
document.getElementById('newnameid').value = newname; |
validate_go(); |
} |
} else if (action == "folder") { |
} |
document.fileaction.action.value=\'newdir\'; |
if (document.getElementById('newnameid').value != '') { |
document.fileaction.mode.value=\'folder\'; |
if (action == 'blank') { |
|
document.fileaction.action.value='newproblemfile'; |
|
document.fileaction.mode.value='blank'; |
|
} else if (action == 'problemtempl') { |
|
document.fileaction.action.value='newproblemfile'; |
|
validate_go(); |
|
} else if (action == 'blankhtml') { |
|
document.fileaction.action.value='newhtmlfile'; |
|
validate_go(); |
|
} else if (action == 'folder') { |
|
document.fileaction.action.value='newdir'; |
|
document.fileaction.mode.value='folder'; |
|
} |
|
fileaction.submit(); |
|
} else { |
|
alert("$js_lt{'psfn'}"); |
} |
} |
fileaction.submit(); |
|
} else { |
|
alert(\'Please specify file name.\'); |
|
// TODO: ask for filename? if so, do some refactoring |
|
|
|
} |
} |
} |
} |
</script> |
</script> |
Line 724 sub putdirectory {
|
Line 739 sub putdirectory {
|
$disfilename = '<i>'.&mt('Parent Directory').'</i>'; |
$disfilename = '<i>'.&mt('Parent Directory').'</i>'; |
} else { |
} else { |
$actionitem = |
$actionitem = |
'<form name="dirselect_'.$$numdir. |
'<form name="dirselect_'.$$numdir.'" action="/adm/publish">'. |
'" action="/adm/publish">'. |
|
'<select name="diraction" onchange="SetPubDir(this.form,document)">'. |
'<select name="diraction" onchange="SetPubDir(this.form,document)">'. |
'<option selected="selected">'.&mt('Select action').'</option>'. |
'<option selected="selected">'.&mt('Select action').'</option>'. |
'<option value="open">'.&mt('Open').'</option>'. |
'<option value="open">'.&mt('Open').'</option>'. |
Line 870 sub getStatus {
|
Line 884 sub getStatus {
|
sub putresource { |
sub putresource { |
my ($r, $udom, $uname, $filename, $thisdisfn, $resdir, $targetdir, |
my ($r, $udom, $uname, $filename, $thisdisfn, $resdir, $targetdir, |
$linkdir, $cmtime, $size, $numres, $linkfilename, $title, |
$linkdir, $cmtime, $size, $numres, $linkfilename, $title, |
$status, $pubstatus, $editors) = @_; |
$status, $pubstatus) = @_; |
&Apache::lonnet::devalidate_cache_new('meta',$targetdir.'/'.$filename); |
&Apache::lonnet::devalidate_cache_new('meta',$targetdir.'/'.$filename); |
|
|
my $editlink=''; |
my $editlink=''; |
Line 879 sub putresource {
|
Line 893 sub putresource {
|
$editlink=' <br />(<a href="'.$linkdir.'/'.$filename.'?editmode=Edit&problemmode=edit">'.&mt('Edit').'</a>)'; |
$editlink=' <br />(<a href="'.$linkdir.'/'.$filename.'?editmode=Edit&problemmode=edit">'.&mt('Edit').'</a>)'; |
} |
} |
if ($filename=~/$LONCAPA::assess_re/) { |
if ($filename=~/$LONCAPA::assess_re/) { |
if ($editors->{'xml'}) { |
$editlink=' (<a href="'.$linkdir.'/'.$filename.'?editmode=Edit&problemmode=editxml">'.&mt('EditXML').'</a>)'; |
$editlink=' (<a href="'.$linkdir.'/'.$filename.'?editmode=Edit&problemmode=editxml">'.&mt('EditXML').'</a>)'; |
$editlink2=' <br />(<a href="'.$linkdir.'/'.$filename.'?editmode=Edit&problemmode=edit">'.&mt('Edit').'</a>)'; |
} |
|
if ($editors->{'edit'}) { |
|
$editlink2=' <br />(<a href="'.$linkdir.'/'.$filename.'?editmode=Edit&problemmode=edit">'.&mt('Edit').'</a>)'; |
|
} |
|
} |
|
if ($filename=~/\.(xml|html|htm|xhtml|xhtm)$/ || $filename=~/$LONCAPA::assess_re/) { |
|
if (($editors->{'daxe'}) && |
|
($env{'browser.type'} ne 'explorer' || $env{'browser.version'} > 9)) { |
|
my $daxeurl = '/daxepage'.$linkdir.'/'.$filename; |
|
$editlink .= ' (<a href="'.$daxeurl.'">Daxe</a>)'; |
|
} |
|
} |
} |
if ($filename=~/\.(problem|exam|quiz|assess|survey|form|library|xml|html|htm|xhtml|xhtm|sty)$/) { |
if ($filename=~/\.(problem|exam|quiz|assess|survey|form|library|xml|html|htm|xhtml|xhtm|sty)$/) { |
$editlink.=' (<a href="/adm/cleanup?filename='.$linkfilename.'">'.&mt('Clean Up').')</a>'; |
$editlink.=' (<a href="/adm/cleanup?filename='.$linkfilename.'">'.&mt('Clean Up').')</a>'; |