version 1.116, 2008/12/05 09:41:59
|
version 1.122, 2009/05/28 17:08:38
|
Line 62 sub handler {
|
Line 62 sub handler {
|
&Apache::loncacc::constructaccess( |
&Apache::loncacc::constructaccess( |
$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.':'.$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); |
Line 74 sub handler {
|
Line 74 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'}.':'.$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 159 sub getEffectiveUrl {
|
Line 159 sub getEffectiveUrl {
|
# 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. |
# |
# |
$fn=~s/^http\:\/\/[^\/]+\///; |
$fn=~s/^https?\:\/\/[^\/]+\///; |
$fn=~s/^\///; |
$fn=~s/^\///; |
$fn=~s{~($LONCAPA::username_re)}{/home/$1/public_html}; |
$fn=~s{~($LONCAPA::username_re)}{/home/$1/public_html}; |
|
|
Line 199 sub startpage {
|
Line 199 sub startpage {
|
|
|
my $formaction='/priv/'.$uname.$thisdisfn.'/'; |
my $formaction='/priv/'.$uname.$thisdisfn.'/'; |
$formaction=~s|/+|/|g; |
$formaction=~s|/+|/|g; |
my $pagetitle .= &Apache::loncommon::help_open_menu('','',3,'Authoring'). |
|
'<font face="Arial, Helvetica, sans-serif" size="+1"><b>'.&mt('Construction Space').'</b>:</font> '. |
|
'<form name="dirs" method="post" action="'.$formaction. |
|
'" target="_parent"><tt><b>'. |
|
&Apache::lonhtmlcommon::crumbs($uname.$thisdisfn.'/','_top','/priv','','+1',1)."</b></tt><br />". |
|
&Apache::lonhtmlcommon::select_recent('construct','recent', |
|
'this.form.action=this.form.recent.value;this.form.submit()'). |
|
'</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::start_page('Construction Space',undef, |
$r->print(&Apache::loncommon::start_page('Construction Space',undef)); |
{'body_title' => |
|
$pagetitle,})); |
|
} else { |
} else { |
$r->print(&Apache::loncommon::start_page('Construction Space',undef, |
$r->print(&Apache::loncommon::start_page('Construction Space',undef, |
{ 'only_body' => 1,})); |
{ 'only_body' => 1,})); |
$r->print($pagetitle); |
|
} |
} |
|
|
|
# Breadcrumbs |
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
&Apache::lonhtmlcommon::add_breadcrumb({ |
|
'text' => 'Construction Space', |
|
'href' => &Apache::loncommon::authorspace(), |
|
}); |
|
|
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs()); |
|
|
|
$r->print(&Apache::loncommon::head_subbox( |
|
&Apache::loncommon::CSTR_pageheader(1))); |
|
|
my $esc_thisdisfn = &Apache::loncommon::escape_single($thisdisfn); |
my $esc_thisdisfn = &Apache::loncommon::escape_single($thisdisfn); |
my $doctitle = 'LON-CAPA '.&mt('Construction Space'); |
my $doctitle = 'LON-CAPA '.&mt('Construction Space'); |
my $newname = &mt('New Name'); |
my $newname = &mt('New Name'); |
Line 333 ENDPUBDIRSCRIPT
|
Line 335 ENDPUBDIRSCRIPT
|
|
|
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 [_1]',$uname.':'.$udom).'</h3>'); |
'</h3>'); |
|
} |
} |
} |
} |
|
|
Line 376 sub dircontrols {
|
Line 377 sub dircontrols {
|
); |
); |
my $mytype = $lt{'type'}; # avoid conflict with " and ' in javascript |
my $mytype = $lt{'type'}; # avoid conflict with " and ' in javascript |
$r->print(<<END); |
$r->print(<<END); |
<div class="columnSection"> |
<div class="LC_columnSection"> |
<div> |
<div> |
<form name="curractions" method="post" action=""> |
<form name="curractions" method="post" action=""> |
<fieldset> |
<fieldset> |
Line 456 sub pubbuttons {
|
Line 457 sub pubbuttons {
|
'<input type="submit" value="'.&mt('Publish Directory').'" /></td><td>'. |
'<input type="submit" value="'.&mt('Publish Directory').'" /></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 Metadata').'" /></td></tr></table></form>'); |
} |
} |
|
|
sub resourceactions { |
sub resourceactions { |