version 1.79.2.9.2.7, 2024/08/26 10:48:59
|
version 1.104, 2023/12/23 02:17:38
|
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', |
'setcrsauthor' => 'View/Modify In-course Authoring permissions', |
); |
); |
} else { |
} else { |
%linktext = ( |
%linktext = ( |
Line 423 sub print_modification_menu {
|
Line 443 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', |
'setcrsauthor' => 'View In-course Authoring permissions', |
); |
); |
} |
} |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
Line 527 sub print_modification_menu {
|
Line 547 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 565 sub print_modification_menu {
|
Line 585 sub print_modification_menu {
|
linktitle => '', |
linktitle => '', |
}, |
}, |
{ |
{ |
linktext => $linktext{'setcrseditors'}, |
linktext => $linktext{'setcrsauthor'}, |
icon => 'crseditors.png', |
icon => 'crsauthor.png', |
#help => '', |
#help => '', |
url => &phaseurl('setcrseditors'), |
url => &phaseurl('setcrsauthor'), |
permission => $permission->{'setcrseditors'}, |
permission => $permission->{'setcrsauthor'}, |
linktitle => '', |
linktitle => '', |
}, |
}, |
] |
] |
Line 943 sub domain_postsubtimeout {
|
Line 963 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 1018 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 1052 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 1292 sub print_selfenrollconfig {
|
Line 1314 sub print_selfenrollconfig {
|
sub print_default_overrides { |
sub print_default_overrides { |
my ($r,$cdom,$cnum,$cdesc,$type,$readonly,$item) = @_; |
my ($r,$cdom,$cnum,$cdesc,$type,$readonly,$item) = @_; |
my (%titles,$checkeddom,$checkedcrs,$divsty,$currcrsval,$crsdefault,%crschecked, |
my (%titles,$checkeddom,$checkedcrs,$divsty,$currcrsval,$crsdefault,%crschecked, |
$helpfile,$title,$crselements,@currcrseditors); |
$helpfile,$title,$crselements); |
%titles = &default_overrides_titles($type); |
%titles = &default_overrides_titles($type); |
my ($title,$domdefdisplay,$settings,$optiontext,$options) = |
my ($title,$domdefdisplay,$settings,$optiontext,$options) = |
&default_overrides_common($item,$cdom,$cnum,$type,\%titles); |
&default_overrides_common($item,$cdom,$cnum,$type,\%titles); |
$checkeddom = ' checked="checked"'; |
$checkeddom = ' checked="checked"'; |
$divsty = 'display:none'; |
$divsty = 'display:none'; |
|
|
if ($item eq 'ltiauth') { |
if ($item eq 'ltiauth') { |
$helpfile = 'Modify_Course_LTI_Authen'; |
$helpfile = 'Modify_Course_LTI_Authen'; |
$crsdefault = 0; |
$crsdefault = 0; |
Line 1309 sub print_default_overrides {
|
Line 1330 sub print_default_overrides {
|
} elsif ($item eq 'crsauthor') { |
} elsif ($item eq 'crsauthor') { |
$helpfile = 'Modify_Course_Crsauthor'; |
$helpfile = 'Modify_Course_Crsauthor'; |
$crsdefault = 1; |
$crsdefault = 1; |
} elsif ($item eq 'crseditors') { |
|
$helpfile = 'Modify_Course_Resource_Editors'; |
|
$crsdefault = 'edit,xml'; |
|
} |
} |
} |
} |
$currcrsval = $settings->{'internal.'.$item}; |
$currcrsval = $settings->{'internal.'.$item}; |
Line 1319 sub print_default_overrides {
|
Line 1337 sub print_default_overrides {
|
$checkedcrs = $checkeddom; |
$checkedcrs = $checkeddom; |
$checkeddom = ''; |
$checkeddom = ''; |
$divsty = 'display:inline-block'; |
$divsty = 'display:inline-block'; |
if ($item eq 'crseditors') { |
|
@currcrseditors = split(/,/,$currcrsval); |
|
} |
|
foreach my $option (@{$options}) { |
foreach my $option (@{$options}) { |
if ($item eq 'crseditors') { |
if ($currcrsval eq $option) { |
if (grep(/^\Q$option\E$/,@currcrseditors)) { |
|
$crschecked{$option} = ' checked="checked"'; |
|
} |
|
} elsif ($currcrsval eq $option) { |
|
$crschecked{$option} = ' checked="checked"'; |
$crschecked{$option} = ' checked="checked"'; |
} else { |
} else { |
$crschecked{$option} = ''; |
$crschecked{$option} = ''; |
} |
} |
} |
} |
} else { |
} else { |
if ($item eq 'crseditors') { |
|
my %domdefs = &Apache::lonnet::get_domain_defaults($cdom); |
|
@currcrseditors = split(/,/,$domdefs{'crseditors'}); |
|
} |
|
foreach my $option (@{$options}) { |
foreach my $option (@{$options}) { |
if ($item eq 'crseditors') { |
if ($crsdefault eq $option) { |
if (grep(/^\Q$option\E$/,@currcrseditors)) { |
|
$crschecked{$option} = ' checked="checked"'; |
|
} |
|
} elsif ($crsdefault eq $option) { |
|
$crschecked{$option} = ' checked="checked"'; |
$crschecked{$option} = ' checked="checked"'; |
} else { |
} else { |
$crschecked{$option} = ''; |
$crschecked{$option} = ''; |
} |
} |
} |
} |
} |
} |
my ($disabled,$submit,$inputtype,$separator); |
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,'."'process${item}'".');" value="'.$titles{'modi'}.'" />'; |
} |
} |
if ($item eq 'crseditors') { |
|
$inputtype = 'checkbox'; |
|
$separator = ' 'x2; |
|
} else { |
|
$inputtype = 'radio'; |
|
$separator = '<br />'; |
|
} |
|
foreach my $option (@{$options}) { |
foreach my $option (@{$options}) { |
$crselements .= '<span class="LC_nobreak">'. |
$crselements .= '<span class="LC_nobreak">'. |
'<label><input type="'.$inputtype.'" name="'.$item.'" value="'.$option.'"'. |
'<label><input type="radio" name="'.$item.'" value="'.$option.'"'. |
$crschecked{$option}.$disabled.' />'.$optiontext->{$option}.'</label>'. |
$crschecked{$option}.$disabled.' />'.$optiontext->{$option}.'</label>'. |
'</span>'.$separator."\n"; |
'</span><br />'."\n"; |
} |
} |
&print_header($r,$type); |
&print_header($r,$type); |
my $hidden_elements = &hidden_form_elements(); |
my $hidden_elements = &hidden_form_elements(); |
Line 1410 sub default_overrides_titles {
|
Line 1406 sub default_overrides_titles {
|
'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", |
'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', |
'on' => 'In-course authoring available', |
'off' => 'In-course authoring unavailable', |
'off' => 'In-course authoring unavailable', |
'used' => 'Use domain default', |
'used' => 'Use domain default', |
Line 1440 sub default_overrides_common {
|
Line 1432 sub default_overrides_common {
|
$title = $titles->{'requ'}; |
$title = $titles->{'requ'}; |
$domdef = 0; |
$domdef = 0; |
@options = ('0','1'); |
@options = ('0','1'); |
%optiontext = ( |
%optiontext = ( |
0 => $titles->{'logi'}, |
0 => $titles->{'logi'}, |
1 => $titles->{'link'}, |
1 => $titles->{'link'}, |
); |
); |
Line 1458 sub default_overrides_common {
|
Line 1450 sub default_overrides_common {
|
$title = $titles->{'stan'}; |
$title = $titles->{'stan'}; |
$domdef = 1; |
$domdef = 1; |
@options = ('1','0'); |
@options = ('1','0'); |
%optiontext = ( |
%optiontext = ( |
1 => $titles->{'on'}, |
1 => $titles->{'on'}, |
0 => $titles->{'off'}, |
0 => $titles->{'off'}, |
); |
); |
} elsif ($item eq 'crseditors') { |
|
$title = $titles->{'perc'}; |
|
$domdef = 1; |
|
@options = ('edit','xml','daxe'); |
|
map { $optiontext{$_} = $titles->{$_}; } @options; |
|
} |
} |
} |
} |
my %domconfig = |
my %domconfig = |
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
if (($item eq 'ltiauth') || ($item eq 'crseditors')) { |
if ($item eq 'ltiauth') { |
$domdef = $domconfig{'coursedefaults'}{$item}; |
$domdef = $domconfig{'coursedefaults'}{$item}; |
} else { |
} else { |
my $lctype = &get_lctype($type,\%settings); |
my $lctype = &get_lctype($type,\%settings); |
Line 1512 sub default_overrides_common {
|
Line 1499 sub default_overrides_common {
|
} else { |
} else { |
$domdefdisplay = $titles->{'off'}; |
$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); |
return ($title,$domdefdisplay,\%settings,\%optiontext,\@options); |
} |
} |
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 2558 sub modify_default_overrides {
|
Line 2533 sub modify_default_overrides {
|
chg => 'In-course authoring permissions changed', |
chg => 'In-course authoring permissions changed', |
nochg => 'In-course authoring permissions unchanged', |
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>'.$title.'</h3>'."\n". |
Line 2576 sub modify_default_overrides {
|
Line 2545 sub modify_default_overrides {
|
$change = 1; |
$change = 1; |
} |
} |
} elsif ($env{'form.'.$item.'set'} eq 'course') { |
} elsif ($env{'form.'.$item.'set'} eq 'course') { |
if ($item eq 'crseditors') { |
my $posscrsval = $env{'form.'.$item}; |
my @neweditors; |
if (grep(/^\Q$posscrsval\E$/,@{$options})) { |
my @posseditors = &Apache::loncommon::get_env_multiple('form.'.$item); |
$newcrsval = $posscrsval; |
foreach my $editor (@posseditors) { |
|
if (grep(/^\Q$editor\E$/,@{$options})) { |
|
push(@neweditors,$editor); |
|
} |
|
} |
|
$newcrsval = join(',',@neweditors); |
|
} else { |
|
my $posscrsval = $env{'form.'.$item}; |
|
if (grep(/^\Q$posscrsval\E$/,@{$options})) { |
|
$newcrsval = $posscrsval; |
|
} |
|
} |
} |
if ($oldcrsval eq $newcrsval) { |
if ($oldcrsval eq $newcrsval) { |
$nochange = 1; |
$nochange = 1; |
Line 2631 sub modify_default_overrides {
|
Line 2589 sub modify_default_overrides {
|
if ($itemvalue eq '') { |
if ($itemvalue 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">'.$optiontext->{$itemvalue}.'</span>'; |
'<span style="font-style:italic">'.$optiontext->{$itemvalue}.'</span>'; |
Line 2812 function togglePostsubmit(caller) {
|
Line 2767 function togglePostsubmit(caller) {
|
|
|
ENDSCRIPT |
ENDSCRIPT |
|
|
} elsif (($phase eq 'setltiauth') || ($phase eq 'setexttool') || |
} elsif (($phase eq 'setltiauth') || ($phase eq 'setexttool') || ($phase eq 'setcrsauthor')) { |
($phase eq 'setcrseditors')) { |
|
$js .= <<"ENDJS"; |
$js .= <<"ENDJS"; |
function toggleOptions(form,phase) { |
function toggleOptions(form,phase) { |
var radioname; |
var radioname; |
Line 2827 function toggleOptions(form,phase) {
|
Line 2781 function toggleOptions(form,phase) {
|
} else if (phase == 'setcrsauthor') { |
} else if (phase == 'setcrsauthor') { |
radioname = 'crsauthorset'; |
radioname = 'crsauthorset'; |
divid = 'crscrsauthor'; |
divid = 'crscrsauthor'; |
} else if (phase == 'setcrseditors') { |
|
radioname = 'crseditorsset'; |
|
divid = 'crscrseditors'; |
|
} |
} |
var num = form.elements[radioname].length; |
var num = form.elements[radioname].length; |
if (num) { |
if (num) { |
Line 2865 ENDJS
|
Line 2816 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'} =~ /^set(ltiauth|exttool|crsauthor)$/) { |
$starthash = { |
$starthash = { |
add_entries => {'onload' => "toggleOptions(document.$env{'form.phase'},'$env{'form.phase'}');"}, |
add_entries => {'onload' => "toggleOptions(document.$env{'form.phase'},'$env{'form.phase'}');"}, |
}; |
}; |
Line 2876 ENDJS
|
Line 2827 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 2928 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','crsauthorset','crsauthor'], |
['^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 2966 sub get_permission {
|
processltiauth => 'edit', |
processltiauth => 'edit', |
setexttool => 'edit', |
setexttool => 'edit', |
processexttool => 'edit', |
processexttool => 'edit', |
setcrseditors => 'edit', |
setcrsauthor => 'edit', |
processcrseditors => 'edit', |
processcrsauthor => 'edit', |
); |
); |
if ($passwdconf{'crsownerchg'}) { |
if ($passwdconf{'crsownerchg'}) { |
$permission{passwdchg} = 'edit'; |
$permission{passwdchg} = 'edit'; |
Line 3032 sub get_permission {
|
Line 2985 sub get_permission {
|
adhocrole => 'custom', |
adhocrole => 'custom', |
setltiauth => 'view', |
setltiauth => 'view', |
setexttool => 'view', |
setexttool => 'view', |
setcrseditors => 'view', |
setcrsauthor => 'view', |
); |
); |
if ($passwdconf{'crsownerchg'}) { |
if ($passwdconf{'crsownerchg'}) { |
$permission{passwdchg} = 'view'; |
$permission{passwdchg} = 'view'; |
Line 3098 sub handler {
|
Line 3051 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 3069 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 3256 sub handler {
|
Line 3213 sub handler {
|
{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_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'exttool'); |
} elsif (($phase eq 'setcrseditors') && ($permission->{'setcrseditors'})) { |
} elsif (($phase eq 'setcrsauthor') && ($permission->{'setcrsauthor'})) { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'$phase')", |
({href=>"javascript:changePage(document.$phase,'$phase')", |
text=>"Available course resource editors"}); |
text=>"In-course authoring permission"}); |
&print_default_overrides($r,$cdom,$cnum,$cdesc,$type,$readonly,'crseditors'); |
&print_default_overrides($r,$cdom,$cnum,$cdesc,$type,$readonly,'crsauthor'); |
} elsif (($phase eq 'processcrseditors') && ($permission->{'processcrseditors'})) { |
} elsif (($phase eq 'processcrsauthor') && ($permission->{'processcrsauthor'})) { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'setcrseditors')", |
({href=>"javascript:changePage(document.$phase,'setcrsauthor')", |
text=>"Available course resource editors"}, |
text=>"In-course authoring 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,'crseditors'); |
&modify_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'crsauthor'); |
} |
} |
} |
} |
} 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')); |
} |
} |