version 1.15, 2012/10/29 17:38:55
|
version 1.18, 2016/06/19 04:27:58
|
Line 55 sub handler {
|
Line 55 sub handler {
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
if ($env{'request.role'} =~ /^(au|ca|aa)/) { |
if ($env{'request.role'} =~ /^(au|ca|aa)/) { |
&Apache::lonhtmlcommon::add_breadcrumb({ |
&Apache::lonhtmlcommon::add_breadcrumb({ |
'text' => 'Construction Space', |
'text' => 'Authoring Space', |
'href' => &Apache::loncommon::authorspace($env{'request.editurl'}), |
'href' => &Apache::loncommon::authorspace($env{'request.editurl'}), |
}); |
}); |
} elsif (($env{'request.course.id'}) && |
} elsif (($env{'request.course.id'}) && |
Line 67 sub handler {
|
Line 67 sub handler {
|
} |
} |
|
|
# print header |
# print header |
$r->print(&Apache::loncommon::start_page("Failed Access to Construction Space", |
$r->print(&Apache::loncommon::start_page("Failed Access to Authoring Space", |
undef, |
undef, |
{'domain' => $ownerdomain,}). |
{'domain' => $ownerdomain,}). |
&Apache::lonhtmlcommon::breadcrumbs()); |
&Apache::lonhtmlcommon::breadcrumbs()); |
Line 85 sub handler {
|
Line 85 sub handler {
|
my $switchlink = '/adm/switchserver?otherserver='.$ownerhome. |
my $switchlink = '/adm/switchserver?otherserver='.$ownerhome. |
'&origurl='.&HTML::Entities::encode($env{'request.editurl'},'<>&"'); |
'&origurl='.&HTML::Entities::encode($env{'request.editurl'},'<>&"'); |
$r->print('<p class="LC_warning">'. |
$r->print('<p class="LC_warning">'. |
&mt('The construction space for this resource is located on a different server: [_1]', |
&mt('The Authoring Space for this resource is located on a different server: [_1]', |
'<b><tt>'.&Apache::lonnet::hostname($ownerhome).'</b></tt>'). |
'<b><tt>'.&Apache::lonnet::hostname($ownerhome).'</b></tt>'). |
'</p>'. |
'</p>'. |
'<p class="LC_error"><a href="'.$switchlink.'">'. |
'<p class="LC_error"><a href="'.$switchlink.'">'. |
Line 179 sub handler {
|
Line 179 sub handler {
|
&mt('There is a problem with the filename').' '. |
&mt('There is a problem with the filename').' '. |
'<span class="LC_filename">'.$r->uri.'</span></p>'. |
'<span class="LC_filename">'.$r->uri.'</span></p>'. |
'<p class="LC_warning">'. |
'<p class="LC_warning">'. |
&mt('You may be attempting to edit a versioned file (files in construction space may not include a version number before the extension).'). |
&mt('You may be attempting to edit a versioned file (files in Authoring Space may not include a version number before the extension).'). |
'</p>'); |
'</p>'); |
} else { |
} else { |
$r->print('<p class="LC_error">'. |
$r->print('<p class="LC_error">'. |
Line 191 sub handler {
|
Line 191 sub handler {
|
&mt('There is a problem with the filename').' '. |
&mt('There is a problem with the filename').' '. |
'<span class="LC_filename">'.$env{'request.editurl'}.'</span></p>'. |
'<span class="LC_filename">'.$env{'request.editurl'}.'</span></p>'. |
'<p class="LC_warning">'. |
'<p class="LC_warning">'. |
&mt('You may be attempting to edit a versioned file (files in construction space may not include a version number before the extension).'). |
&mt('You may be attempting to edit a versioned file (files in Authoring Space may not include a version number before the extension).'). |
'</p>'); |
'</p>'); |
} else { |
} else { |
$r->print('<p class="LC_error">' |
$r->print('<p class="LC_error">' |
Line 203 sub handler {
|
Line 203 sub handler {
|
my $realownerhome= |
my $realownerhome= |
&Apache::lonnet::homeserver($realownername,$realownerdom); |
&Apache::lonnet::homeserver($realownername,$realownerdom); |
unless ($realownerhome eq 'no_host') { |
unless ($realownerhome eq 'no_host') { |
my $plainname=&Apache::loncommon::plainname($realownername,$realownerdom); |
if (&Apache::lonnet::is_course($realownerdom,$realownername)) { |
my $user=$realownername.':'.$realownerdom; |
my $ccrole = 'cc'; |
my $userlink=&Apache::loncommon::aboutmewrapper( |
my %crsenv = &Apache::lonnet::coursedescription("$realownerdom/$realownername",{one_time => 1}); |
$plainname.' ('.$user.')' |
my $cdesc = $crsenv{'description'}; |
,$realownername |
my $crstype = $crsenv{'type'}; |
,$realownerdom); |
if ($crstype eq 'Community') { |
$r->print('<p>' |
$ccrole = 'co'; |
.&mt('Contact [_1] for access.',$userlink) |
} |
.'</p>'); |
my $rolename = $crsenv{$ccrole.'.plaintext'}; |
|
if ($rolename eq '') { |
|
$rolename = &Apache::lonnet::plaintext($ccrole,$crstype,$realownerdom.'_'.$realownername,1); |
|
} |
|
my $allowed = &Apache::lonnet::allowed('mdc',$realownerdom.'_'.$realownername); |
|
if (!$allowed) { |
|
my %roleshash = &Apache::lonnet::get_my_roles('','','userroles',['active'], |
|
[$ccrole],[$realownerdom]); |
|
if (exists($roleshash{$realownername.':'.$realownerdom.':'.$ccrole})) { |
|
$r->print(&mt('[_1]Switch role[_2] for access', |
|
'<a href="/adm/roles?selectrole=1&'. |
|
&HTML::Entities::encode($ccrole."./$realownerdom/$realownername".'=1','<>&"'). |
|
'&orgurl='.&HTML::Entities::encode($env{'request.editurl'},'<>&"'). |
|
'">','<a/>')); |
|
} else { |
|
if ($crstype eq 'Community') { |
|
$r->print('<p>' |
|
.&mt('Contact a [_1] in the community ([_2]) for access.',$rolename,$cdesc) |
|
.'</p>'); |
|
} else { |
|
$r->print('<p>' |
|
.&mt('Contact a [_1] in the course ([_2]) for access.',$rolename,$cdesc) |
|
.'</p>'); |
|
} |
|
} |
|
} |
|
} else { |
|
my $plainname=&Apache::loncommon::plainname($realownername,$realownerdom); |
|
my $user=$realownername.':'.$realownerdom; |
|
my $userlink=&Apache::loncommon::aboutmewrapper( |
|
$plainname.' ('.$user.')' |
|
,$realownername |
|
,$realownerdom); |
|
$r->print('<p>' |
|
.&mt('Contact [_1] for access.',$userlink) |
|
.'</p>'); |
|
} |
} |
} |
} |
} |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |