version 1.79.2.9.2.7, 2024/08/26 10:48:59
|
version 1.103, 2023/09/05 03:42:31
|
Line 79 sub catalog_settable {
|
Line 79 sub catalog_settable {
|
if ($confhash->{'categorizecomm'} ne 'comm') { |
if ($confhash->{'categorizecomm'} ne 'comm') { |
push(@settable,'categorize'); |
push(@settable,'categorize'); |
} |
} |
|
} elsif ($type eq 'Placement') { |
|
if ($confhash->{'togglecatsplace'} ne 'place') { |
|
push(@settable,'togglecats'); |
|
} |
|
if ($confhash->{'categorizeplace'} ne 'place') { |
|
push(@settable,'categorize'); |
|
} |
} else { |
} else { |
if ($confhash->{'togglecats'} ne 'crs') { |
if ($confhash->{'togglecats'} ne 'crs') { |
push(@settable,'togglecats'); |
push(@settable,'togglecats'); |
Line 175 sub print_course_search_page {
|
Line 182 sub print_course_search_page {
|
$r->print(&Apache::loncommon::js_changer()); |
$r->print(&Apache::loncommon::js_changer()); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$r->print('<h3>'.&mt('Search for a community in the [_1] domain',$domdesc).'</h3>'); |
$r->print('<h3>'.&mt('Search for a community in the [_1] domain',$domdesc).'</h3>'); |
|
} elsif ($type eq 'Placement') { |
|
$r->print('<h3>'.&mt('Search for a placement test in the [_1] domain',$domdesc).'</h3>'); |
} else { |
} else { |
$r->print('<h3>'.&mt('Search for a course in the [_1] domain',$domdesc).'</h3>'); |
$r->print('<h3>'.&mt('Search for a course in the [_1] domain',$domdesc).'</h3>'); |
} |
} |
Line 185 sub print_course_search_page {
|
Line 194 sub print_course_search_page {
|
my ($actiontext,$roleoption,$settingsoption); |
my ($actiontext,$roleoption,$settingsoption); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$actiontext = &mt('Actions available after searching for a community:'); |
$actiontext = &mt('Actions available after searching for a community:'); |
|
} elsif ($type eq 'Placement') { |
|
$actiontext = &mt('Actions available after searching for a placement test:') |
} else { |
} else { |
$actiontext = &mt('Actions available after searching for a course:'); |
$actiontext = &mt('Actions available after searching for a course:'); |
} |
} |
Line 192 sub print_course_search_page {
|
Line 203 sub print_course_search_page {
|
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$roleoption = &mt('Enter the community with the role of [_1]',$cctitle); |
$roleoption = &mt('Enter the community with the role of [_1]',$cctitle); |
$settingsoption = &mt('View or modify community settings which only a [_1] may modify.',$dctitle); |
$settingsoption = &mt('View or modify community settings which only a [_1] may modify.',$dctitle); |
|
} elsif ($type eq 'Placement') { |
|
$roleoption = &mt('Enter the placement test with the role of [_1]',$cctitle); |
|
$settingsoption = &mt('View or modify placement test settings which only a [_1] may modify.',$dctitle); |
} else { |
} else { |
$roleoption = &mt('Enter the course with the role of [_1]',$cctitle); |
$roleoption = &mt('Enter the course with the role of [_1]',$cctitle); |
$settingsoption = &mt('View or modify course settings which only a [_1] may modify.',$dctitle); |
$settingsoption = &mt('View or modify course settings which only a [_1] may modify.',$dctitle); |
Line 202 sub print_course_search_page {
|
Line 216 sub print_course_search_page {
|
if (@{$roles_by_num} > 1) { |
if (@{$roles_by_num} > 1) { |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$roleoption = &mt('Enter the community with one of the available ad hoc roles'); |
$roleoption = &mt('Enter the community with one of the available ad hoc roles'); |
|
} elsif ($type eq 'Placement') { |
|
$roleoption = &mt('Enter the placement test with one of the available ad hoc roles.'); |
} else { |
} else { |
$roleoption = &mt('Enter the course with one of the available ad hoc roles.'); |
$roleoption = &mt('Enter the course with one of the available ad hoc roles.'); |
} |
} |
Line 209 sub print_course_search_page {
|
Line 225 sub print_course_search_page {
|
my $rolename = $description->{$roles_by_num->[0]}; |
my $rolename = $description->{$roles_by_num->[0]}; |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$roleoption = &mt('Enter the community with the ad hoc role of: [_1]',$rolename); |
$roleoption = &mt('Enter the community with the ad hoc role of: [_1]',$rolename); |
|
} elsif ($type eq 'Placement') { |
|
$roleoption = &mt('Enter the placement test with the ad hoc role of: [_1]',$rolename); |
} else { |
} else { |
$roleoption = &mt('Enter the course with the ad hoc role of: [_1]',$rolename); |
$roleoption = &mt('Enter the course with the ad hoc role of: [_1]',$rolename); |
} |
} |
Line 216 sub print_course_search_page {
|
Line 234 sub print_course_search_page {
|
} |
} |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$settingsoption = &mt('View community settings which only a [_1] may modify.',$dctitle); |
$settingsoption = &mt('View community settings which only a [_1] may modify.',$dctitle); |
|
} elsif ($type eq 'Placement') { |
|
$settingsoption = &mt('View placement test settings which only a [_1] may modify.',$dctitle); |
} else { |
} else { |
$settingsoption = &mt('View course settings which only a [_1] may modify.',$dctitle); |
$settingsoption = &mt('View course settings which only a [_1] may modify.',$dctitle); |
} |
} |
Line 413 sub print_modification_menu {
|
Line 433 sub print_modification_menu {
|
'setpostsubmit' => 'View/Modify submit button behavior, post-submission', |
'setpostsubmit' => 'View/Modify submit button behavior, post-submission', |
'setltiauth' => 'View/Modify re-authentication requirement for LTI launch of deep-linked item', |
'setltiauth' => 'View/Modify re-authentication requirement for LTI launch of deep-linked item', |
'setexttool' => 'View/Modify External Tools permissions', |
'setexttool' => 'View/Modify External Tools permissions', |
'setcrseditors' => 'View/Modify permitted course resource editors', |
|
); |
); |
} else { |
} else { |
%linktext = ( |
%linktext = ( |
Line 423 sub print_modification_menu {
|
Line 442 sub print_modification_menu {
|
'setpostsubmit' => 'View submit button behavior, post-submission', |
'setpostsubmit' => 'View submit button behavior, post-submission', |
'setltiauth' => 'View re-authentication requirement for LTI launch of deep-linked item', |
'setltiauth' => 'View re-authentication requirement for LTI launch of deep-linked item', |
'setexttool' => 'View External Tools permissions', |
'setexttool' => 'View External Tools permissions', |
'setcrseditors' => 'View permitted course resource editors', |
|
); |
); |
} |
} |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
Line 527 sub print_modification_menu {
|
Line 545 sub print_modification_menu {
|
{ |
{ |
linktext => $linktext{'viewparms'}, |
linktext => $linktext{'viewparms'}, |
url => &phaseurl('viewparms'), |
url => &phaseurl('viewparms'), |
permission => ($permission->{'viewparms'} && ($type ne 'Community')), |
permission => ($permission->{'viewparms'} && ($type ne 'Community') && ($type ne 'Placement')), |
#help => '', |
#help => '', |
icon => 'roles.png', |
icon => 'roles.png', |
linktitle => '' |
linktitle => '' |
Line 564 sub print_modification_menu {
|
Line 582 sub print_modification_menu {
|
permission => $permission->{'setexttool'}, |
permission => $permission->{'setexttool'}, |
linktitle => '', |
linktitle => '', |
}, |
}, |
{ |
|
linktext => $linktext{'setcrseditors'}, |
|
icon => 'crseditors.png', |
|
#help => '', |
|
url => &phaseurl('setcrseditors'), |
|
permission => $permission->{'setcrseditors'}, |
|
linktitle => '', |
|
}, |
|
] |
] |
}, |
}, |
); |
); |
Line 943 sub domain_postsubtimeout {
|
Line 953 sub domain_postsubtimeout {
|
sub get_lctype { |
sub get_lctype { |
my ($type,$settings) = @_; |
my ($type,$settings) = @_; |
my $lctype = lc($type); |
my $lctype = lc($type); |
unless ($type eq 'Community') { |
unless (($type eq 'Community') || ($type eq 'Placement')) { |
$lctype = 'unofficial'; |
$lctype = 'unofficial'; |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ($settings->{'internal.coursecode'}) { |
if ($settings->{'internal.coursecode'}) { |
Line 998 sub print_catsettings {
|
Line 1008 sub print_catsettings {
|
' <label><input name="hidefromcat" type="radio" value="yes" '.$excludeon.$disabled.' />'.&mt('Yes').'</label> <label><input name="hidefromcat" type="radio" value="" '.$excludeoff.$disabled.' />'.&mt('No').'</label></p><p>'); |
' <label><input name="hidefromcat" type="radio" value="yes" '.$excludeon.$disabled.' />'.&mt('Yes').'</label> <label><input name="hidefromcat" type="radio" value="" '.$excludeoff.$disabled.' />'.&mt('No').'</label></p><p>'); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$r->print(&mt("If a community has been categorized using at least one of the categories defined for communities in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded.").'</p>'); |
$r->print(&mt("If a community has been categorized using at least one of the categories defined for communities in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded.").'</p>'); |
|
} elsif ($type eq 'Placement') { |
|
$r->print(&mt("If a placement test has been categorized using at least one of the categories defined for placement tests in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded.").'</p>'); |
} else { |
} else { |
$r->print(&mt("Unless excluded, a course will be listed in the domain's publicly accessible Course/Community Catalog, if at least one of the following applies").':</p><ul>'. |
$r->print(&mt("Unless excluded, a course will be listed in the domain's publicly accessible Course/Community Catalog, if at least one of the following applies").':</p><ul>'. |
'<li>'.&mt('Auto-cataloging is enabled and the course is assigned an institutional code.').'</li>'. |
'<li>'.&mt('Auto-cataloging is enabled and the course is assigned an institutional code.').'</li>'. |
Line 1030 sub print_catsettings {
|
Line 1042 sub print_catsettings {
|
'<p>'.&mt('No categories defined for this domain.')); |
'<p>'.&mt('No categories defined for this domain.')); |
$shownsave = 1; |
$shownsave = 1; |
} |
} |
if ($type eq 'Community') { |
if (($type eq 'Community') || ($type eq 'Placement')) { |
$r->print('</p>'); |
$r->print('</p>'); |
} elsif ($shownsave) { |
} elsif ($shownsave) { |
$r->print('<br />'.&mt('If auto-cataloging based on institutional code is enabled in the domain, a course will continue to be listed in the catalog of official courses.').'</p>'); |
$r->print('<br />'.&mt('If auto-cataloging based on institutional code is enabled in the domain, a course will continue to be listed in the catalog of official courses.').'</p>'); |
Line 1289 sub print_selfenrollconfig {
|
Line 1301 sub print_selfenrollconfig {
|
return; |
return; |
} |
} |
|
|
sub print_default_overrides { |
sub print_set_ltiauth { |
my ($r,$cdom,$cnum,$cdesc,$type,$readonly,$item) = @_; |
my ($r,$cdom,$cnum,$cdesc,$type,$readonly) = @_; |
my (%titles,$checkeddom,$checkedcrs,$divsty,$currcrsval,$crsdefault,%crschecked, |
my %lt = &Apache::lonlocal::texthash( |
$helpfile,$title,$crselements,@currcrseditors); |
'requ' => 'Requirement for re-authentication for student LTI-limited launch of deep-linked item', |
%titles = &default_overrides_titles($type); |
'link' => 'Link protection can be set to accept username for an enrolled student (if sent by Consumer)', |
my ($title,$domdefdisplay,$settings,$optiontext,$options) = |
'logi' => 'Login needed, regardless of user information sent by LTI Consumer in (signed) parameters', |
&default_overrides_common($item,$cdom,$cnum,$type,\%titles); |
'used' => 'Use domain default', |
|
'cour' => 'Use course-specific setting', |
|
'curd' => 'Current domain default is', |
|
'valu' => 'Value for this course', |
|
'modi' => 'Save', |
|
'back' => 'Pick another action', |
|
); |
|
my ($domdef,$checkeddom,$checkedcrs,$domdefdisplay,$divsty,$authok,$authno); |
|
$domdef = 0; |
$checkeddom = ' checked="checked"'; |
$checkeddom = ' checked="checked"'; |
|
$domdefdisplay = $lt{'logi'}; |
$divsty = 'display:none'; |
$divsty = 'display:none'; |
|
$authno = ' checked="checked"'; |
if ($item eq 'ltiauth') { |
my %domconfig = |
$helpfile = 'Modify_Course_LTI_Authen'; |
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
$crsdefault = 0; |
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
} else { |
$domdef = $domconfig{'coursedefaults'}{'ltiauth'}; |
if ($item eq 'exttool') { |
} |
$helpfile = 'Modify_Course_External_Tool'; |
if ($domdef) { |
$crsdefault = 'both'; |
$domdefdisplay = $lt{'link'}; |
} elsif ($item eq 'crsauthor') { |
|
$helpfile = 'Modify_Course_Crsauthor'; |
|
$crsdefault = 1; |
|
} elsif ($item eq 'crseditors') { |
|
$helpfile = 'Modify_Course_Resource_Editors'; |
|
$crsdefault = 'edit,xml'; |
|
} |
|
} |
} |
$currcrsval = $settings->{'internal.'.$item}; |
my %settings = &Apache::lonnet::get('environment',['internal.ltiauth'],$cdom,$cnum); |
if ($currcrsval ne '') { |
my $ltiauth = $settings{'internal.ltiauth'}; |
|
|
|
if ($ltiauth ne '') { |
$checkedcrs = $checkeddom; |
$checkedcrs = $checkeddom; |
$checkeddom = ''; |
$checkeddom = ''; |
$divsty = 'display:inline-block'; |
$divsty = 'display:inline-block'; |
if ($item eq 'crseditors') { |
if ($ltiauth) { |
@currcrseditors = split(/,/,$currcrsval); |
$authok = ' checked="checked"'; |
} |
} |
foreach my $option (@{$options}) { |
} |
if ($item eq 'crseditors') { |
&print_header($r,$type); |
if (grep(/^\Q$option\E$/,@currcrseditors)) { |
my $hidden_elements = &hidden_form_elements(); |
$crschecked{$option} = ' checked="checked"'; |
my ($disabled,$submit); |
} |
if ($readonly) { |
} elsif ($currcrsval eq $option) { |
$disabled = ' disabled="disabled"'; |
$crschecked{$option} = ' checked="checked"'; |
} else { |
} else { |
$submit = '<input type="button" onclick="javascript:changePage(this.form,'."'processltiauth'".');" value="'.$lt{'modi'}.'" />'; |
$crschecked{$option} = ''; |
} |
|
my $helpitem = &Apache::loncommon::help_open_topic('Modify_Course_LTI_Authen'); |
|
my $showtype = &mt($type); |
|
$r->print(<<ENDDOCUMENT); |
|
<h3>$helpitem $lt{'requ'}</h3> |
|
<h4><span class="LC_nobreak">$showtype: $cdesc</span></h4> |
|
<form action="/adm/modifycourse" method="post" name="setltiauth"> |
|
<p><span class="LC_nobreak">$lt{'curd'}: <span style="font-style:italic">$domdefdisplay</span></span></p> |
|
<p><span class="LC_nobreak"> |
|
<label><input type="radio" name="ltiauthset" value="dom" onclick="toggleLTIOptions(this.form);"$checkeddom$disabled />$lt{'used'}</label></span><br /> |
|
<span class="LC_nobreak"> |
|
<label><input type="radio" name="ltiauthset" value="course" onclick="toggleLTIOptions(this.form);"$checkedcrs$disabled />$lt{'cour'}</label></span></p> |
|
<fieldset id="crsltiauth" style="$divsty"> |
|
<legend>$lt{'valu'}</legend> |
|
<span class="LC_nobreak"> |
|
<label><input type="radio" name="ltiauth" value="0"$authno$disabled />$lt{'logi'}</label> |
|
</span><br /> |
|
<span class="LC_nobreak"> |
|
<label><input type="radio" name="ltiauth" value="1"$authok$disabled />$lt{'link'}</label> |
|
</span> |
|
</fieldset><p> |
|
$submit |
|
$hidden_elements |
|
</p> |
|
</form> |
|
ENDDOCUMENT |
|
my @actions = |
|
('<a href="javascript:changePage(document.setltiauth,'."'menu'".')">'. |
|
$lt{'back'}.'</a>'); |
|
$r->print('<br />'.&Apache::lonhtmlcommon::actionbox(\@actions)); |
|
return; |
|
} |
|
|
|
sub print_set_exttool { |
|
my ($r,$cdom,$cnum,$cdesc,$type,$readonly) = @_; |
|
my %titles = &exttool_titles($type); |
|
my ($domdef,$domdefdom,$checkeddom,$checkedcrs,$domdefdisplay,$divsty); |
|
$domdef = 0; |
|
$domdefdom = 1; |
|
$checkeddom = ' checked="checked"'; |
|
$divsty = 'display:none'; |
|
my %settings = &Apache::lonnet::get('environment',['internal.coursecode', |
|
'internal.textbook'],$cdom,$cnum); |
|
my $lctype = &get_lctype($type,\%settings); |
|
my %domconfig = |
|
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
|
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
|
if (ref($domconfig{'coursedefaults'}{'exttool'}) eq 'HASH') { |
|
if (exists($domconfig{'coursedefaults'}{'exttool'}{$lctype})) { |
|
$domdef = $domconfig{'coursedefaults'}{'exttool'}{$lctype}; |
|
} |
|
} |
|
if (ref($domconfig{'coursedefaults'}{'domexttool'}) eq 'HASH') { |
|
if (exists($domconfig{'coursedefaults'}{'domexttool'}{$lctype})) { |
|
$domdefdom = $domconfig{'coursedefaults'}{'domexttool'}{$lctype}; |
} |
} |
} |
} |
} else { |
} |
if ($item eq 'crseditors') { |
if ($domdef && $domdefdom) { |
my %domdefs = &Apache::lonnet::get_domain_defaults($cdom); |
$domdefdisplay = $titles{'both'}; |
@currcrseditors = split(/,/,$domdefs{'crseditors'}); |
} elsif ($domdef) { |
} |
$domdefdisplay = $titles{'crs'}; |
foreach my $option (@{$options}) { |
} elsif ($domdefdom) { |
if ($item eq 'crseditors') { |
$domdefdisplay = $titles{'dom'}; |
if (grep(/^\Q$option\E$/,@currcrseditors)) { |
} else { |
$crschecked{$option} = ' checked="checked"'; |
$domdefdisplay = $titles{'none'}; |
} |
} |
} elsif ($crsdefault eq $option) { |
my %settings = &Apache::lonnet::get('environment',['internal.exttool'],$cdom,$cnum); |
|
my $crsexttool = $settings{'internal.exttool'}; |
|
my %crschecked = ( |
|
both => ' checked="checked"', |
|
dom => '', |
|
crs => '', |
|
none => '', |
|
); |
|
if ($crsexttool ne '') { |
|
$checkedcrs = $checkeddom; |
|
$checkeddom = ''; |
|
$divsty = 'display:inline-block'; |
|
foreach my $option ('both','dom','crs','none') { |
|
if ($crsexttool eq $option) { |
$crschecked{$option} = ' checked="checked"'; |
$crschecked{$option} = ' checked="checked"'; |
} else { |
} else { |
$crschecked{$option} = ''; |
$crschecked{$option} = ''; |
} |
} |
} |
} |
} |
} |
my ($disabled,$submit,$inputtype,$separator); |
&print_header($r,$type); |
|
my $hidden_elements = &hidden_form_elements(); |
|
my ($disabled,$submit); |
if ($readonly) { |
if ($readonly) { |
$disabled = ' disabled="disabled"'; |
$disabled = ' disabled="disabled"'; |
} else { |
} else { |
$submit = '<input type="button" onclick="javascript:changePage(this.form,'."'process${item}'".');" value="'.$titles{'modi'}.'" />'; |
$submit = '<input type="button" onclick="javascript:changePage(this.form,'."'processexttool'".');" value="'.$titles{'modi'}.'" />'; |
} |
|
if ($item eq 'crseditors') { |
|
$inputtype = 'checkbox'; |
|
$separator = ' 'x2; |
|
} else { |
|
$inputtype = 'radio'; |
|
$separator = '<br />'; |
|
} |
|
foreach my $option (@{$options}) { |
|
$crselements .= '<span class="LC_nobreak">'. |
|
'<label><input type="'.$inputtype.'" name="'.$item.'" value="'.$option.'"'. |
|
$crschecked{$option}.$disabled.' />'.$optiontext->{$option}.'</label>'. |
|
'</span>'.$separator."\n"; |
|
} |
} |
&print_header($r,$type); |
my $helpitem = &Apache::loncommon::help_open_topic('Modify_Course_External_Tool'); |
my $hidden_elements = &hidden_form_elements(); |
|
my $helpitem = &Apache::loncommon::help_open_topic($helpfile); |
|
my $showtype = &mt($type); |
my $showtype = &mt($type); |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
<h3>$helpitem $title</h3> |
<h3>$helpitem $titles{'extt'}</h3> |
<h4><span class="LC_nobreak">$showtype: $cdesc</span></h4> |
<h4><span class="LC_nobreak">$showtype: $cdesc</span></h4> |
<form action="/adm/modifycourse" method="post" name="set$item"> |
<form action="/adm/modifycourse" method="post" name="setexttool"> |
<p><span class="LC_nobreak">$titles{'curd'}: <span style="font-style:italic">$domdefdisplay</span></span></p> |
<p><span class="LC_nobreak">$titles{'curd'}: <span style="font-style:italic">$domdefdisplay</span></span></p> |
<p><span class="LC_nobreak"> |
<p><span class="LC_nobreak"> |
<label><input type="radio" name="${item}set" value="dom" onclick="toggleOptions(this.form,'set$item');"$checkeddom$disabled />$titles{'used'}</label></span><br /> |
<label><input type="radio" name="exttoolset" value="dom" onclick="toggleExtToolOptions(this.form);"$checkeddom$disabled />$titles{'used'}</label></span><br /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<label><input type="radio" name="${item}set" value="course" onclick="toggleOptions(this.form,'set$item');"$checkedcrs$disabled />$titles{'cour'}</label></span></p> |
<label><input type="radio" name="exttoolset" value="course" onclick="toggleExtToolOptions(this.form);"$checkedcrs$disabled />$titles{'cour'}</label></span></p> |
<fieldset id="crs$item" style="$divsty"> |
<fieldset id="crsexttool" style="$divsty"> |
<legend>$titles{'valu'}</legend> |
<legend>$titles{'valu'}</legend> |
$crselements |
<span class="LC_nobreak"> |
|
<label><input type="radio" name="exttool" value="both"$crschecked{'both'}$disabled />$titles{'both'}</label> |
|
</span><br /> |
|
<span class="LC_nobreak"> |
|
<label><input type="radio" name="exttool" value="dom"$crschecked{'dom'}$disabled />$titles{'dom'}</label> |
|
</span><br /> |
|
<span class="LC_nobreak"> |
|
<label><input type="radio" name="exttool" value="crs"$crschecked{'crs'}$disabled />$titles{'crs'}</label> |
|
</span><br /> |
|
<span class="LC_nobreak"> |
|
<label><input type="radio" name="exttool" value="none"$crschecked{'none'}$disabled />$titles{'none'}</label> |
|
</span> |
</fieldset><p> |
</fieldset><p> |
$submit |
$submit |
$hidden_elements |
$hidden_elements |
Line 1392 $hidden_elements
|
Line 1473 $hidden_elements
|
</form> |
</form> |
ENDDOCUMENT |
ENDDOCUMENT |
my @actions = |
my @actions = |
('<a href="javascript:changePage(document.set'.$item.','."'menu'".')">'. |
('<a href="javascript:changePage(document.setexttool,'."'menu'".')">'. |
$titles{'back'}.'</a>'); |
$titles{'back'}.'</a>'); |
$r->print('<br />'.&Apache::lonhtmlcommon::actionbox(\@actions)); |
$r->print('<br />'.&Apache::lonhtmlcommon::actionbox(\@actions)); |
return; |
return; |
} |
} |
|
|
sub default_overrides_titles { |
sub exttool_titles { |
my ($type) = @_; |
my ($type) = @_; |
my %titles = &Apache::lonlocal::texthash( |
my %titles = &Apache::lonlocal::texthash( |
'requ' => 'Requirement for re-authentication for student LTI-limited launch of deep-linked item', |
|
'link' => 'Link protection can be set to accept username for an enrolled student (if sent by Consumer)', |
|
'logi' => 'Login needed, regardless of user information sent by LTI Consumer in (signed) parameters', |
|
'extt' => 'External Tool permissions', |
'extt' => 'External Tool permissions', |
'none' => 'Use of external tools not permitted', |
'none' => 'Use of external tools not permitted', |
'crs' => 'Only external tools defined in course may be used', |
'crs' => 'Only external tools defined in course may be used', |
'dom' => 'Only external tools defined in domain may be used', |
'dom' => 'Only external tools defined in domain may be used', |
'both' => 'External tools defined/configured in either domain or course may be used', |
'both' => 'External tools defined/configured in either domain or course may be used', |
'stan' => "'In-course' authoring of standard LON-CAPA problems", |
|
'perc' => 'Permitted course resource editors', |
|
'edit' => 'Standard editor (Edit)', |
|
'xml' => 'Text editor (EditXML)', |
|
'daxe' => 'Daxe editor (Daxe)', |
|
'on' => 'In-course authoring available', |
|
'off' => 'In-course authoring unavailable', |
|
'used' => 'Use domain default', |
'used' => 'Use domain default', |
'cour' => 'Use course-specific setting', |
'cour' => 'Use course-specific setting', |
'curd' => 'Current domain default is', |
'curd' => 'Current domain default is', |
Line 1432 sub default_overrides_titles {
|
Line 1503 sub default_overrides_titles {
|
return %titles; |
return %titles; |
} |
} |
|
|
sub default_overrides_common { |
|
my ($item,$cdom,$cnum,$type,$titles) = @_; |
|
my ($title,$domdef,$domdefdom,$domdefdisplay,%settings,%optiontext,@options); |
|
if ($item eq 'ltiauth') { |
|
%settings = &Apache::lonnet::get('environment',['internal.'.$item],$cdom,$cnum); |
|
$title = $titles->{'requ'}; |
|
$domdef = 0; |
|
@options = ('0','1'); |
|
%optiontext = ( |
|
0 => $titles->{'logi'}, |
|
1 => $titles->{'link'}, |
|
); |
|
} else { |
|
%settings = |
|
&Apache::lonnet::get('environment',['internal.'.$item,'internal.coursecode', |
|
'internal.textbook'],$cdom,$cnum); |
|
if ($item eq 'exttool') { |
|
$title = $titles->{'extt'}; |
|
$domdefdom = 1; |
|
$domdef = 0; |
|
@options = ('both','dom','crs','none'); |
|
map { $optiontext{$_} = $titles->{$_}; } @options; |
|
} elsif ($item eq 'crsauthor') { |
|
$title = $titles->{'stan'}; |
|
$domdef = 1; |
|
@options = ('1','0'); |
|
%optiontext = ( |
|
1 => $titles->{'on'}, |
|
0 => $titles->{'off'}, |
|
); |
|
} elsif ($item eq 'crseditors') { |
|
$title = $titles->{'perc'}; |
|
$domdef = 1; |
|
@options = ('edit','xml','daxe'); |
|
map { $optiontext{$_} = $titles->{$_}; } @options; |
|
} |
|
} |
|
my %domconfig = |
|
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
|
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
|
if (($item eq 'ltiauth') || ($item eq 'crseditors')) { |
|
$domdef = $domconfig{'coursedefaults'}{$item}; |
|
} else { |
|
my $lctype = &get_lctype($type,\%settings); |
|
if (ref($domconfig{'coursedefaults'}{$item}) eq 'HASH') { |
|
if (exists($domconfig{'coursedefaults'}{$item}{$lctype})) { |
|
$domdef = $domconfig{'coursedefaults'}{$item}{$lctype}; |
|
} |
|
} |
|
if ($item eq 'exttool') { |
|
if (ref($domconfig{'coursedefaults'}{'domexttool'}) eq 'HASH') { |
|
if (exists($domconfig{'coursedefaults'}{'domexttool'}{$lctype})) { |
|
$domdefdom = $domconfig{'coursedefaults'}{'domexttool'}{$lctype}; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if ($item eq 'ltiauth') { |
|
if ($domdef) { |
|
$domdefdisplay = $titles->{'link'}; |
|
} else { |
|
$domdefdisplay = $titles->{'logi'}; |
|
} |
|
} elsif ($item eq 'exttool') { |
|
if ($domdef && $domdefdom) { |
|
$domdefdisplay = $titles->{'both'}; |
|
} elsif ($domdef) { |
|
$domdefdisplay = $titles->{'crs'}; |
|
} elsif ($domdefdom) { |
|
$domdefdisplay = $titles->{'dom'}; |
|
} else { |
|
$domdefdisplay = $titles->{'none'}; |
|
} |
|
} elsif ($item eq 'crsauthor') { |
|
if ($domdef) { |
|
$domdefdisplay = $titles->{'on'}; |
|
} else { |
|
$domdefdisplay = $titles->{'off'}; |
|
} |
|
} elsif ($item eq 'crseditors') { |
|
if (ref($domdef) eq 'ARRAY') { |
|
if (@{$domdef} == 0) { |
|
$domdefdisplay = &mt('No permitted editors'); |
|
} elsif (@{$domdef} == 1) { |
|
$domdefdisplay = $titles->{$domdef->[0]}.' ('.&mt('only').')'; |
|
} else { |
|
$domdefdisplay = join(', ', map { $titles->{$_}; } @{$domdef}); |
|
} |
|
} else { |
|
$domdefdisplay = join(', ', map { $titles->{$_}; } ('edit','xml')); |
|
} |
|
} |
|
return ($title,$domdefdisplay,\%settings,\%optiontext,\@options); |
|
} |
|
|
|
sub modify_selfenrollconfig { |
sub modify_selfenrollconfig { |
my ($r,$type,$cdesc,$coursehash) = @_; |
my ($r,$type,$cdesc,$coursehash) = @_; |
return unless(ref($coursehash) eq 'HASH'); |
return unless(ref($coursehash) eq 'HASH'); |
Line 1633 sub modify_course {
|
Line 1608 sub modify_course {
|
'internal.pendingco-owners','internal.selfenrollmgrdc', |
'internal.pendingco-owners','internal.selfenrollmgrdc', |
'internal.selfenrollmgrcc','internal.mysqltables'); |
'internal.selfenrollmgrcc','internal.mysqltables'); |
my ($selfenrollrows,$selfenrolltitles) = &Apache::lonuserutils::get_selfenroll_titles(); |
my ($selfenrollrows,$selfenrolltitles) = &Apache::lonuserutils::get_selfenroll_titles(); |
unless ($type eq 'Community') { |
unless (($type eq 'Community') || ($type eq 'Placement')) { |
push(@items,('internal.coursecode','internal.authtype','internal.autharg', |
push(@items,('internal.coursecode','internal.authtype','internal.autharg', |
'internal.sectionnums','internal.crosslistings')); |
'internal.sectionnums','internal.crosslistings')); |
if (&showcredits($cdom)) { |
if (&showcredits($cdom)) { |
Line 1868 sub modify_course {
|
Line 1843 sub modify_course {
|
$nochgresponse .= '<li>'.&mt('[_1] still set to: [_2]',$longtype{$attr},$shown).'</li>'; |
$nochgresponse .= '<li>'.&mt('[_1] still set to: [_2]',$longtype{$attr},$shown).'</li>'; |
} |
} |
} |
} |
if (($type ne 'Community') && ($changed{'code'} || $changed{'owner'})) { |
if (($type ne 'Community') && ($type ne 'Placement') && ($changed{'code'} || $changed{'owner'})) { |
if ( $newattr{'courseowner'} eq '') { |
if ( $newattr{'courseowner'} eq '') { |
push(@warnings,&mt('There is no owner associated with this LON-CAPA course.'). |
push(@warnings,&mt('There is no owner associated with this LON-CAPA course.'). |
'<br />'.&mt('If automated enrollment at your institution requires validation of course owners, automated enrollment will fail.')); |
'<br />'.&mt('If automated enrollment at your institution requires validation of course owners, automated enrollment will fail.')); |
Line 2533 sub modify_catsettings {
|
Line 2508 sub modify_catsettings {
|
return; |
return; |
} |
} |
|
|
sub modify_default_overrides { |
sub modify_ltiauth { |
my ($r,$cdom,$cnum,$cdesc,$domdesc,$type,$item) = @_; |
my ($r,$cdom,$cnum,$cdesc,$domdesc,$type) = @_; |
my (%titles,$oldcrsval,$newcrsval,%resulttext,$itemvalue,$nochange,$change,$status,$error); |
my %lt = &Apache::lonlocal::texthash( |
%titles = &default_overrides_titles($type); |
'requ' => 'Requirement for re-authentication for student LTI-limited launch of deep-linked item', |
my ($title,$domdefdisplay,$oldsettings,$optiontext,$options) = |
'link' => 'Link protection can be set to accept username for an enrolled student (if sent by Consumer)', |
&default_overrides_common($item,$cdom,$cnum,$type,\%titles); |
'logi' => 'Login needed, regardless of user information sent by LTI Consumer in (signed) parameters', |
$oldcrsval = $oldsettings->{'internal.'.$item}; |
'used' => 'Use domain default', |
if ($item eq 'ltiauth') { |
'cour' => 'Use course-specific setting', |
%resulttext = |
'modi' => 'Save', |
&Apache::lonlocal::texthash( |
'back' => 'Pick another action', |
chg => 'Re-authentication requirement for LTI launch of deep-linked changed', |
); |
nochg => 'Re-authentication requirement for LTI launch of deep-linked item is unchanged', |
|
); |
|
} elsif ($item eq 'exttool') { |
|
%resulttext = |
|
&Apache::lonlocal::texthash( |
|
chg => 'External Tool permissions changed', |
|
nochg => 'External Tool permissions unchanged', |
|
); |
|
} elsif ($item eq 'crsauthor') { |
|
%resulttext = |
|
&Apache::lonlocal::texthash( |
|
chg => 'In-course authoring permissions changed', |
|
nochg => 'In-course authoring permissions unchanged', |
|
); |
|
} elsif ($item eq 'crseditors') { |
|
%resulttext = |
|
&Apache::lonlocal::texthash( |
|
chg => 'Permitted course resource editors changed', |
|
nochg => 'Permitted course resource editors unchanged', |
|
); |
|
} |
|
&print_header($r,$type); |
&print_header($r,$type); |
$r->print('<h3>'.$title.'</h3>'."\n". |
$r->print('<h3>'.$lt{'requ'}.'</h3>'."\n". |
'<h4><span class="LC_nobreak">'.&mt($type).': '.$cdesc.'</span></h4>'."\n". |
'<h4><span class="LC_nobreak">'.&mt($type).': '.$cdesc.'</span></h4>'."\n". |
'<form action="/adm/modifycourse" method="post" name="process'.$item.'">'."\n"); |
'<form action="/adm/modifycourse" method="post" name="processltiauth">'."\n"); |
if ($env{'form.'.$item.'set'} eq 'dom') { |
my %oldsettings = &Apache::lonnet::get('environment',['internal.ltiauth'],$cdom,$cnum); |
if ($oldcrsval eq '') { |
my $oldltiauth = $oldsettings{'internal.ltiauth'}; |
|
my $domdef; |
|
my %domconfig = |
|
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
|
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
|
$domdef = $domconfig{'coursedefaults'}{'ltiauth'}; |
|
} |
|
my ($newltiauth,$nochange,$change,$status,$error,$ltiauth); |
|
if ($env{'form.ltiauthset'} eq 'dom') { |
|
if ($oldltiauth eq '') { |
|
$nochange = 1; |
|
} else { |
|
$change = 1; |
|
} |
|
} elsif ($env{'form.ltiauthset'} eq 'course') { |
|
if ($env{'form.ltiauth'} =~ /^0|1$/) { |
|
$newltiauth = $env{'form.ltiauth'}; |
|
} |
|
if ($oldltiauth == $newltiauth) { |
$nochange = 1; |
$nochange = 1; |
} else { |
} else { |
$change = 1; |
$change = 1; |
} |
} |
} elsif ($env{'form.'.$item.'set'} eq 'course') { |
} |
if ($item eq 'crseditors') { |
if ($change) { |
my @neweditors; |
if ($newltiauth ne '') { |
my @posseditors = &Apache::loncommon::get_env_multiple('form.'.$item); |
my %cenv = ( |
foreach my $editor (@posseditors) { |
'internal.ltiauth' => $newltiauth, |
if (grep(/^\Q$editor\E$/,@{$options})) { |
); |
push(@neweditors,$editor); |
if (&Apache::lonnet::put('environment',\%cenv,$cdom,$cnum) eq 'ok') { |
|
if ($env{'course.'.$cdom.'_'.$cnum.'.description'} ne '') { |
|
&Apache::lonnet::appenv( |
|
{'course.'.$cdom.'_'.$cnum.'.internal.ltiauth' => $newltiauth}); |
} |
} |
|
} else { |
|
$error = 1; |
} |
} |
$newcrsval = join(',',@neweditors); |
|
} else { |
} else { |
my $posscrsval = $env{'form.'.$item}; |
if (&Apache::lonnet::del('environment',['internal.ltiauth'],$cdom,$cnum) eq 'ok') { |
if (grep(/^\Q$posscrsval\E$/,@{$options})) { |
if (exists($env{'course.'.$cdom.'_'.$cnum.'.internal.ltiauth'})) { |
$newcrsval = $posscrsval; |
&Apache::lonnet::delenv('course.'.$cdom.'_'.$cnum.'.internal.ltiauth'); |
|
} |
|
} else { |
|
$error = 1; |
} |
} |
} |
} |
if ($oldcrsval eq $newcrsval) { |
} |
|
if ($error) { |
|
$nochange = 1; |
|
} |
|
if ($nochange) { |
|
$ltiauth = $oldltiauth; |
|
} else { |
|
$ltiauth = $newltiauth; |
|
} |
|
if ($ltiauth eq '') { |
|
$status = $lt{'used'}.': '; |
|
if ($domdef) { |
|
$status .= '<span style="font-style:italic">'.$lt{'link'}.'</span>'; |
|
} else { |
|
$status .= '<span style="font-style:italic">'.$lt{'logi'}.'</span>'; |
|
} |
|
} else { |
|
$status = $lt{'cour'}.': '; |
|
if ($ltiauth) { |
|
$status .= '<span style="font-style:italic">'.$lt{'link'}.'</span>'; |
|
} else { |
|
$status .= '<span style="font-style:italic">'.$lt{'logi'}.'</span>'; |
|
} |
|
} |
|
if ($error) { |
|
$r->print('<p class="LC_warning">'.&mt('An error occurred when saving your changes').'</p>'); |
|
} |
|
$r->print('<p>'); |
|
if ($nochange) { |
|
$r->print(&mt('Re-authentication requirement for LTI launch of deep-linked item is unchanged')); |
|
} elsif ($change) { |
|
$r->print(&mt('Re-authentication requirement for LTI launch of deep-linked changed')); |
|
} |
|
$r->print('<br />'.$status.'</p>'. |
|
&hidden_form_elements().'</form>'); |
|
my @actions = |
|
('<a href="javascript:changePage(document.processltiauth,'."'menu'".')">'. |
|
$lt{'back'}.'</a>'); |
|
$r->print('<br />'.&Apache::lonhtmlcommon::actionbox(\@actions)); |
|
return; |
|
} |
|
|
|
sub modify_exttool { |
|
my ($r,$cdom,$cnum,$cdesc,$domdesc,$type) = @_; |
|
my %titles = &exttool_titles($type); |
|
&print_header($r,$type); |
|
$r->print('<h3>'.$titles{'extt'}.'</h3>'."\n". |
|
'<h4><span class="LC_nobreak">'.$type.': '.$cdesc.'</span></h4>'."\n". |
|
'<form action="/adm/modifycourse" method="post" name="processexttool">'."\n"); |
|
my %oldsettings = &Apache::lonnet::get('environment',['internal.exttool'],$cdom,$cnum); |
|
my $oldcrsexttool = $oldsettings{'internal.exttool'}; |
|
my $domdefdom = 1; |
|
my $domdef = 0; |
|
my $domdefdisplay; |
|
my %settings = &Apache::lonnet::get('environment',['internal.coursecode', |
|
'internal.textbook'],$cdom,$cnum); |
|
my $lctype = &get_lctype($type,\%settings); |
|
my %domconfig = |
|
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
|
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
|
if (ref($domconfig{'coursedefaults'}{'domexttool'}) eq 'HASH') { |
|
if (exists($domconfig{'coursedefaults'}{'domexttool'}{$lctype})) { |
|
$domdefdom = $domconfig{'coursedefaults'}{'domexttool'}{$lctype}; |
|
} |
|
} |
|
if (ref($domconfig{'coursedefaults'}{'exttool'}) eq 'HASH') { |
|
if (exists($domconfig{'coursedefaults'}{'exttool'}{$lctype})) { |
|
$domdef = $domconfig{'coursedefaults'}{'exttool'}{$lctype}; |
|
} |
|
} |
|
} |
|
if ($domdef && $domdefdom) { |
|
$domdefdisplay = $titles{'both'}; |
|
} elsif ($domdef) { |
|
$domdefdisplay = $titles{'crs'}; |
|
} elsif ($domdefdom) { |
|
$domdefdisplay = $titles{'dom'}; |
|
} else { |
|
$domdefdisplay = $titles{'none'}; |
|
} |
|
my ($newcrsexttool,$nochange,$change,$status,$error,$exttool); |
|
if ($env{'form.exttoolset'} eq 'dom') { |
|
if ($oldcrsexttool eq '') { |
|
$nochange = 1; |
|
} else { |
|
$change = 1; |
|
} |
|
} elsif ($env{'form.exttoolset'} eq 'course') { |
|
if ($env{'form.exttool'} =~ /^both|dom|crs|none$/) { |
|
$newcrsexttool = $env{'form.exttool'}; |
|
} |
|
if ($oldcrsexttool eq $newcrsexttool) { |
$nochange = 1; |
$nochange = 1; |
} else { |
} else { |
$change = 1; |
$change = 1; |
} |
} |
} |
} |
if ($change) { |
if ($change) { |
if ($newcrsval ne '') { |
if ($newcrsexttool ne '') { |
my %cenv = ( |
my %cenv = ( |
'internal.'.$item => $newcrsval, |
'internal.exttool' => $newcrsexttool, |
); |
); |
if (&Apache::lonnet::put('environment',\%cenv,$cdom,$cnum) eq 'ok') { |
if (&Apache::lonnet::put('environment',\%cenv,$cdom,$cnum) eq 'ok') { |
if ($env{'course.'.$cdom.'_'.$cnum.'.description'} ne '') { |
if ($env{'course.'.$cdom.'_'.$cnum.'.description'} ne '') { |
&Apache::lonnet::appenv( |
&Apache::lonnet::appenv( |
{'course.'.$cdom.'_'.$cnum.'.internal.'.$item => $newcrsval}); |
{'course.'.$cdom.'_'.$cnum.'.internal.exttool' => $newcrsexttool}); |
} |
} |
} else { |
} else { |
$error = 1; |
$error = 1; |
} |
} |
} else { |
} else { |
if (&Apache::lonnet::del('environment',['internal.'.$item],$cdom,$cnum) eq 'ok') { |
if (&Apache::lonnet::del('environment',['internal.exttool'],$cdom,$cnum) eq 'ok') { |
if (exists($env{'course.'.$cdom.'_'.$cnum.'.internal.'.$item})) { |
if (exists($env{'course.'.$cdom.'_'.$cnum.'.internal.exttool'})) { |
&Apache::lonnet::delenv('course.'.$cdom.'_'.$cnum.'.internal.'.$item); |
&Apache::lonnet::delenv('course.'.$cdom.'_'.$cnum.'.internal.exttool'); |
} |
} |
} else { |
} else { |
$error = 1; |
$error = 1; |
Line 2624 sub modify_default_overrides {
|
Line 2694 sub modify_default_overrides {
|
$nochange = 1; |
$nochange = 1; |
} |
} |
if ($nochange) { |
if ($nochange) { |
$itemvalue = $oldcrsval; |
$exttool = $oldcrsexttool; |
} else { |
} else { |
$itemvalue = $newcrsval; |
$exttool = $newcrsexttool; |
} |
} |
if ($itemvalue eq '') { |
if ($exttool eq '') { |
$status = $titles{'used'}.': '. |
$status = $titles{'used'}.': <span style="font-style:italic">'.$domdefdisplay.'</span>'; |
'<span style="font-style:italic">'.$domdefdisplay.'</span>'; |
|
} elsif ($item eq 'crseditors') { |
|
$status = $titles{'cour'}.': '. |
|
'<span style="font-style:italic">'.join(', ', map { $titles{$_}; } split(/,/,$itemvalue)).'</span>'; |
|
} else { |
} else { |
$status = $titles{'cour'}.': '. |
$status = $titles{'cour'}.': <span style="font-style:italic">'.$titles{$exttool}.'</span>'; |
'<span style="font-style:italic">'.$optiontext->{$itemvalue}.'</span>'; |
|
} |
} |
if ($error) { |
if ($error) { |
$r->print('<p class="LC_warning">'.&mt('An error occurred when saving your changes').'</p>'); |
$r->print('<p class="LC_warning">'.&mt('An error occurred when saving your changes').'</p>'); |
} |
} |
$r->print('<p>'); |
$r->print('<p>'); |
if ($nochange) { |
if ($nochange) { |
$r->print($resulttext{'nochg'}); |
$r->print(&mt('External Tool permissions unchanged')); |
} elsif ($change) { |
} elsif ($change) { |
$r->print($resulttext{'chg'}); |
$r->print(&mt('External Tool permissions changed')); |
} |
} |
$r->print('<br />'.$status.'</p>'. |
$r->print('<br />'.$status.'</p>'. |
&hidden_form_elements().'</form>'); |
&hidden_form_elements().'</form>'); |
my @actions = |
my @actions = |
('<a href="javascript:changePage(document.process'.$item.','."'menu'".')">'. |
('<a href="javascript:changePage(document.processexttool,'."'menu'".')">'. |
$titles{'back'}.'</a>'); |
$titles{'back'}.'</a>'); |
$r->print('<br />'.&Apache::lonhtmlcommon::actionbox(\@actions)); |
$r->print('<br />'.&Apache::lonhtmlcommon::actionbox(\@actions)); |
return; |
return; |
Line 2812 function togglePostsubmit(caller) {
|
Line 2877 function togglePostsubmit(caller) {
|
|
|
ENDSCRIPT |
ENDSCRIPT |
|
|
} elsif (($phase eq 'setltiauth') || ($phase eq 'setexttool') || |
} elsif ($phase eq 'setltiauth') { |
($phase eq 'setcrseditors')) { |
|
$js .= <<"ENDJS"; |
$js .= <<"ENDJS"; |
function toggleOptions(form,phase) { |
function toggleLTIOptions(form) { |
var radioname; |
var radioname = 'ltiauthset'; |
var divid; |
var divid = 'crsltiauth'; |
if (phase == 'setltiauth') { |
var num = form.elements[radioname].length; |
radioname = 'ltiauthset'; |
if (num) { |
divid = 'crsltiauth'; |
var setvis = ''; |
} else if (phase == 'setexttool') { |
for (var i=0; i<num; i++) { |
radioname = 'exttoolset'; |
if (form.elements[radioname][i].checked) { |
divid = 'crsexttool'; |
if (form.elements[radioname][i].value == 'course') { |
} else if (phase == 'setcrsauthor') { |
if (document.getElementById(divid)) { |
radioname = 'crsauthorset'; |
document.getElementById(divid).style.display = 'inline-block'; |
divid = 'crscrsauthor'; |
} |
} else if (phase == 'setcrseditors') { |
setvis = 1; |
radioname = 'crseditorsset'; |
} |
divid = 'crscrseditors'; |
break; |
|
} |
|
} |
|
if (!setvis) { |
|
if (document.getElementById(divid)) { |
|
document.getElementById(divid).style.display = 'none'; |
|
} |
|
} |
} |
} |
|
return; |
|
} |
|
|
|
ENDJS |
|
} elsif ($phase eq 'setexttool') { |
|
$js .= <<"ENDJS"; |
|
function toggleExtToolOptions(form) { |
|
var radioname = 'exttoolset'; |
|
var divid = 'crsexttool'; |
var num = form.elements[radioname].length; |
var num = form.elements[radioname].length; |
if (num) { |
if (num) { |
var setvis = ''; |
var setvis = ''; |
Line 2865 ENDJS
|
Line 2945 ENDJS
|
$starthash = { |
$starthash = { |
add_entries => {'onload' => "hide_searching(); courseSet(document.filterpicker.official, 'load');"}, |
add_entries => {'onload' => "hide_searching(); courseSet(document.filterpicker.official, 'load');"}, |
}; |
}; |
} elsif ($env{'form.phase'} =~ /^set(ltiauth|exttool|crseditors)$/) { |
} elsif ($env{'form.phase'} eq 'setltiauth') { |
$starthash = { |
$starthash = { |
add_entries => {'onload' => "toggleOptions(document.$env{'form.phase'},'$env{'form.phase'}');"}, |
add_entries => {'onload' => "toggleLTIOptions(document.setltiauth);"}, |
|
}; |
|
} elsif ($env{'form.phase'} eq 'setexttool') { |
|
$starthash = { |
|
add_entries => {'onload' => "toggleExtToolOptions(document.setexttool);"}, |
}; |
}; |
} |
} |
$r->print(&Apache::loncommon::start_page('View/Modify Course/Community Settings', |
$r->print(&Apache::loncommon::start_page('View/Modify Course/Community Settings', |
Line 2876 ENDJS
|
Line 2960 ENDJS
|
my $bread_text = "View/Modify Courses/Communities"; |
my $bread_text = "View/Modify Courses/Communities"; |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$bread_text = 'Community Settings'; |
$bread_text = 'Community Settings'; |
|
} elsif ($type eq 'Placement') { |
|
$bread_text = 'Placement Test Settings'; |
} else { |
} else { |
$bread_text = 'Course Settings'; |
$bread_text = 'Course Settings'; |
} |
} |
Line 2975 sub hidden_form_elements {
|
Line 3061 sub hidden_form_elements {
|
'threshold','postsubmit','postsubtimeout','defaultcredits','uploadquota', |
'threshold','postsubmit','postsubtimeout','defaultcredits','uploadquota', |
'selfenrollmgrdc','selfenrollmgrcc','action','state','currsec_st', |
'selfenrollmgrdc','selfenrollmgrcc','action','state','currsec_st', |
'sections','newsec','mysqltables','nopasswdchg','ltiauth','ltiauthset', |
'sections','newsec','mysqltables','nopasswdchg','ltiauth','ltiauthset', |
'exttoolset','exttool','crseditorsset','crseditors'], |
'exttoolset','exttool'],['^selfenrollmgr_','^selfenroll_'])."\n". |
['^selfenrollmgr_','^selfenroll_'])."\n". |
|
'<input type="hidden" name="prevphase" value="'.$env{'form.phase'}.'" />'; |
'<input type="hidden" name="prevphase" value="'.$env{'form.phase'}.'" />'; |
return $hidden_elements; |
return $hidden_elements; |
} |
} |
Line 3013 sub get_permission {
|
Line 3098 sub get_permission {
|
processltiauth => 'edit', |
processltiauth => 'edit', |
setexttool => 'edit', |
setexttool => 'edit', |
processexttool => 'edit', |
processexttool => 'edit', |
setcrseditors => 'edit', |
|
processcrseditors => 'edit', |
|
); |
); |
if ($passwdconf{'crsownerchg'}) { |
if ($passwdconf{'crsownerchg'}) { |
$permission{passwdchg} = 'edit'; |
$permission{passwdchg} = 'edit'; |
Line 3032 sub get_permission {
|
Line 3115 sub get_permission {
|
adhocrole => 'custom', |
adhocrole => 'custom', |
setltiauth => 'view', |
setltiauth => 'view', |
setexttool => 'view', |
setexttool => 'view', |
setcrseditors => 'view', |
|
); |
); |
if ($passwdconf{'crsownerchg'}) { |
if ($passwdconf{'crsownerchg'}) { |
$permission{passwdchg} = 'view'; |
$permission{passwdchg} = 'view'; |
Line 3098 sub handler {
|
Line 3180 sub handler {
|
} |
} |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$choose_text = "Choose a community"; |
$choose_text = "Choose a community"; |
|
} elsif ($type eq 'Placement') { |
|
$choose_text = "Choose a placement test"; |
} else { |
} else { |
$choose_text = "Choose a course"; |
$choose_text = "Choose a course"; |
} |
} |
Line 3114 sub handler {
|
Line 3198 sub handler {
|
my $enter_text; |
my $enter_text; |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$enter_text = 'Enter community'; |
$enter_text = 'Enter community'; |
|
} elsif ($type eq 'Placement') { |
|
$enter_text = 'Enter placement test'; |
} else { |
} else { |
$enter_text = 'Enter course'; |
$enter_text = 'Enter course'; |
} |
} |
Line 3235 sub handler {
|
Line 3321 sub handler {
|
} elsif (($phase eq 'setltiauth') && ($permission->{'setltiauth'})) { |
} elsif (($phase eq 'setltiauth') && ($permission->{'setltiauth'})) { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'$phase')", |
({href=>"javascript:changePage(document.$phase,'$phase')", |
text=>"Authentication post-LTI launch"}); |
text=>"Requirement for re-authentication for LTI launch of deep-linked item"}); |
&print_default_overrides($r,$cdom,$cnum,$cdesc,$type,$readonly,'ltiauth'); |
&print_set_ltiauth($r,$cdom,$cnum,$cdesc,$type,$readonly); |
} elsif (($phase eq 'processltiauth') && ($permission->{'processltiauth'})) { |
} elsif (($phase eq 'processltiauth') && ($permission->{'processltiauth'})) { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'setltiauth')", |
({href=>"javascript:changePage(document.$phase,'setltiauth')", |
text=>"Authentication post-LTI launch"}, |
text=>"Requirement for re-authentication for LTI launch of deep-linked item"}, |
{href=>"javascript:changePage(document.$phase,'$phase')", |
{href=>"javascript:changePage(document.$phase,'$phase')", |
text=>"Result"}); |
text=>"Result"}); |
&modify_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'ltiauth'); |
&modify_ltiauth($r,$cdom,$cnum,$cdesc,$domdesc,$type); |
} elsif (($phase eq 'setexttool') && ($permission->{'setexttool'})) { |
} elsif (($phase eq 'setexttool') && ($permission->{'setexttool'})) { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'$phase')", |
({href=>"javascript:changePage(document.$phase,'$phase')", |
text=>"External Tool permission"}); |
text=>"External Tool permission"}); |
&print_default_overrides($r,$cdom,$cnum,$cdesc,$type,$readonly,'exttool'); |
&print_set_exttool($r,$cdom,$cnum,$cdesc,$type,$readonly); |
} elsif (($phase eq 'processexttool') && ($permission->{'processexttool'})) { |
} elsif (($phase eq 'processexttool') && ($permission->{'processexttool'})) { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'setexttool')", |
({href=>"javascript:changePage(document.$phase,'setexttool')", |
text=>"External Tool permission"}, |
text=>"External Tool permission"}, |
{href=>"javascript:changePage(document.$phase,'$phase')", |
{href=>"javascript:changePage(document.$phase,'$phase')", |
text=>"Result"}); |
text=>"Result"}); |
&modify_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'exttool'); |
&modify_exttool($r,$cdom,$cnum,$cdesc,$domdesc,$type); |
} elsif (($phase eq 'setcrseditors') && ($permission->{'setcrseditors'})) { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:changePage(document.$phase,'$phase')", |
|
text=>"Available course resource editors"}); |
|
&print_default_overrides($r,$cdom,$cnum,$cdesc,$type,$readonly,'crseditors'); |
|
} elsif (($phase eq 'processcrseditors') && ($permission->{'processcrseditors'})) { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:changePage(document.$phase,'setcrseditors')", |
|
text=>"Available course resource editors"}, |
|
{href=>"javascript:changePage(document.$phase,'$phase')", |
|
text=>"Result"}); |
|
&modify_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'crseditors'); |
|
} |
} |
} |
} |
} else { |
} else { |
$r->print('<span class="LC_error">'); |
$r->print('<span class="LC_error">'); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$r->print(&mt('The community you selected is not a valid community in this domain')); |
$r->print(&mt('The community you selected is not a valid community in this domain')); |
|
} elsif ($type eq 'Placement') { |
|
$r->print(&mt('The course you selected is not a valid placement test in this domain')); |
} else { |
} else { |
$r->print(&mt('The course you selected is not a valid course in this domain')); |
$r->print(&mt('The course you selected is not a valid course in this domain')); |
} |
} |