'.
- &mt('Disable changing password for users with student role by course owner').''."\n".
+ &mt('Disable changing password for users with student role by course owner').' '."\n".
&Apache::lonhtmlcommon::row_closure());
}
}
@@ -1211,7 +1216,7 @@ sub print_course_modification_page {
''.$lt{'whom'}.' '.
&Apache::loncommon::end_data_table_header_row()."\n");
my %optionname;
- $optionname{''} = &mt('Use domain default');
+ $optionname{''} = &mt('Use domain default');
$optionname{'0'} = $dctitle;
$optionname{'1'} = $cctitle;
foreach my $item (@{$selfenrollrows}) {
@@ -1226,12 +1231,12 @@ sub print_course_modification_page {
$checked{'1'} = ' checked="checked"';
} else {
$checked{''} = ' checked="checked"';
- }
+ }
$r->print(&Apache::loncommon::start_data_table_row()."\n".
''.$selfenrolltitles->{$item}.' '."\n".
''.&mt('[_1] configures',$default).' '."\n".
'');
- foreach my $option ('','0','1') {
+ foreach my $option ('','0','1') {
$r->print(''.
' '.
@@ -1247,7 +1252,7 @@ sub print_course_modification_page {
' '.&mt('"Temporary" Tables Lifetime (s)'))."\n".
' '.
&Apache::lonhtmlcommon::row_closure(1).
- &Apache::lonhtmlcommon::end_pick_box().''.$hidden_elements);
+ &Apache::lonhtmlcommon::end_pick_box().' '.$hidden_elements);
unless ($readonly) {
$r->print(' print(' value="'.$lt{'gobt'}.'" />');
}
- $r->print('
');
+ $r->print('');
+ my @actions =
+ (''.
+ &mt('Pick another action').' ');
+ $r->print(' '.&Apache::lonhtmlcommon::actionbox(\@actions));
return;
}
@@ -1268,191 +1277,145 @@ sub print_selfenrollconfig {
my $cdom = $coursehash->{'domain'};
my %currsettings = &get_selfenroll_settings($coursehash);
&print_header($r,$type);
- $r->print(''.&mt('Self-enrollment with a student role in: [_1]',
- ''.$cdesc.' ').' '."\n");
+ $r->print(''.&mt('Self-enrollment with a student role').' '."\n".
+ ''.&mt($type).': '.$cdesc.' '."\n");
&Apache::loncreateuser::print_selfenroll_menu($r,'domain',$env{'form.pickedcourse'},
$cdom,$cnum,\%currsettings,
&hidden_form_elements(),$readonly);
+ my @actions =
+ (''.
+ &mt('Pick another action').' ');
+ $r->print(' '.&Apache::lonhtmlcommon::actionbox(\@actions));
return;
}
-sub print_set_ltiauth {
- my ($r,$cdom,$cnum,$cdesc,$type,$readonly) = @_;
- my %lt = &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',
- '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;
+sub print_default_overrides {
+ my ($r,$cdom,$cnum,$cdesc,$type,$readonly,$item) = @_;
+ my (%titles,$checkeddom,$checkedcrs,$divsty,$currcrsval,$crsdefault,%crschecked,
+ $helpfile,$title,$crselements,@currcrseditors);
+ %titles = &default_overrides_titles($type);
+ my ($title,$domdefdisplay,$settings,$optiontext,$options) =
+ &default_overrides_common($item,$cdom,$cnum,$type,\%titles);
$checkeddom = ' checked="checked"';
- $domdefdisplay = $lt{'logi'};
$divsty = 'display:none';
- $authno = ' checked="checked"';
- my %domconfig =
- &Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom);
- if (ref($domconfig{'coursedefaults'}) eq 'HASH') {
- $domdef = $domconfig{'coursedefaults'}{'ltiauth'};
- }
- if ($domdef) {
- $domdefdisplay = $lt{'link'};
- }
- my %settings = &Apache::lonnet::get('environment',['internal.ltiauth'],$cdom,$cnum);
- my $ltiauth = $settings{'internal.ltiauth'};
- if ($ltiauth ne '') {
+ if ($item eq 'ltiauth') {
+ $helpfile = 'Modify_Course_LTI_Authen';
+ $crsdefault = 0;
+ } else {
+ if ($item eq 'exttool') {
+ $helpfile = 'Modify_Course_External_Tool';
+ $crsdefault = 'both';
+ } 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};
+ if ($currcrsval ne '') {
$checkedcrs = $checkeddom;
$checkeddom = '';
$divsty = 'display:inline-block';
- if ($ltiauth) {
- $authok = ' checked="checked"';
+ if ($item eq 'crseditors') {
+ @currcrseditors = split(/,/,$currcrsval);
}
- }
- &print_header($r,$type);
- my $hidden_elements = &hidden_form_elements();
- my ($disabled,$submit);
- if ($readonly) {
- $disabled = ' disabled="disabled"';
- } else {
- $submit = ' ';
- }
- my $helpitem = &Apache::loncommon::help_open_topic('Modify_Course_LTI_Authen');
- $r->print(<
-$helpitem $lt{'requ'} $cdesc
-$lt{'curd'}: $domdefdisplay
-
- $lt{'used'}
-
- $lt{'cour'}
-
-$lt{'valu'}
-
- $lt{'logi'}
-
-
- $lt{'link'}
-
-
-$submit
-
-$hidden_elements
-$lt{'back'}
-
-ENDDOCUMENT
- 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};
+ foreach my $option (@{$options}) {
+ if ($item eq 'crseditors') {
+ if (grep(/^\Q$option\E$/,@currcrseditors)) {
+ $crschecked{$option} = ' checked="checked"';
+ }
+ } elsif ($currcrsval eq $option) {
+ $crschecked{$option} = ' checked="checked"';
+ } else {
+ $crschecked{$option} = '';
}
}
- }
- if ($domdef && $domdefdom) {
- $domdefdisplay = $titles{'both'};
- } elsif ($domdef) {
- $domdefdisplay = $titles{'crs'};
- } elsif ($domdefdom) {
- $domdefdisplay = $titles{'dom'};
- } else {
- $domdefdisplay = $titles{'none'};
- }
- 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) {
+ } else {
+ if ($item eq 'crseditors') {
+ my %domdefs = &Apache::lonnet::get_domain_defaults($cdom);
+ @currcrseditors = split(/,/,$domdefs{'crseditors'});
+ }
+ foreach my $option (@{$options}) {
+ if ($item eq 'crseditors') {
+ if (grep(/^\Q$option\E$/,@currcrseditors)) {
+ $crschecked{$option} = ' checked="checked"';
+ }
+ } elsif ($crsdefault eq $option) {
$crschecked{$option} = ' checked="checked"';
} else {
$crschecked{$option} = '';
}
}
}
- &print_header($r,$type);
- my $hidden_elements = &hidden_form_elements();
- my ($disabled,$submit);
+ my ($disabled,$submit,$inputtype,$separator);
if ($readonly) {
$disabled = ' disabled="disabled"';
} else {
- $submit = ' ';
+ $submit = ' ';
}
- my $helpitem = &Apache::loncommon::help_open_topic('Modify_Course_External_Tool');
+ if ($item eq 'crseditors') {
+ $inputtype = 'checkbox';
+ $separator = ' 'x2;
+ } else {
+ $inputtype = 'radio';
+ $separator = ' ';
+ }
+ foreach my $option (@{$options}) {
+ $crselements .= ''.
+ ' '.$optiontext->{$option}.' '.
+ ' '.$separator."\n";
+ }
+ &print_header($r,$type);
+ my $hidden_elements = &hidden_form_elements();
+ my $helpitem = &Apache::loncommon::help_open_topic($helpfile);
+ my $showtype = &mt($type);
$r->print(<
-$helpitem $titles{'extt'}
-$type: $cdesc
-$titles{'curd'}: $domdefdisplay
+
$helpitem $title
+$showtype: $cdesc
+
- $titles{'cour'}
-
+ $titles{'cour'}
+
$titles{'valu'}
-
- $titles{'both'}
-
-
- $titles{'dom'}
-
-
- $titles{'crs'}
-
-
- $titles{'none'}
-
-
+$crselements
+
$submit
-
$hidden_elements
-$titles{'back'}
+
ENDDOCUMENT
+ my @actions =
+ (''.
+ $titles{'back'}.' ');
+ $r->print(' '.&Apache::lonhtmlcommon::actionbox(\@actions));
return;
}
-sub exttool_titles {
+sub default_overrides_titles {
my ($type) = @_;
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',
'none' => 'Use of external tools not permitted',
'crs' => 'Only external tools defined in course 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',
+ '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',
'cour' => 'Use course-specific setting',
'curd' => 'Current domain default is',
@@ -1469,6 +1432,102 @@ sub exttool_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 {
my ($r,$type,$cdesc,$coursehash) = @_;
return unless(ref($coursehash) eq 'HASH');
@@ -1476,13 +1535,17 @@ sub modify_selfenrollconfig {
my $cdom = $coursehash->{'domain'};
my %currsettings = &get_selfenroll_settings($coursehash);
&print_header($r,$type);
- $r->print(''.&mt('Self-enrollment with a student role in: [_1]',
- ''.$cdesc.' ').' '."\n");
- $r->print('');
+ my @actions =
+ (''.
+ &mt('Pick another action').' ');
+ $r->print(' '.&Apache::lonhtmlcommon::actionbox(\@actions));
return;
}
@@ -1514,9 +1577,9 @@ sub modifiable_only_title {
my ($type) = @_;
my $dctitle = &Apache::lonnet::plaintext('dc');
if ($type eq 'Community') {
- return &mt('Community settings modifiable only by [_1] for:',$dctitle);
+ return &mt('Community settings modifiable only by [_1]',$dctitle);
} else {
- return &mt('Course settings modifiable only by [_1] for:',$dctitle);
+ return &mt('Course settings modifiable only by [_1]',$dctitle);
}
}
@@ -1539,7 +1602,7 @@ sub gather_authenitems {
unless ($curr_authtype eq '') {
$curr_authfield = $curr_authtype.'arg';
}
- my $javascript_validations =
+ my $javascript_validations =
&Apache::lonuserutils::javascript_validations('modifycourse',$krbdefdom,
$curr_authtype,$curr_authfield);
my %param = ( formname => 'document.'.$env{'form.phase'},
@@ -1573,7 +1636,7 @@ sub modify_course {
unless ($type eq 'Community') {
push(@items,('internal.coursecode','internal.authtype','internal.autharg',
'internal.sectionnums','internal.crosslistings'));
- if (&showcredits($cdom)) {
+ if (&showcredits($cdom)) {
push(@items,'internal.defaultcredits');
}
my %passwdconf = &Apache::lonnet::get_passwdconf($cdom);
@@ -1696,7 +1759,7 @@ sub modify_course {
$newattr{'courseowner'}=$env{'form.courseowner'};
unless ( $newattr{'courseowner'} eq $currattr{'courseowner'} ) {
$changed{'owner'} = 1;
- }
+ }
}
if ($changed{'owner'} || $changed{'code'} || $changed{'passwd'}) {
@@ -1763,7 +1826,7 @@ sub modify_course {
} else {
if ($env{'course.'.$cdom.'_'.$cnum.'.description'} ne '') {
my %newenv;
- map { $newenv{'course.'.$cdom.'_'.$cnum.'.internal.'.$_} = $newattr{$_}; } @changes;
+ map { $newenv{'course.'.$cdom.'_'.$cnum.'.internal.'.$_} = $newattr{$_}; } @changes;
&Apache::lonnet::appenv(\%newenv);
}
foreach my $attr (@modifiable_params) {
@@ -1822,7 +1885,6 @@ sub modify_course {
if ($course_check eq 'ok') {
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'},$coowners);
unless ($outcome eq 'ok') {
-
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3] for the following reason: "[_4]".',$description,$newattr{'coursecode'},$instsec,$outcome).' ');
}
} else {
@@ -1886,7 +1948,7 @@ sub modify_course {
$nochgresponse .= " ";
}
my ($warning,$numwarnings);
- my $numwarnings = scalar(@warnings);
+ my $numwarnings = scalar(@warnings);
if ($numwarnings) {
$warning = &mt('The following [quant,_1,warning was,warnings were] generated when applying your changes to automated enrollment:',$numwarnings).'
';
foreach my $warn (@warnings) {
@@ -1900,8 +1962,8 @@ sub modify_course {
$reply = $chgresponse.$nochgresponse.$warning;
}
&print_header($r,$type);
- my $mainheader = &modifiable_only_title($type);
- $reply = ''.$mainheader.' '.$cdesc.' '."\n".
+ $reply = ''.&modifiable_only_title($type).' '."\n".
+ ''.&mt($type).': '.$cdesc.' '."\n".
''.$reply.'
'."\n".
' ';
+ $reply .= ''.
+ ' '.&Apache::lonhtmlcommon::actionbox(\@actions);
$r->print($reply);
return;
}
@@ -2085,10 +2148,9 @@ sub modify_quota {
my ($r,$cdom,$cnum,$cdesc,$domdesc,$type) = @_;
&print_header($r,$type);
my $lctype = lc($type);
- my $headline = &mt("Disk space quotas for $lctype: [_1]",
- ''.$cdesc.' ');
- $r->print('');
+ my @actions =
+ (''.
+ &mt('Pick another action').' ');
+ $r->print(' '.&Apache::lonhtmlcommon::actionbox(\@actions));
return;
}
sub modify_anonsurvey_threshold {
my ($r,$cdom,$cnum,$cdesc,$domdesc,$type) = @_;
&print_header($r,$type);
- $r->print('');
+ my @actions =
+ (''.
+ &mt('Pick another action').' ');
+ $r->print(' '.&Apache::lonhtmlcommon::actionbox(\@actions));
return;
}
@@ -2261,18 +2325,19 @@ sub modify_postsubmit_config {
unch => 'Post submission behavior of the Submit button is unchanged.',
erro => 'An error occurred when saving your proposed changes.',
inva => 'An invalid response was recorded.',
- pick => 'Pick another action',
+ back => 'Pick another action',
);
- $r->print('');
+ $r->print(''.&hidden_form_elements().'');
+ my @actions =
+ (''.
+ $lt{'back'}.' ');
+ $r->print(' '.&Apache::lonhtmlcommon::actionbox(\@actions));
return;
}
@@ -2342,16 +2408,16 @@ sub modify_catsettings {
$desc{'categories'} = &mt('Assigned categories for this course');
$ccrole = 'cc';
}
- $r->print('
-');
+ $r->print(' '.&hidden_form_elements().'');
+ my @actions =
+ (''.
+ &mt('Pick another action').' ');
+ $r->print(' '.&Apache::lonhtmlcommon::actionbox(\@actions));
return;
}
-sub modify_ltiauth {
- my ($r,$cdom,$cnum,$cdesc,$domdesc,$type) = @_;
- my %lt = &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',
- 'used' => 'Use domain default',
- 'cour' => 'Use course-specific setting',
- 'modi' => 'Save',
- 'back' => 'Pick another action',
- );
- &print_header($r,$type);
- $r->print('');
- return;
-}
-
-sub modify_exttool {
- my ($r,$cdom,$cnum,$cdesc,$domdesc,$type) = @_;
- my %titles = &exttool_titles($type);
- &print_header($r,$type);
- $r->print('');
+ $r->print(' '.$status.''.
+ &hidden_form_elements().'');
+ my @actions =
+ (''.
+ $titles{'back'}.' ');
+ $r->print(' '.&Apache::lonhtmlcommon::actionbox(\@actions));
return;
}
@@ -2763,7 +2742,7 @@ ENDSCRIPT
&js_escape(\$alert);
my $regexp = ' /^\s*\d+\s*$/';
- $js .= <<"ENDSCRIPT";
+ $js .= <<"ENDSCRIPT";
function verify_postsubmit() {
var optionsElement = document.setpostsubmit.postsubmit;
@@ -2795,7 +2774,7 @@ function verify_postsubmit() {
}
} else {
if (currval == 0) {
- verified = 'ok';
+ verified = 'ok';
} else {
alert('$invalid');
return false;
@@ -2813,7 +2792,7 @@ function togglePostsubmit(caller) {
var optionsElement = document.setpostsubmit.postsubmit;
if (document.getElementById(caller)) {
var divitem = document.getElementById(caller);
- var optionsElement = document.setpostsubmit.postsubmit;
+ var optionsElement = document.setpostsubmit.postsubmit;
if (optionsElement.length) {
var currval;
for (var i=0; i {'onload' => "hide_searching(); courseSet(document.filterpicker.official, 'load');"},
- };
- } elsif ($env{'form.phase'} eq 'setltiauth') {
+ } elsif ($env{'form.phase'} =~ /^set(ltiauth|exttool|crseditors)$/) {
$starthash = {
- add_entries => {'onload' => "toggleLTIOptions(document.setltiauth);"},
- };
- } elsif ($env{'form.phase'} eq 'setexttool') {
- $starthash = {
- add_entries => {'onload' => "toggleExtToolOptions(document.setexttool);"},
+ add_entries => {'onload' => "toggleOptions(document.$env{'form.phase'},'$env{'form.phase'}');"},
};
}
$r->print(&Apache::loncommon::start_page('View/Modify Course/Community Settings',
@@ -2919,7 +2878,15 @@ ENDJS
} else {
$bread_text = 'Course Settings';
}
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($bread_text));
+ my $helpcomponent;
+ if ($env{'form.phase'} eq 'menu') {
+ if ($type eq 'Community') {
+ $helpcomponent = 'Domain_Modify_Community';
+ } else {
+ $helpcomponent = 'Domain_Modify_Course';
+ }
+ }
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs($bread_text,$helpcomponent));
return;
}
@@ -3000,14 +2967,15 @@ sub course_settings_descrip {
}
sub hidden_form_elements {
- my $hidden_elements =
+ my $hidden_elements =
&Apache::lonhtmlcommon::echo_form_input(['gosearch','updater','coursecode',
'prevphase','numlocalcc','courseowner','login','coursequota','intarg',
'locarg','krbarg','krbver','counter','hidefromcat','usecategory',
'threshold','postsubmit','postsubtimeout','defaultcredits','uploadquota',
'selfenrollmgrdc','selfenrollmgrcc','action','state','currsec_st',
'sections','newsec','mysqltables','nopasswdchg','ltiauth','ltiauthset',
- 'exttoolset','exttool'],['^selfenrollmgr_','^selfenroll_'])."\n".
+ 'exttoolset','exttool','crseditorsset','crseditors'],
+ ['^selfenrollmgr_','^selfenroll_'])."\n".
' ';
return $hidden_elements;
}
@@ -3044,6 +3012,8 @@ sub get_permission {
processltiauth => 'edit',
setexttool => 'edit',
processexttool => 'edit',
+ setcrseditors => 'edit',
+ processcrseditors => 'edit',
);
if ($passwdconf{'crsownerchg'}) {
$permission{passwdchg} = 'edit';
@@ -3061,6 +3031,7 @@ sub get_permission {
adhocrole => 'custom',
setltiauth => 'view',
setexttool => 'view',
+ setcrseditors => 'view',
);
if ($passwdconf{'crsownerchg'}) {
$permission{passwdchg} = 'view';
@@ -3128,7 +3099,7 @@ sub handler {
$choose_text = "Choose a community";
} else {
$choose_text = "Choose a course";
- }
+ }
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:changePage(document.$firstform,'')",
text=>"Course/Community search"},
@@ -3176,7 +3147,7 @@ sub handler {
({href=>"javascript:changePage(document.$phase,'$phase')",
text=>$linktext});
&print_setquota($r,$cdom,$cnum,$cdesc,$type,$readonly);
- } elsif (($phase eq 'processquota') && ($permission->{'processquota'})) {
+ } elsif (($phase eq 'processquota') && ($permission->{'processquota'})) {
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:changePage(document.$phase,'setquota')",
text=>"Set quota"});
@@ -3255,7 +3226,7 @@ sub handler {
if (!exists($env{'form.state'})) {
&print_selfenrollconfig($r,$type,$cdesc,$coursehash,$readonly);
} elsif ($env{'form.state'} eq 'done') {
- &Apache::lonhtmlcommon::add_breadcrumb
+ &Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:changePage(document.$phase,'$phase')",
text=>"Result"});
&modify_selfenrollconfig($r,$type,$cdesc,$coursehash);
@@ -3263,27 +3234,39 @@ sub handler {
} elsif (($phase eq 'setltiauth') && ($permission->{'setltiauth'})) {
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:changePage(document.$phase,'$phase')",
- text=>"Requirement for re-authentication for LTI launch of deep-linked item"});
- &print_set_ltiauth($r,$cdom,$cnum,$cdesc,$type,$readonly);
+ text=>"Authentication post-LTI launch"});
+ &print_default_overrides($r,$cdom,$cnum,$cdesc,$type,$readonly,'ltiauth');
} elsif (($phase eq 'processltiauth') && ($permission->{'processltiauth'})) {
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:changePage(document.$phase,'setltiauth')",
- text=>"Requirement for re-authentication for LTI launch of deep-linked item"},
+ text=>"Authentication post-LTI launch"},
{href=>"javascript:changePage(document.$phase,'$phase')",
text=>"Result"});
- &modify_ltiauth($r,$cdom,$cnum,$cdesc,$domdesc,$type);
+ &modify_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'ltiauth');
} elsif (($phase eq 'setexttool') && ($permission->{'setexttool'})) {
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:changePage(document.$phase,'$phase')",
text=>"External Tool permission"});
- &print_set_exttool($r,$cdom,$cnum,$cdesc,$type,$readonly);
+ &print_default_overrides($r,$cdom,$cnum,$cdesc,$type,$readonly,'exttool');
} elsif (($phase eq 'processexttool') && ($permission->{'processexttool'})) {
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:changePage(document.$phase,'setexttool')",
text=>"External Tool permission"},
{href=>"javascript:changePage(document.$phase,'$phase')",
text=>"Result"});
- &modify_exttool($r,$cdom,$cnum,$cdesc,$domdesc,$type);
+ &modify_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'exttool');
+ } 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 {