version 1.269.2.39.2.8, 2023/12/30 00:07:09
|
version 1.269.2.42, 2024/12/29 02:02:29
|
Line 145 use LONCAPA qw(:DEFAULT :match);
|
Line 145 use LONCAPA qw(:DEFAULT :match);
|
use HTML::Entities; |
use HTML::Entities; |
|
|
sub start_loading_course { |
sub start_loading_course { |
my ($r,$title,$only_body) = @_; |
my ($r,$title) = @_; |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
if ($only_body) { |
my $swinfo=&Apache::lonmenu::rawconfig(); |
$r->print(&Apache::loncommon::start_page($title,undef,{'only_body' => 1, |
# Breadcrumbs |
'add_progressbar' => 1})); |
my $brcrum = [{'href' => '', |
} else { |
'text' => $title},]; |
my $swinfo=&Apache::lonmenu::rawconfig(); |
my $start_page = &Apache::loncommon::start_page($title,undef, |
# Breadcrumbs |
{'bread_crumbs' => $brcrum, |
my $brcrum = [{'href' => '', |
'bread_crumbs_nomenu' => 1, |
'text' => $title},]; |
'links_disabled' => 1}); |
my $start_page = &Apache::loncommon::start_page($title,undef, |
$r->print(<<ENDREDIR); |
{'bread_crumbs' => $brcrum, |
|
'bread_crumbs_nomenu' => 1, |
|
'links_disabled' => 1}); |
|
$r->print(<<ENDREDIR); |
|
$start_page |
$start_page |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
Line 176 document.body.addEventListener('click',
|
Line 172 document.body.addEventListener('click',
|
// ]]> |
// ]]> |
</script> |
</script> |
ENDREDIR |
ENDREDIR |
} |
|
return; |
return; |
} |
} |
|
|
sub finish_loading_course { |
sub finish_loading_course { |
my ($r,$msg,$url,$only_body) = @_; |
my ($r,$msg,$url) = @_; |
my $link = '<div id="LC_course_loaded" style="display:none"><a href="'. |
my $link = '<div id="LC_course_loaded" style="display:none"><a href="'. |
&HTML::Entities::encode($url,'"<>&').'">'.&mt('Continue').'</a></div>'; |
&HTML::Entities::encode($url,'"<>&').'">'.&mt('Continue').'</a></div>'; |
my $end_page = &Apache::loncommon::end_page(); |
my $end_page = &Apache::loncommon::end_page(); |
my $js_url = &js_escape($url); |
my $js_url = &js_escape($url); |
my $remote_js; |
|
if ($env{'environment.remote'} eq 'on') { |
|
my ($menucoll,$deeplinkmenu,$menuref) = &Apache::loncommon::menucoll_in_effect(); |
|
if ($menucoll) { |
|
&Apache::lonnet::put('environment',{'remote' => 'off'}); |
|
&Apache::lonnet::appenv({'environment.remote' => 'off'}); |
|
my $menu_name = &Apache::lonmenu::get_menu_name(); |
|
$remote_js = <<ENDCLOSE; |
|
window.status='Accessing Remote Control'; |
|
menu=window.open("/adm/rat/empty.html","$menu_name", |
|
"height=350,width=150,scrollbars=no,menubar=no"); |
|
window.status='Disabling Remote Control'; |
|
menu.active=0; |
|
menu.autologout=0; |
|
window.status='Closing Remote Control'; |
|
menu.close(); |
|
window.status='Done.'; |
|
ENDCLOSE |
|
} |
|
} |
|
my $reenable; |
|
unless ($only_body) { |
|
$reenable = <<REENABLE; |
|
\$('.isDisabled > a').removeAttr("aria-disabled"); |
|
\$('.isDisabled').removeClass("isDisabled"); |
|
REENABLE |
|
} |
|
$r->print(<<END); |
$r->print(<<END); |
$msg |
$msg |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
\$(document).ready(function() { |
\$(document).ready(function() { |
\$("#LC_course_loaded").css("display","block"); |
\$("#LC_course_loaded").css("display","block"); |
$reenable |
\$('.isDisabled > a').removeAttr("aria-disabled"); |
$remote_js |
\$('.isDisabled').removeClass("isDisabled"); |
var url = "$js_url"; |
var url = "$js_url"; |
\$(location).attr('href',url); |
\$(location).attr('href',url); |
}); |
}); |
Line 289 sub handler {
|
Line 257 sub handler {
|
my $r = shift; |
my $r = shift; |
|
|
# Check for critical messages and redirect if present. |
# Check for critical messages and redirect if present. |
my ($redirect,$url) = &Apache::loncommon::critical_redirect(300,'roles'); |
my ($redirect,$url) = &Apache::loncommon::critical_redirect(300); |
if ($redirect) { |
if ($redirect) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->header_out(Location => $url); |
$r->header_out(Location => $url); |
Line 307 sub handler {
|
Line 275 sub handler {
|
$update = $then; |
$update = $then; |
} |
} |
|
|
my ($norolelist,$blocked_by_ip,$blocked_type,$clientip); |
my ($blocked_by_ip,$blocked_type,$clientip); |
$clientip = &Apache::lonnet::get_requestor_ip($r); |
$clientip = &Apache::lonnet::get_requestor_ip($r); |
if (($env{'request.course.id'}) && ($env{'request.deeplink.login'})) { |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
|
my $deeplink_symb = &Apache::loncommon::deeplink_login_symb($cnum,$cdom); |
|
if ($deeplink_symb) { |
|
my ($menucoll,$deeplinkmenu,$menuref) = &Apache::loncommon::menucoll_in_effect(); |
|
if (ref($menuref) eq 'HASH') { |
|
unless (($menuref->{'role'}) || ($env{'request.role.adv'})) { |
|
foreach my $envkey (keys(%env)) { |
|
next unless ($envkey =~ /^form\./); |
|
if ($envkey =~ m{\./($match_domain)/($match_courseid)(?:/(\w+)|$)}) { |
|
unless (($1 eq $cdom) && ($2 eq $cnum)) { |
|
delete($env{$envkey}); |
|
} |
|
} |
|
} |
|
if ($env{'form.selectrole'}) { |
|
if ($env{'form.switchrole'} =~ m{\./($match_domain)/($match_courseid)(?:/(\w+)|$)}) { |
|
unless (($1 eq $cdom) && ($2 eq $cnum)) { |
|
delete($env{'form.selectrole'}); |
|
delete($env{'form.switchrole'}); |
|
} |
|
} elsif ($env{'form.newrole'} =~ m{\./($match_domain)/($match_courseid)(?:/(\w+)|$)}) { |
|
unless (($1 eq $cdom) && ($2 eq $cnum)) { |
|
delete($env{'form.selectrole'}); |
|
delete($env{'form.newrole'}); |
|
} |
|
} |
|
} |
|
$norolelist = 1; |
|
} |
|
} |
|
} |
|
} |
|
|
|
if ($env{'form.selectrole'}) { |
if ($env{'form.selectrole'}) { |
my ($role,$cdom,$cnum,$rest); |
my ($role,$cdom,$cnum,$rest); |
Line 508 sub handler {
|
Line 441 sub handler {
|
"request.course.sec" => '', |
"request.course.sec" => '', |
"request.course.tied" => '', |
"request.course.tied" => '', |
"request.course.timechecked" => '', |
"request.course.timechecked" => '', |
"request.course.suppupdated" => '', |
|
"request.role" => 'cm', |
"request.role" => 'cm', |
"request.role.adv" => $env{'user.adv'}, |
"request.role.adv" => $env{'user.adv'}, |
"request.role.domain" => $env{'user.domain'}}); |
"request.role.domain" => $env{'user.domain'}}); |
Line 707 sub handler {
|
Line 639 sub handler {
|
$env{'user.name'}, |
$env{'user.name'}, |
&mt('Assigned from [_1] at [_2] for [_3]' |
&mt('Assigned from [_1] at [_2] for [_3]' |
,$ip |
,$ip |
,&Apache::lonlocal::locallocaltime() |
,&Apache::lonlocal::locallocaltime($now) |
,$trolecode) |
,$trolecode) |
); |
); |
unless ($assignresult eq 'ok') { |
unless ($assignresult eq 'ok') { |
Line 785 ENDENTERKEY
|
Line 717 ENDENTERKEY
|
} |
} |
my $crstype = &Apache::loncommon::course_type($cdom.'_'.$cnum); |
my $crstype = &Apache::loncommon::course_type($cdom.'_'.$cnum); |
$crstype = lc($crstype); |
$crstype = lc($crstype); |
my ($msg,$critmsg_check,$title,$loadmsg,$only_body); |
|
$critmsg_check = 1; |
|
$title = &mt("Loading $crstype"); |
|
$loadmsg = &mt("Please be patient while your $crstype loads"); |
|
if (($env{'request.deeplink.login'}) && ($env{'request.linkprot'})) { |
|
if ($env{'request.linkprot'} =~ /^\d+(c|d):\Q$env{'form.destinationurl'}\E$/) { |
|
$title = &mt('Loading LON-CAPA session'); |
|
$loadmsg = &mt('Please be patient while LON-CAPA loads'); |
|
$only_body = 1; |
|
$critmsg_check = 0; |
|
} |
|
} |
|
my $preamble = '<div id="LC_update_'.$cdom.'_'.$cnum.'" class="LC_info">'. |
my $preamble = '<div id="LC_update_'.$cdom.'_'.$cnum.'" class="LC_info">'. |
'<br />'. |
'<br />'. |
$loadmsg. |
&mt("Please be patient while your $crstype loads"). |
'<br /></div>'. |
'<br /></div>'. |
'<div style="padding:0;clear:both;margin:0;border:0"></div>'; |
'<div style="padding:0;clear:both;margin:0;border:0"></div>'; |
my $closure = <<ENDCLOSE; |
my $closure = <<ENDCLOSE; |
Line 809 ENDENTERKEY
|
Line 729 ENDENTERKEY
|
// ]]> |
// ]]> |
</script> |
</script> |
ENDCLOSE |
ENDCLOSE |
&start_loading_course($r,$title,$only_body); |
my $title = &mt("Loading $crstype"); |
|
&start_loading_course($r,$title); |
my %prog_state = &Apache::lonhtmlcommon::Create_PrgWin($r,undef,$preamble); |
my %prog_state = &Apache::lonhtmlcommon::Create_PrgWin($r,undef,$preamble); |
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Loading ...')); |
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Loading ...')); |
$r->rflush(); |
$r->rflush(); |
if ($critmsg_check) { |
my ($msg,$critmsg_check); |
my $blockcrit = &Apache::loncommon::blocking_status('alert',$clientip,$cnum,$cdom,undef,1); |
$critmsg_check = 1; |
if ($blockcrit) { |
|
my $checkrole = "cm./$cdom/$cnum"; |
|
if ($csec ne '') { |
|
$checkrole .= "/$csec"; |
|
} |
|
unless ((&Apache::lonnet::allowed('evb',undef,undef,$checkrole)) && |
|
($trolecode !~ m{^st\./$cdom/$cnum})) { |
|
$critmsg_check = 0; |
|
} |
|
} |
|
} |
|
my ($furl,$ferr)= |
my ($furl,$ferr)= |
&Apache::lonuserstate::readmap($cdom.'/'.$cnum,$critmsg_check); |
&Apache::lonuserstate::readmap($cdom.'/'.$cnum,$critmsg_check); |
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Finished!')); |
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Finished!')); |
Line 864 ENDCLOSE
|
Line 774 ENDCLOSE
|
my ($feeds,$syllabus_time); |
my ($feeds,$syllabus_time); |
&Apache::lonrss::advertisefeeds($cnum,$cdom,undef,\$feeds); |
&Apache::lonrss::advertisefeeds($cnum,$cdom,undef,\$feeds); |
&Apache::lonnet::appenv({'request.course.feeds' => $feeds}); |
&Apache::lonnet::appenv({'request.course.feeds' => $feeds}); |
|
&Apache::lonnet::get_numsuppfiles($cnum,$cdom,1); |
unless ($env{'course.'.$cdom.'_'.$cnum.'.updatedsyllabus'}) { |
unless ($env{'course.'.$cdom.'_'.$cnum.'.updatedsyllabus'}) { |
unless (($env{'course.'.$cdom.'_'.$cnum.'.externalsyllabus'}) || |
unless (($env{'course.'.$cdom.'_'.$cnum.'.externalsyllabus'}) || |
($env{'course.'.$cdom.'_'.$cnum.'.uploadedsyllabus'})) { |
($env{'course.'.$cdom.'_'.$cnum.'.uploadedsyllabus'})) { |
Line 896 ENDCLOSE
|
Line 807 ENDCLOSE
|
if ($env{'form.symb'}) { |
if ($env{'form.symb'}) { |
$furl .= '&symb='.&HTML::Entities::encode($env{'form.symb'},'<>&"'); |
$furl .= '&symb='.&HTML::Entities::encode($env{'form.symb'},'<>&"'); |
} |
} |
} else { |
|
&set_supplemental_access($cnum,$cdom); |
|
} |
} |
if (($ferr) && ($tadv)) { |
if (($ferr) && ($tadv)) { |
&error_page($r,$ferr,$furl); |
&error_page($r,$ferr,$furl); |
Line 929 ENDCLOSE
|
Line 838 ENDCLOSE
|
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
} else { |
} else { |
if ($env{'request.deeplink.login'}) { |
|
&set_deeplink_target($cnum,$cdom); |
|
} |
|
$msg = '<p>'.&mt('Entering [_1] ...', |
$msg = '<p>'.&mt('Entering [_1] ...', |
$env{'course.'.$cdom.'_'.$cnum.'.description'}). |
$env{'course.'.$cdom.'_'.$cnum.'.description'}). |
'</p>'; |
'</p>'; |
&finish_loading_course($r,$msg,$dest,$only_body); |
&finish_loading_course($r,$msg,$dest); |
} |
} |
} |
} |
$r->rflush(); |
$r->rflush(); |
Line 959 ENDCLOSE
|
Line 865 ENDCLOSE
|
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
} else { |
} else { |
&set_supplemental_access($cnum,$cdom); |
|
if ($env{'request.deeplink.login'}) { |
|
&set_deeplink_target($cnum,$cdom); |
|
} |
|
# Check to see if the user is a CC entering a course |
# Check to see if the user is a CC entering a course |
# for the first time |
# for the first time |
if ((($role eq 'cc') || ($role eq 'co')) |
if ((($role eq 'cc') || ($role eq 'co')) |
Line 1029 ENDCLOSE
|
Line 931 ENDCLOSE
|
$dest .= (($dest =~/\?/)? '&':'?').'symb='.$esc_symb; |
$dest .= (($dest =~/\?/)? '&':'?').'symb='.$esc_symb; |
} |
} |
} |
} |
if ($env{'form.ttoken'}) { |
$msg = '<p>'.&mt('Entering [_1] ...', |
$dest .= (($dest =~/\?/)? '&':'?').'ttoken='.$env{'form.ttoken'}; |
$env{'course.'.$cdom.'_'.$cnum.'.description'}). |
} |
'</p>'; |
unless ($env{'request.deeplink.login'}) { |
&finish_loading_course($r,$msg,$dest); |
$msg = '<p>'.&mt('Entering [_1] ...', |
|
$env{'course.'.$cdom.'_'.$cnum.'.description'}). |
|
'</p>'; |
|
} |
|
&finish_loading_course($r,$msg,$dest,$only_body); |
|
$r->rflush(); |
$r->rflush(); |
return OK; |
return OK; |
} |
} |
Line 1052 ENDCLOSE
|
Line 949 ENDCLOSE
|
$msg = '<p>'.&mt('Entering [_1] ...', |
$msg = '<p>'.&mt('Entering [_1] ...', |
$env{'course.'.$cdom.'_'.$cnum.'.description'}). |
$env{'course.'.$cdom.'_'.$cnum.'.description'}). |
'</p>'; |
'</p>'; |
&finish_loading_course($r,$msg,'/adm/whatsnew?refpage=start',$only_body); |
&finish_loading_course($r,$msg,'/adm/whatsnew?refpage=start'); |
$r->rflush(); |
$r->rflush(); |
return OK; |
return OK; |
} |
} |
Line 1092 ENDCLOSE
|
Line 989 ENDCLOSE
|
} else { |
} else { |
$access = &Apache::lonnet::allowed('bre',$unencfurl); |
$access = &Apache::lonnet::allowed('bre',$unencfurl); |
} |
} |
if ((!$access) || ($access eq 'B') || ($access eq 'D')) { |
if ((!$access) || ($access eq 'B')) { |
$furl = &Apache::lonpageflip::first_accessible_resource(); |
$furl = &Apache::lonpageflip::first_accessible_resource(); |
if ($furl eq '') { |
if ($furl eq '') { |
$furl = '/adm/navmaps?showOnlyHomework=1'; |
$furl = '/adm/navmaps?showOnlyHomework=1'; |
Line 1101 ENDCLOSE
|
Line 998 ENDCLOSE
|
$msg = '<p>'.&mt('Entering [_1] ...', |
$msg = '<p>'.&mt('Entering [_1] ...', |
$env{'course.'.$cdom.'_'.$cnum.'.description'}). |
$env{'course.'.$cdom.'_'.$cnum.'.description'}). |
'</p>'; |
'</p>'; |
&finish_loading_course($r,$msg,$furl,$only_body); |
&finish_loading_course($r,$msg,$furl); |
} |
} |
$r->rflush(); |
$r->rflush(); |
return OK; |
return OK; |
Line 1117 ENDCLOSE
|
Line 1014 ENDCLOSE
|
$redirect_url .= $where; |
$redirect_url .= $where; |
} |
} |
$redirect_url .= '/'; |
$redirect_url .= '/'; |
if ($env{'form.orgurl'} =~ /^\Q$redirect_url\E/) { |
|
my ($path) = ($env{'form.orgurl'} =~ m{^(.+)/[^/]+$}); |
|
if (($path ne '') && (-e $Apache::lonnet::perlvar{'lonDocRoot'}.$path)) { |
|
$redirect_url = $env{'form.orgurl'}; |
|
} |
|
} |
|
&redirect_user($r,&mt('Entering Authoring Space'), |
&redirect_user($r,&mt('Entering Authoring Space'), |
$redirect_url); |
$redirect_url); |
return OK; |
return OK; |
Line 1175 ENDCLOSE
|
Line 1066 ENDCLOSE
|
$recent = &mt('Recent Courses'); |
$recent = &mt('Recent Courses'); |
$standby = &mt('Course selected. Please stand by.'); |
$standby = &mt('Course selected. Please stand by.'); |
} |
} |
if (($norolelist) && ((split(/:/,$env{'user.error.msg'}))[2])) { |
|
$crumbtext = 'Access Denied'; |
|
$pagetitle = 'Unauthorized'; |
|
} |
|
my $brcrum =[{href=>"/adm/roles",text=>$crumbtext}]; |
my $brcrum =[{href=>"/adm/roles",text=>$crumbtext}]; |
|
|
my %roles_in_env; |
my %roles_in_env; |
Line 1190 ENDCLOSE
|
Line 1077 ENDCLOSE
|
if ($domdefs{'catauth'}) { |
if ($domdefs{'catauth'}) { |
$cattype = $domdefs{'catauth'}; |
$cattype = $domdefs{'catauth'}; |
} |
} |
my ($funcs,$crumbsright); |
my ($funcs,$crumbsright,$crumbs_style); |
unless (($norolelist) && ((split(/:/,$env{'user.error.msg'}))[2])) { |
$funcs = &get_roles_functions($showcount,$cattype); |
$funcs = &get_roles_functions($showcount,$cattype); |
if ($env{'browser.mobile'}) { |
if ($env{'browser.mobile'}) { |
$crumbsright = $funcs; |
$crumbsright = $funcs; |
undef($funcs); |
undef($funcs); |
$crumbs_style = 'overflow: visible;'; |
} |
|
} |
} |
my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum, |
my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum, |
bread_crumbs_component=>$crumbsright}); |
bread_crumbs_component=>$crumbsright, |
|
bread_crumbs_style=>$crumbs_style,}); |
&js_escape(\$standby); |
&js_escape(\$standby); |
my $noscript='<br /><span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />'; |
my $noscript='<br /><span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />'; |
|
|
Line 1303 ENDHEADER
|
Line 1190 ENDHEADER
|
} |
} |
if ($nochoose) { |
if ($nochoose) { |
$r->print("<h2>".&mt('Sorry ...')."</h2>\n<span class='LC_error'>". |
$r->print("<h2>".&mt('Sorry ...')."</h2>\n<span class='LC_error'>". |
&mt('This action is currently not authorized.').'</span>'); |
&mt('This action is currently not authorized.').'</span>'. |
if ($error && $norolelist) { |
&Apache::loncommon::end_page()); |
$r->print('<br /><br /><h4><span class="LC_error">'. |
|
&mt('As your session was launched from a web page external to LON-CAPA some course content may be unavailable, including the resource you were trying to access.'). |
|
'</span></h4>'. |
|
'<h4><span class="LC_error">'. |
|
&mt('You may need to login to LON-CAPA directly, or re-launch from a different external system.'). |
|
'</span></h4>'); |
|
} |
|
$r->print(&Apache::loncommon::end_page()); |
|
return OK; |
return OK; |
} else { |
} else { |
if ($updateresult || $reqauthor || $hotlist) { |
if ($updateresult || $reqauthor || $hotlist) { |
Line 1382 ENDHEADER
|
Line 1261 ENDHEADER
|
} |
} |
} |
} |
|
|
if ($norolelist) { |
|
if ($env{'request.role'}) { |
|
my ($roletext,$role_text_end) = &display_curr_role($env{'request.role'}); |
|
if ($roletext) { |
|
$r->print(&Apache::loncommon::start_data_table('LC_textsize_mobile'). |
|
&Apache::loncommon::start_data_table_row(). |
|
$roletext. |
|
&Apache::loncommon::end_data_table_row()); |
|
if ($role_text_end) { |
|
$r->print(&Apache::loncommon::continue_data_table_row(). |
|
$role_text_end. |
|
&Apache::loncommon::end_data_table_row()); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table()); |
|
} |
|
} |
|
$r->print(&Apache::loncommon::end_page()); |
|
return OK; |
|
} |
|
|
|
# No active roles |
# No active roles |
if ($countactive==0) { |
if ($countactive==0) { |
my $elapsed = 0; |
my $elapsed = 0; |
Line 1702 sub gather_roles {
|
Line 1561 sub gather_roles {
|
$adhocdesc{$tdom}{$rolename} = $domdef{'adhocroles'}{$rolename}{'desc'}; |
$adhocdesc{$tdom}{$rolename} = $domdef{'adhocroles'}{$rolename}{'desc'}; |
} |
} |
} |
} |
$desc = $adhocdesc{$tdom}{$rolename}; |
$desc = $adhocdesc{$tdom}{$rolename}; |
} |
} |
} |
} |
if ($desc ne '') { |
if ($desc ne '') { |
Line 2141 sub build_roletext {
|
Line 2000 sub build_roletext {
|
$trolecode."','".$buttonname.'\');" /></td>'; |
$trolecode."','".$buttonname.'\');" /></td>'; |
} |
} |
} |
} |
if (($trolecode !~ m/^(dc|ca|au|aa)\./) && (!$skipcal)) { |
if (($trolecode !~ m/^(ca|aa)\./) && ($trest ne '') && (!$skipcal)) { |
$tremark.=&Apache::lonannounce::showday(time,1, |
$tremark.=&Apache::lonannounce::showday(time,1, |
&Apache::lonannounce::readcalendar($tdom.'_'.$trest)); |
&Apache::lonannounce::readcalendar($tdom.'_'.$trest)); |
} |
} |
Line 2408 sub display_cc_role {
|
Line 2267 sub display_cc_role {
|
return ($roletext,$roletext_end); |
return ($roletext,$roletext_end); |
} |
} |
|
|
sub display_curr_role { |
|
my ($currentrole) = @_; |
|
my ($roletext,$roletext_end); |
|
my $advanced = $env{'user.adv'}; |
|
my $tryagain = $env{'form.tryagain'}; |
|
my ($role,$rest) = split(m{\./},$currentrole,2); |
|
unless (!defined($role) || $role eq '') { |
|
if ($rest =~ m{^($match_domain)/($match_courseid)(?:/(\w+)|$)}) { |
|
my $cdom = $1; |
|
my $cnum = $2; |
|
my $csec = $3; |
|
my $cid = $cdom.'_'.$cnum; |
|
my $ttype = $env{'course.'.$cid.'.type'}; |
|
my $skipcal = 1; |
|
my $tbg='LC_roles_is'; |
|
my $twhere = $env{'course.'.$cid.'.description'}. |
|
' <span class="LC_fontsize_small">'. |
|
&Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$cnum,$cdom). |
|
'</span>'; |
|
my $trole = &Apache::lonnet::plaintext($role,$ttype,$cid); |
|
if ($csec) { |
|
$twhere.= ' '.&mt('Section').': '.$csec; |
|
} |
|
if ($role ne 'st') { |
|
$twhere.= ' '.&mt('Domain').': '.$cdom; |
|
} |
|
($roletext,$roletext_end) = &build_roletext($currentrole,$cdom,$cnum,'is',$tryagain,$advanced,'',$tbg,$trole,$twhere,'','','',1,'','','',$skipcal); |
|
} |
|
} |
|
return ($roletext,$roletext_end); |
|
} |
|
|
|
sub adhoc_roles_row { |
sub adhoc_roles_row { |
my ($dcdom,$rowtype) = @_; |
my ($dcdom,$rowtype) = @_; |
my $output = &Apache::loncommon::continue_data_table_row() |
my $output = &Apache::loncommon::continue_data_table_row() |
Line 3422 sub get_queued {
|
Line 3249 sub get_queued {
|
$output.'</fieldset></div><br clear="all" />'; |
$output.'</fieldset></div><br clear="all" />'; |
} |
} |
|
|
sub set_deeplink_target { |
|
my ($cnum,$cdom) = @_; |
|
if (($cnum ne '') && ($cdom ne '')) { |
|
my $deeplink_symb = &Apache::loncommon::deeplink_login_symb($cnum,$cdom); |
|
if ($deeplink_symb ne '') { |
|
my $deeplink; |
|
if ($deeplink_symb =~ /\.(page|sequence)$/) { |
|
my $mapname = &Apache::lonnet::deversion((&Apache::lonnet::decode_symb($deeplink_symb))[2]); |
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
if (ref($navmap)) { |
|
$deeplink = $navmap->get_mapparam(undef,$mapname,'0.deeplink'); |
|
} |
|
} elsif ($deeplink_symb ne '') { |
|
$deeplink = &Apache::lonnet::EXT('resource.0.deeplink',$deeplink_symb); |
|
} |
|
if ($deeplink ne '') { |
|
my ($state,$others,$listed,$scope,$protect,$display,$target) = split(/,/,$deeplink); |
|
if ($target ne '') { |
|
&Apache::lonnet::appenv({'request.deeplink.target' => $target}); |
|
} elsif (exists($env{'request.deeplink.target'})) { |
|
&Apache::lonnet::delenv('request.deeplink.target'); |
|
} |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
|
sub set_supplemental_access { |
|
my ($cnum,$cdom) = @_; |
|
my ($supplemental,$refs_updated) = &Apache::loncommon::get_supplemental($cnum,$cdom); |
|
unless ($refs_updated) { |
|
&Apache::loncommon::set_supp_httprefs($cnum,$cdom,$supplemental); |
|
} |
|
} |
|
|
|
1; |
1; |
__END__ |
__END__ |
|
|