version 1.6, 2019/01/27 15:44:18
|
version 1.6.2.1, 2019/02/07 14:56:05
|
Line 165 sub handler {
|
Line 165 sub handler {
|
} |
} |
} |
} |
my @allposs = keys(%possroles); |
my @allposs = keys(%possroles); |
if ($env{'request.lti.login'}) { |
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); |
|
if ($env{'request.lti.target'} eq '') { |
|
if ($env{'form.ltitarget'} eq 'iframe') { |
|
&Apache::lonnet::appenv({'request.lti.target' => 'iframe'}); |
|
delete($env{'form.ltitarget'}); |
|
} |
|
} |
|
if ($env{'form.selectrole'}) { |
|
foreach my $role (@allposs) { |
|
my $newrole = "$role./$cdom/$cnum"; |
|
if ($possroles{$allposs[0]} ne '') { |
|
$newrole .= "/$possroles{$role}"; |
|
} |
|
if ($env{"form.$newrole"}) { |
|
my $destination .= '/adm/roles?selectrole=1&'.$newrole.'=1'. |
|
'&destinationurl='.&HTML::Entities::encode($r->uri); |
|
if ($env{'form.ltitarget'} eq 'iframe') { |
|
$destination .= '<itarget=iframe'; |
|
} |
|
&do_redirect($r,$destination); |
|
return OK; |
|
} |
|
} |
|
} |
|
} |
|
if (@allposs == 0) { |
if (@allposs == 0) { |
&show_roles($r,\%crsenv,\%possroles); |
&show_roles($r,\%crsenv,\%possroles); |
} elsif (@allposs == 1) { |
} elsif (@allposs == 1) { |
Line 239 sub handler {
|
Line 213 sub handler {
|
sub do_redirect { |
sub do_redirect { |
my ($r,$destination) = @_; |
my ($r,$destination) = @_; |
my $windowname = 'loncapaclient'; |
my $windowname = 'loncapaclient'; |
if ($env{'request.lti.login'}) { |
|
$windowname .= 'lti'; |
|
} |
|
my $header = '<meta HTTP-EQUIV="Refresh" CONTENT="0; url='.$destination.'" />'; |
my $header = '<meta HTTP-EQUIV="Refresh" CONTENT="0; url='.$destination.'" />'; |
my $args = {'bread_crumbs' => [{'href' => '','text' => 'Role initialization'},],}; |
my $args = {'bread_crumbs' => [{'href' => '','text' => 'Role initialization'},],}; |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
Line 383 ENDJS
|
Line 354 ENDJS
|
sub generic_error { |
sub generic_error { |
my ($r) = @_; |
my ($r) = @_; |
my $continuelink; |
my $continuelink; |
unless ($env{'request.lti.login'}) { |
my $linktext; |
my $linktext; |
if ($env{'user.adv'}) { |
if ($env{'user.adv'}) { |
$linktext = &mt('Continue to your roles page'); |
$linktext = &mt('Continue to your roles page'); |
} else { |
} else { |
$linktext = &mt('Continue to your courses page'); |
$linktext = &mt('Continue to your courses page'); |
|
} |
|
$continuelink='<a href="/adm/roles">'.$linktext.'</a>'; |
|
} |
} |
|
$continuelink='<a href="/adm/roles">'.$linktext.'</a>'; |
my $msg = &mt('The page you requested does not exist.'); |
my $msg = &mt('The page you requested does not exist.'); |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |