version 1.77, 2005/02/28 08:22:09
|
version 1.81, 2005/05/20 18:28:22
|
Line 61 sub handler {
|
Line 61 sub handler {
|
$fn,$r->dir_config('lonDefDomain')); |
$fn,$r->dir_config('lonDefDomain')); |
unless (($uname) && ($udom)) { |
unless (($uname) && ($udom)) { |
$r->log_reason($uname.' at '.$udom. |
$r->log_reason($uname.' at '.$udom. |
' trying to list directory '.$ENV{'form.filename'}. |
' trying to list directory '.$env{'form.filename'}. |
' ('.$fn.') - not authorized', |
' ('.$fn.') - not authorized', |
$r->filename); |
$r->filename); |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
Line 72 sub handler {
|
Line 72 sub handler {
|
$fn=~s/\/$//; |
$fn=~s/\/$//; |
|
|
unless ($fn) { |
unless ($fn) { |
$r->log_reason($ENV{'user.name'}.' at '.$ENV{'user.domain'}. |
$r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}. |
' trying to list empty directory', $r->filename); |
' trying to list empty directory', $r->filename); |
return HTTP_NOT_FOUND; |
return HTTP_NOT_FOUND; |
} |
} |
Line 91 sub handler {
|
Line 91 sub handler {
|
my %bombs=&Apache::lonmsg::all_url_author_res_msg($uname,$udom); |
my %bombs=&Apache::lonmsg::all_url_author_res_msg($uname,$udom); |
|
|
&startpage($r, $uname, $udom, $thisdisfn); # Put out the start of page. |
&startpage($r, $uname, $udom, $thisdisfn); # Put out the start of page. |
if ($ENV{'environment.remote'} eq 'off') { |
if ($env{'environment.remote'} eq 'off') { |
&dircontrols($r,$uname,$udom,$thisdisfn); # Put out actions for directory, |
&dircontrols($r,$uname,$udom,$thisdisfn); # Put out actions for directory, |
# browse/upload + new file page. |
# browse/upload + new file page. |
} else { |
} else { |
Line 148 sub getEffectiveUrl {
|
Line 148 sub getEffectiveUrl {
|
my $r = shift; |
my $r = shift; |
my $fn; |
my $fn; |
|
|
if ($ENV{'form.filename'}) { # If a form filename is defined. |
if ($env{'form.filename'}) { # If a form filename is defined. |
$fn=$ENV{'form.filename'}; |
$fn=$env{'form.filename'}; |
# |
# |
# Replace the ~username of the URL with /home/username/public_html |
# Replace the ~username of the URL with /home/username/public_html |
# so that we don't have to worry about ~ expansion internally. |
# so that we don't have to worry about ~ expansion internally. |
Line 206 sub startpage {
|
Line 206 sub startpage {
|
'this.form.action=this.form.recent.value;this.form.submit()'). |
'this.form.action=this.form.recent.value;this.form.submit()'). |
'</form>'; |
'</form>'; |
&Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction); |
&Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction); |
if ($ENV{'environment.remote'} eq 'off') { |
if ($env{'environment.remote'} eq 'off') { |
$ENV{'request.noversionuri'}=$currdir.'/'; |
$env{'request.noversionuri'}=$currdir.'/'; |
$r->print(&Apache::loncommon::bodytag('Construction Space',undef,undef,undef,undef,undef,$pagetitle)); |
$r->print(&Apache::loncommon::bodytag('Construction Space',undef,undef,undef,undef,undef,$pagetitle)); |
} else { |
} else { |
$r->print($pagetitle); |
$r->print($pagetitle); |
Line 223 parent.lastknownpriv='/~$uname$thisdisfn
|
Line 223 parent.lastknownpriv='/~$uname$thisdisfn
|
|
|
function currdiract(theform) { |
function currdiract(theform) { |
if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'publish') { |
if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'publish') { |
document.publishdir.filename.value = theform.filename.value |
document.publishdir.filename.value = theform.filename.value; |
pubdir(document.publishdir) |
document.publishdir.submit(); |
} |
|
if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'publishsub') { |
|
document.publishdir.filename.value = theform.filename.value |
|
pubrecdir(document.publishdir) |
|
} |
} |
if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'editcat') { |
if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'editcat') { |
top.location=theform.filename.value+'default.meta' |
top.location=theform.filename.value+'default.meta' |
Line 239 parent.lastknownpriv='/~$uname$thisdisfn
|
Line 235 parent.lastknownpriv='/~$uname$thisdisfn
|
} |
} |
} |
} |
|
|
function pubdir(theform) { |
|
if (confirm('Publish complete directory?')) { |
|
forcepub(theform) |
|
theform.submit(); |
|
} |
|
} |
|
function pubrecdir(theform) { |
|
if (confirm('Publish directory and all subdirectories?')) { |
|
forcepub(theform); |
|
theform.pubrec.value='1'; |
|
theform.submit(); |
|
} |
|
} |
|
|
|
function forcepub(theform) { |
|
if (confirm('Force publication of unmodified files? - Cancel=No; OK=yes.')) { |
|
theform.forcerepub.value="ON"; |
|
} |
|
} |
|
|
|
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 273 parent.lastknownpriv='/~$uname$thisdisfn
|
Line 249 parent.lastknownpriv='/~$uname$thisdisfn
|
return |
return |
} |
} |
if (theform.diraction.options[theform.diraction.selectedIndex].value == "publish") { |
if (theform.diraction.options[theform.diraction.selectedIndex].value == "publish") { |
pubdir(theform) |
theform.submit(); |
} |
|
if (theform.diraction.options[theform.diraction.selectedIndex].value == "publishsub") { |
|
pubrecdir(theform) |
|
} |
} |
if (theform.diraction.options[theform.diraction.selectedIndex].value == "editcat") { |
if (theform.diraction.options[theform.diraction.selectedIndex].value == "editcat") { |
top.location=theform.filename.value+'default.meta' |
top.location=theform.filename.value+'default.meta' |
Line 306 parent.lastknownpriv='/~$uname$thisdisfn
|
Line 279 parent.lastknownpriv='/~$uname$thisdisfn
|
if (activity == 'obsolete') { |
if (activity == 'obsolete') { |
var pubform = document.pubresource |
var pubform = document.pubresource |
pubform.filename.value = theform.filename.value |
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() |
pubform.submit() |
} |
} |
if (activity == 'print') { |
if (activity == 'print') { |
Line 333 parent.lastknownpriv='/~$uname$thisdisfn
|
Line 306 parent.lastknownpriv='/~$uname$thisdisfn
|
ENDPUBDIRSCRIPT |
ENDPUBDIRSCRIPT |
$r->print($pubdirscript); |
$r->print($pubdirscript); |
|
|
if ((($uname ne $ENV{'user.name'}) || ($udom ne $ENV{'user.domain'})) && |
if ((($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) && |
$ENV{'environment.remote'} ne 'off') { |
$env{'environment.remote'} ne 'off') { |
$r->print('<h3>'.&mt('Co-Author').': '.$uname.' at '.$udom. |
$r->print('<h3>'.&mt('Co-Author').': '.$uname.' at '.$udom. |
'</h3>'); |
'</h3>'); |
} |
} |
Line 355 sub dircontrols {
|
Line 328 sub dircontrols {
|
<select name="dirtask" onChange="currdiract(this.form)"> |
<select name="dirtask" onChange="currdiract(this.form)"> |
<option>Select action</option> |
<option>Select action</option> |
<option value="publish">Publish directory</option> |
<option value="publish">Publish directory</option> |
<option value="publishsub">Publish with subdirectories</option> |
|
<option value="editcat">Edit catalog information</option> |
<option value="editcat">Edit catalog information</option> |
<option value="printdir">Print contents of directory</option> |
<option value="printdir">Print contents of directory</option> |
</select> |
</select> |
Line 364 sub dircontrols {
|
Line 336 sub dircontrols {
|
<form name="publishdir" method="post" action="/adm/publish" target="_parent"> |
<form name="publishdir" method="post" action="/adm/publish" target="_parent"> |
<input type="hidden" name="pubrec" value="" /> |
<input type="hidden" name="pubrec" value="" /> |
<input type="hidden" name="filename" value="" /> |
<input type="hidden" name="filename" value="" /> |
<input type="hidden" name="forcerepub" value="NO" /> |
|
</form> |
</form> |
<form name="printdir" method="post" action="/adm/printout" target="_parent"> |
<form name="printdir" method="post" action="/adm/printout" target="_parent"> |
<input type="hidden" name="postdata" value="" /> |
<input type="hidden" name="postdata" value="" /> |
Line 405 sub pubbuttons {
|
Line 376 sub pubbuttons {
|
$r->print('<form method="post" action="/adm/publish" target="_parent">'. |
$r->print('<form method="post" action="/adm/publish" target="_parent">'. |
'<table><tr><td><input type="hidden" name="filename" value="/~'. |
'<table><tr><td><input type="hidden" name="filename" value="/~'. |
$uname.$thisdisfn.'/" />'. |
$uname.$thisdisfn.'/" />'. |
'<input type="button" onClick="pubdir(this.form);" value="'. |
'<input type="submit" value="'.&mt('Publish Directory').'" /></td><td>'. |
&mt('Publish Directory').'" />'. |
|
'<input type="hidden" name="pubrec" value="" />'. |
|
'<input type="hidden" name="forcerepub" value="NO" />'. |
|
'<input type="button" onClick="pubrecdir(this.form);" value="'. |
|
&mt('Publish Directory and Sub Directories').'" /></td><td>'. |
|
'<input type="button" onClick="window.location='."'/~". |
'<input type="button" onClick="window.location='."'/~". |
$uname.$thisdisfn."/default.meta'".'" value="'. |
$uname.$thisdisfn."/default.meta'".'" value="'. |
&mt('Edit Directory Catalog Information').'" /></td></tr></table></form>'); |
&mt('Edit Directory Catalog Information').'" /></td></tr></table></form>'); |
Line 429 sub resourceactions {
|
Line 395 sub resourceactions {
|
<input type="hidden" name="action" value="delete" /> |
<input type="hidden" name="action" value="delete" /> |
</form> |
</form> |
<form name="pubresource" action="/adm/publish" target="_parent" method="post"> |
<form name="pubresource" action="/adm/publish" target="_parent" method="post"> |
<input type="hidden" name="pubrec" value="" /> |
|
<input type="hidden" name="filename" value="" /> |
<input type="hidden" name="filename" value="" /> |
<input type="hidden" name="forcerepub" value="NO" /> |
<input type="hidden" name="makeobsolete" value="0" /> |
</form> |
</form> |
<form name="printresource" action="/adm/printout" target="_parent" method="post"> |
<form name="printresource" action="/adm/printout" target="_parent" method="post"> |
<input type="hidden" name="postdata" value="" /> |
<input type="hidden" name="postdata" value="" /> |
Line 518 sub putdirectory {
|
Line 483 sub putdirectory {
|
'</select>'. |
'</select>'. |
'<input type="hidden" name="filename" value="'.$dirpath.'/'.$dirname.'/" />'. |
'<input type="hidden" name="filename" value="'.$dirpath.'/'.$dirname.'/" />'. |
'<input type="hidden" name="openname" value="'.$here.'/'.$dirname.'/" />'. |
'<input type="hidden" name="openname" value="'.$here.'/'.$dirname.'/" />'. |
'<input type="hidden" name="pubrec" value="" />'. |
|
'<input type="hidden" name="forcerepub" value="" />'. |
|
'<input type="hidden" name="postdata" value="" />'. |
'<input type="hidden" name="postdata" value="" />'. |
'</form>'; |
'</form>'; |
$$numdir ++; |
$$numdir ++; |
Line 545 sub putresource {
|
Line 508 sub putresource {
|
my ($r, $udom, $uname, $filename, $thisdisfn, |
my ($r, $udom, $uname, $filename, $thisdisfn, |
$resdir, $targetdir, $linkdir, |
$resdir, $targetdir, $linkdir, |
$cmtime,$bombs,$numres) = @_; |
$cmtime,$bombs,$numres) = @_; |
|
&Apache::lonnet::devalidate_cache_new('meta',$targetdir.'/'.$filename); |
my $pubstatus = 'unpublished'; |
my $pubstatus = 'unpublished'; |
my $status=&mt('Unpublished'); |
my $status=&mt('Unpublished'); |
my $bgcolor='#FFAA99'; |
my $bgcolor='#FFAA99'; |