version 1.118, 2023/03/19 16:05:48
|
version 1.132, 2024/12/20 00:24:38
|
Line 316 sub handler {
|
Line 316 sub handler {
|
idnu => 'Course ID or number', |
idnu => 'Course ID or number', |
unco => 'Unique code', |
unco => 'Unique code', |
desc => 'Course Description', |
desc => 'Course Description', |
cred => 'Student credits', |
cred => 'Student credits', |
ownr => 'Course Owner', |
ownr => 'Course Owner', |
cown => 'Course Co-owners', |
cown => 'Course Co-owners', |
catg => 'Categorize course', |
catg => 'Categorize course', |
Line 372 sub handler {
|
Line 372 sub handler {
|
|
|
my %values=&Apache::lonnet::dump('environment',$cdom,$cnum); |
my %values=&Apache::lonnet::dump('environment',$cdom,$cnum); |
my %linkprot=&Apache::lonnet::dump('lti',$cdom,$cnum,undef,undef,undef,1); |
my %linkprot=&Apache::lonnet::dump('lti',$cdom,$cnum,undef,undef,undef,1); |
|
my %domdefs = &Apache::lonnet::get_domain_defaults($cdom); |
|
unless ($phase eq 'process') { |
|
if (ref($domdefs{'linkprotsuggested'}) eq 'HASH') { |
|
$values{'suggested'} = $domdefs{'linkprotsuggested'}; |
|
} |
|
} |
my %ltienc = &Apache::lonnet::dump('nohist_ltienc',$cdom,$cnum,undef,undef,undef,1); |
my %ltienc = &Apache::lonnet::dump('nohist_ltienc',$cdom,$cnum,undef,undef,undef,1); |
my %ltitools = &Apache::lonnet::dump('ltitools',$cdom,$cnum,undef,undef,undef,1); |
my %ltitools = &Apache::lonnet::dump('ltitools',$cdom,$cnum,undef,undef,undef,1); |
my %ltitoolsenc = &Apache::lonnet::dump('nohist_toolsenc',$cdom,$cnum,undef,undef,undef,1); |
my %ltitoolsenc = &Apache::lonnet::dump('nohist_toolsenc',$cdom,$cnum,undef,undef,undef,1); |
Line 522 sub handler {
|
Line 528 sub handler {
|
uselcmath => 'Student formula entry uses inline preview, not DragMath pop-up', |
uselcmath => 'Student formula entry uses inline preview, not DragMath pop-up', |
usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)', |
usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)', |
inline_chem => 'Chemical reaction response uses inline preview, not pop-up', |
inline_chem => 'Chemical reaction response uses inline preview, not pop-up', |
extresource => 'Display of external resources', |
extresource => 'Display of external resources', |
}, |
}, |
}, |
}, |
'grading' => |
'grading' => |
Line 694 sub get_allitems {
|
Line 700 sub get_allitems {
|
if ($item eq 'feedback') { |
if ($item eq 'feedback') { |
push(@allitems,(map { $_.'.text'; } @{$prefs{$item}{'ordered'}})); |
push(@allitems,(map { $_.'.text'; } @{$prefs{$item}{'ordered'}})); |
} |
} |
|
} elsif (($item eq 'linkprot') || ($item eq 'ltitools')) { |
|
push(@allitems,$item); |
} |
} |
} |
} |
} |
} |
Line 791 sub print_config_box {
|
Line 799 sub print_config_box {
|
<tr> |
<tr> |
<td> |
<td> |
<table class="LC_nested">'; |
<table class="LC_nested">'; |
|
if ($action eq 'linkprot') { |
|
if ((ref($settings) eq 'HASH') && (ref($settings->{'suggested'}) eq 'HASH')) { |
|
my $hints; |
|
my $hintcount = 0; |
|
foreach my $key (sort { $a <=> $b } keys(%{$settings->{'suggested'}})) { |
|
if ((ref($settings->{'suggested'}->{$key}) eq 'HASH')) { |
|
if (($settings->{'suggested'}->{$key}-{'name'} ne '') && |
|
($settings->{'suggested'}->{$key}-{'info'} ne '')) { |
|
my $css_class = $hintcount%2?' class="LC_odd_row"':' class="LC_even_row"'; |
|
$hints .= '<tr '.$css_class.'><td class="LC_left_item">'. |
|
$settings->{'suggested'}->{$key}->{'name'}.'</td>'. |
|
'<td class="LC_right_item"><pre>'. |
|
$settings->{'suggested'}->{$key}->{'info'}. |
|
'</pre></td></tr>'; |
|
$hintcount ++; |
|
} |
|
} |
|
} |
|
if ($hintcount) { |
|
$output .= '<tr class="LC_info_row">'. |
|
'<td colspan="2" class="LC_left_item">'.&mt('Recommendation(s) for specific launcher application(s)').'</td>'. |
|
'</tr>'."\n". |
|
'<tr class="LC_info_row">'. |
|
'<td class="LC_left_item"><span class="LC_nobreak">'.&mt('Launcher Application').'</span></td>'. |
|
'<td class="LC_right_item">'.&mt('Recommendation(s)').'</td></tr>'."\n". |
|
$hints; |
|
} |
|
} |
|
} |
if (exists $item->{'header'}->[0]->{'col1'} || |
if (exists $item->{'header'}->[0]->{'col1'} || |
exists $item->{'header'}->[0]->{'col2'}) { |
exists $item->{'header'}->[0]->{'col2'}) { |
$output .= ' |
$output .= ' |
<tr class="LC_info_row"> |
<tr class="LC_info_row"> |
<td class="LC_left_item" valign="top">'.&mt($item->{'header'}->[0]->{'col1'}).'</td>'; |
<td class="LC_left_item" valign="top">'.&mt($item->{'header'}->[0]->{'col1'}).'</td>'; |
if (($action eq 'courseinfo') || ($action eq 'localization') || |
if (($action eq 'courseinfo') || ($action eq 'localization') || |
Line 820 sub print_config_box {
|
Line 857 sub print_config_box {
|
} elsif ($action eq 'appearance') { |
} elsif ($action eq 'appearance') { |
$output .= &print_appearance($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
$output .= &print_appearance($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'grading') { |
} elsif ($action eq 'grading') { |
$output .= &print_grading($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
$output .= &print_grading($cdom,$cnum,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'printouts') { |
} elsif ($action eq 'printouts') { |
$output .= &print_printouts($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
$output .= &print_printouts($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'spreadsheet') { |
} elsif ($action eq 'spreadsheet') { |
Line 1337 sub process_changes {
|
Line 1374 sub process_changes {
|
my ($classorder,$classtitles) = &discussion_vote_classes(); |
my ($classorder,$classtitles) = &discussion_vote_classes(); |
my $fontchange = 0; |
my $fontchange = 0; |
foreach my $class (@{$classorder}) { |
foreach my $class (@{$classorder}) { |
my $ext_entry = $entry.'_'.$class; |
my $ext_entry = $entry.'_'.$class; |
my $size = $env{'form.'.$ext_entry.'_size'}; |
my $size = $env{'form.'.$ext_entry.'_size'}; |
my $unit = $env{'form.'.$ext_entry.'_unit'}; |
my $unit = $env{'form.'.$ext_entry.'_unit'}; |
my $weight = $env{'form.'.$ext_entry.'_weight'}; |
my $weight = $env{'form.'.$ext_entry.'_weight'}; |
my $style = $env{'form.'.$ext_entry.'_style'}; |
my $style = $env{'form.'.$ext_entry.'_style'}; |
my $other = $env{'form.'.$ext_entry.'_other'}; |
my $other = $env{'form.'.$ext_entry.'_other'}; |
$size =~ s/,//g; |
$size =~ s/,//g; |
$unit =~ s/,//g; |
$unit =~ s/,//g; |
$weight =~ s/,//g; |
$weight =~ s/,//g; |
$style =~ s/,//g; |
$style =~ s/,//g; |
$other =~ s/[^\w;:\s\-\%.]//g; |
$other =~ s/[^\w;:\s\-\%.]//g; |
Line 1352 sub process_changes {
|
Line 1389 sub process_changes {
|
$newvalues{$ext_entry} = join(',',($size.$unit,$weight,$style,$other)); |
$newvalues{$ext_entry} = join(',',($size.$unit,$weight,$style,$other)); |
my $current = $values->{$ext_entry}; |
my $current = $values->{$ext_entry}; |
if ($values->{$ext_entry} eq '') { |
if ($values->{$ext_entry} eq '') { |
$current = ',,,'; |
$current = ',,,'; |
} |
} |
if ($newvalues{$ext_entry} ne $current) { |
if ($newvalues{$ext_entry} ne $current) { |
$changes->{$ext_entry} = $newvalues{$ext_entry}; |
$changes->{$ext_entry} = $newvalues{$ext_entry}; |
Line 1361 sub process_changes {
|
Line 1398 sub process_changes {
|
} |
} |
if ($fontchange) { |
if ($fontchange) { |
$changes->{$entry} = 1; |
$changes->{$entry} = 1; |
} |
} |
} elsif ($entry eq 'nothideprivileged') { |
} elsif ($entry eq 'nothideprivileged') { |
my @curr_nothide; |
my @curr_nothide; |
my @new_nothide; |
my @new_nothide; |
Line 1436 sub process_changes {
|
Line 1473 sub process_changes {
|
my $newtext = $maxnum-1; |
my $newtext = $maxnum-1; |
$newhdr[$env{'form.printfmthdr_pos_'.$newtext}] = $env{'form.printfmthdr_text_'.$newtext}; |
$newhdr[$env{'form.printfmthdr_pos_'.$newtext}] = $env{'form.printfmthdr_text_'.$newtext}; |
$newvalues{$entry} = join('',@newhdr); |
$newvalues{$entry} = join('',@newhdr); |
} elsif (($entry eq 'languages') || |
} elsif (($entry eq 'languages') || |
($entry eq 'checkforpriv')) { |
($entry eq 'checkforpriv')) { |
my $settings; |
my $settings; |
my $total = $env{'form.'.$entry.'_total'}; |
my $total = $env{'form.'.$entry.'_total'}; |
Line 1452 sub process_changes {
|
Line 1489 sub process_changes {
|
} |
} |
if ($env{'form.'.$entry.'_'.$total} ne '') { |
if ($env{'form.'.$entry.'_'.$total} ne '') { |
my $new = $env{'form.'.$entry.'_'.$total}; |
my $new = $env{'form.'.$entry.'_'.$total}; |
if ($entry eq 'languages') { |
if ($entry eq 'languages') { |
my %langchoices = &get_lang_choices(); |
my %langchoices = &get_lang_choices(); |
if ($langchoices{$new}) { |
if ($langchoices{$new}) { |
$settings .= $new; |
$settings .= $new; |
Line 1548 sub process_changes {
|
Line 1585 sub process_changes {
|
} elsif ($values->{$entry}) { |
} elsif ($values->{$entry}) { |
$changes->{$entry} = ''; |
$changes->{$entry} = ''; |
} |
} |
|
} elsif ($entry eq 'grading') { |
|
if ($env{'form.'.$entry} eq 'standard') { |
|
if ($env{'form.hidetotals'}) { |
|
my %sections = &Apache::loncommon::get_sections($cdom,$cnum); |
|
if (keys(%sections)) { |
|
my @secs = &Apache::loncommon::get_env_multiple('form.hidetotals_sections'); |
|
if (grep(/^all$/,@secs)) { |
|
$newvalues{'hidetotals'} = 'all'; |
|
} elsif (@secs) { |
|
$newvalues{'hidetotals'} = ''; |
|
foreach my $sec (sort {$a <=> $b} @secs) { |
|
if (exists($sections{$sec})) { |
|
$newvalues{'hidetotals'} .= $sec.',' |
|
} |
|
} |
|
$newvalues{'hidetotals'} =~ s/,$//; |
|
} |
|
} else { |
|
$newvalues{'hidetotals'} = 'all'; |
|
} |
|
} |
|
} |
|
if ($newvalues{'hidetotals'} ne $values->{'hidetotals'}) { |
|
$changes->{'hidetotals'} = $newvalues{'hidetotals'}; |
|
$changes->{'grading'} = $env{'form.'.$entry}; |
|
} |
|
$newvalues{$entry} = $env{'form.'.$entry}; |
} else { |
} else { |
$newvalues{$entry} = $env{'form.'.$entry}; |
$newvalues{$entry} = $env{'form.'.$entry}; |
} |
} |
unless (($entry eq 'co-owners') || ($entry eq 'discussion_post_fonts') || |
unless (($entry eq 'co-owners') || ($entry eq 'discussion_post_fonts') || |
($entry eq 'extresource') || ($entry eq 'timezone')) { |
($entry eq 'extresource') || ($entry eq 'timezone')) { |
if ($newvalues{$entry} ne $values->{$entry}) { |
if ($newvalues{$entry} ne $values->{$entry}) { |
$changes->{$entry} = $newvalues{$entry}; |
$changes->{$entry} = $newvalues{$entry}; |
Line 1661 sub process_linkprot {
|
Line 1725 sub process_linkprot {
|
} elsif (exists($env{$urlparamname})) { |
} elsif (exists($env{$urlparamname})) { |
$env{$urlparamname} = ''; |
$env{$urlparamname} = ''; |
} |
} |
|
my $passback = 'form.linkprot_passback_'.$idx; |
|
my $passbackparamname = 'form.linkprot_passbackformat_'.$idx; |
|
if ($env{$passback} == 1) { |
|
unless ($env{$passbackparamname} =~ /^1\.(0|1)$/) { |
|
$env{$passbackparamname} = ''; |
|
} |
|
} elsif (exists($env{$passbackparamname})) { |
|
$env{$passbackparamname} = ''; |
|
} |
unless ($idx eq 'add') { |
unless ($idx eq 'add') { |
if ((!$current{'returnurl'} && ($env{$urlparamname} ne '')) || |
if ((!$current{'returnurl'} && ($env{$urlparamname} ne '')) || |
($current{'returnurl'} && ($env{$urlparamname} eq ''))) { |
($current{'returnurl'} && ($env{$urlparamname} eq ''))) { |
$haschanges{$itemid} = 1; |
$haschanges{$itemid} = 1; |
} |
} |
|
if ((!$current{'passback'} && ($env{$passbackparamname} ne '')) || |
|
($current{'passback'} && ($env{$passbackparamname} eq ''))) { |
|
$haschanges{$itemid} = 1; |
|
} |
} |
} |
if ($env{$urlparamname} ne '') { |
if ($env{$urlparamname} ne '') { |
$linkprot{$itemid}{'returnurl'} = $env{$urlparamname}; |
$linkprot{$itemid}{'returnurl'} = $env{$urlparamname}; |
} |
} |
|
if ($env{$passbackparamname} ne '') { |
|
$linkprot{$itemid}{'passback'} = 1; |
|
$linkprot{$itemid}{'passbackformat'} = $env{$passbackparamname}; |
|
} |
if ($ltiauth) { |
if ($ltiauth) { |
my $reqitem = 'form.linkprot_requser_'.$idx; |
my $reqitem = 'form.linkprot_requser_'.$idx; |
$env{$reqitem} =~ s/(`)/'/g; |
$env{$reqitem} =~ s/(`)/'/g; |
Line 1780 sub get_linkprot_id {
|
Line 1861 sub get_linkprot_id {
|
$tries ++; |
$tries ++; |
sleep (0.1); |
sleep (0.1); |
if ($context eq 'domain') { |
if ($context eq 'domain') { |
$gotlock = &Apache::lonnet::newput_dom('linkprot',$lockhash,$cdom); |
$gotlock = &Apache::lonnet::newput_dom('linkprot',$lockhash,$cdom); |
} else { |
} else { |
$gotlock = &Apache::lonnet::newput('lti',$lockhash,$cdom,$cnum); |
$gotlock = &Apache::lonnet::newput('lti',$lockhash,$cdom,$cnum); |
} |
} |
Line 1818 sub get_linkprot_id {
|
Line 1899 sub get_linkprot_id {
|
$error = 'nonumber'; |
$error = 'nonumber'; |
} |
} |
} |
} |
my $dellockoutcome; |
my $dellockoutcome; |
if ($context eq 'domain') { |
if ($context eq 'domain') { |
$dellockoutcome = &Apache::lonnet::del_dom('linkprot',['lock'],$cdom); |
$dellockoutcome = &Apache::lonnet::del_dom('linkprot',['lock'],$cdom); |
} else { |
} else { |
Line 1883 sub process_ltitools {
|
Line 1964 sub process_ltitools {
|
my @allfields = ('fullname','firstname','lastname','email','user','roles'); |
my @allfields = ('fullname','firstname','lastname','email','user','roles'); |
map { $possfield{$_} = 1; } @allfields; |
map { $possfield{$_} = 1; } @allfields; |
|
|
my ($dest,$privnum,$cipher,$errors,%ltitools); |
my ($dest,$privnum,$cipher); |
|
|
($cipher,$privnum) = &get_credentials($cdom,$cnum,'ltitools',$context); |
($cipher,$privnum) = &get_credentials($cdom,$cnum,'ltitools',$context); |
if ($context eq 'domain') { |
if ($context eq 'domain') { |
Line 1897 sub process_ltitools {
|
Line 1978 sub process_ltitools {
|
if ($env{'form.ltitools_add'}) { |
if ($env{'form.ltitools_add'}) { |
my $title = $env{'form.ltitools_add_title'}; |
my $title = $env{'form.ltitools_add_title'}; |
$title =~ s/(`)/'/g; |
$title =~ s/(`)/'/g; |
my ($newid,$error) = &get_ltitools_id($context,$cdom,$cnum,$title); |
my ($newid,$error) = &Apache::lonnet::get_ltitools_id($context,$cdom,$cnum,$title); |
if ($newid) { |
if ($newid) { |
my $position = $env{'form.ltitools_add_pos'}; |
my $position = $env{'form.ltitools_add_pos'}; |
$position =~ s/\D+//g; |
$position =~ s/\D+//g; |
Line 2011 sub process_ltitools {
|
Line 2092 sub process_ltitools {
|
if ($env{$keyitem} ne '') { |
if ($env{$keyitem} ne '') { |
$ltitools{$newid}{'key'} = $env{$keyitem}; |
$ltitools{$newid}{'key'} = $env{$keyitem}; |
} |
} |
my $secretitem = 'form.ltitools_add_secret'; |
my $secretitem = 'form.ltitools_secret_add'; |
$env{$secretitem} =~ s/(`)/'/g; |
$env{$secretitem} =~ s/(`)/'/g; |
if ($env{$secretitem} ne '') { |
if ($env{$secretitem} ne '') { |
if ($privnum && $cipher) { |
if ($privnum && $cipher) { |
Line 2351 sub process_ltitools {
|
Line 2432 sub process_ltitools {
|
return $errors; |
return $errors; |
} |
} |
|
|
sub get_ltitools_id { |
|
my ($context,$cdom,$cnum,$title) = @_; |
|
my ($lockhash,$tries,$gotlock,$id,$error); |
|
|
|
# get lock on ltitools db |
|
$lockhash = { |
|
lock => $env{'user.name'}. |
|
':'.$env{'user.domain'}, |
|
}; |
|
$tries = 0; |
|
if ($context eq 'domain') { |
|
$gotlock = &Apache::lonnet::newput_dom('ltitools',$lockhash,$cdom); |
|
} else { |
|
$gotlock = &Apache::lonnet::newput('ltitools',$lockhash,$cdom,$cnum); |
|
} |
|
while (($gotlock ne 'ok') && ($tries<10)) { |
|
$tries ++; |
|
sleep (0.1); |
|
if ($context eq 'domain') { |
|
$gotlock = &Apache::lonnet::newput_dom('ltitools',$lockhash,$cdom); |
|
} else { |
|
$gotlock = &Apache::lonnet::newput('ltitools',$lockhash,$cdom,$cnum); |
|
} |
|
} |
|
if ($gotlock eq 'ok') { |
|
my %currids; |
|
if ($context eq 'domain') { |
|
%currids = &Apache::lonnet::dump_dom('ltitools',$cdom); |
|
} else { |
|
%currids = &Apache::lonnet::dump('ltitools',$cdom,$cnum); |
|
} |
|
if ($currids{'lock'}) { |
|
delete($currids{'lock'}); |
|
if (keys(%currids)) { |
|
my @curr = sort { $a <=> $b } keys(%currids); |
|
if ($curr[-1] =~ /^\d+$/) { |
|
$id = 1 + $curr[-1]; |
|
} |
|
} else { |
|
$id = 1; |
|
} |
|
if ($id) { |
|
if ($context eq 'domain') { |
|
unless (&Apache::lonnet::newput_dom('ltitools',{ $id => $title },$cdom) eq 'ok') { |
|
$error = 'nostore'; |
|
} |
|
} else { |
|
unless (&Apache::lonnet::newput('ltitools',{ $id => $title },$cdom,$cnum) eq 'ok') { |
|
$error = 'nostore'; |
|
} |
|
} |
|
} else { |
|
$error = 'nonumber'; |
|
} |
|
} |
|
my $dellockoutcome; |
|
if ($context eq 'domain') { |
|
$dellockoutcome = &Apache::lonnet::del_dom('ltitools',['lock'],$cdom); |
|
} else { |
|
$dellockoutcome = &Apache::lonnet::del('ltitools',['lock'],$cdom,$cnum); |
|
} |
|
} else { |
|
$error = 'nolock'; |
|
} |
|
return ($id,$error); |
|
} |
|
|
|
sub process_ltitools_image { |
sub process_ltitools_image { |
my ($r,$context,$dom,$cnum,$confname,$caller,$itemid,$configuserok,$switch,$author_ok,$currimg) = @_; |
my ($r,$context,$dom,$cnum,$confname,$caller,$itemid,$configuserok,$switch,$author_ok,$currimg) = @_; |
my $filename = $env{'form.'.$caller.'.filename'}; |
my $filename = $env{'form.'.$caller.'.filename'}; |
Line 2679 sub store_changes {
|
Line 2693 sub store_changes {
|
unless (($key eq 'co-owners') || ($key eq 'discussion_post_fonts') || ($key eq 'extresource')) { |
unless (($key eq 'co-owners') || ($key eq 'discussion_post_fonts') || ($key eq 'extresource')) { |
$displayval = $changes->{$item}{$key}; |
$displayval = $changes->{$item}{$key}; |
} |
} |
|
if (($item eq 'grading') && ($key eq 'grading')) { |
|
if ($displayval eq 'standard') { |
|
my $hidetotals; |
|
if (exists($changes->{$item}{'hidetotals'})) { |
|
if ($changes->{$item}{'hidetotals'} eq '') { |
|
if (exists($values->{'hidetotals'})) { |
|
push(@delkeys,'hidetotals'); |
|
} |
|
} else { |
|
$hidetotals = $changes->{$item}{'hidetotals'}; |
|
} |
|
} elsif (exists($values->{'hidetotals'})) { |
|
$hidetotals = $values->{'hidetotals'}; |
|
} |
|
if ($hidetotals eq '') { |
|
$displayval = &mt('standard with "hide course totals" set to "No"'); |
|
if (exists($values->{'hidetotals'})) { |
|
push(@delkeys,'hidetotals'); |
|
} |
|
} elsif ($hidetotals =~ /^([\w,]+)$/) { |
|
my $secstr = $1; |
|
my @secs = split(/,/,$secstr); |
|
if (grep(/^all$/,@secs)) { |
|
$displayval = &mt('standard with "hide course totals" set to "Yes" for all users'); |
|
$hidetotals = 'all'; |
|
} else { |
|
$displayval = &mt('standard with "hide course totals" set to "Yes" for users in section(s): [_1]',join(', ',@secs)); |
|
} |
|
$storehash{'hidetotals'} = $hidetotals; |
|
} |
|
} elsif (exists($values->{'hidetotals'})) { |
|
push(@delkeys,'hidetotals'); |
|
} |
|
} |
if ($item eq 'feedback') { |
if ($item eq 'feedback') { |
if ($key =~ /^(question|policy|comment)(\.email)\.text$/) { |
if ($key =~ /^(question|policy|comment)(\.email)\.text$/) { |
$text = $prefs->{$item}->{'itemtext'}{$1.$2}; |
$text = $prefs->{$item}->{'itemtext'}{$1.$2}; |
Line 3088 sub store_linkprot {
|
Line 3136 sub store_linkprot {
|
my %values = %{$changes->{$id}}; |
my %values = %{$changes->{$id}}; |
my %desc = &linkprot_names(); |
my %desc = &linkprot_names(); |
my $display; |
my $display; |
foreach my $title ('name','lifetime','version','key','secret','returnurl') { |
foreach my $title ('name','lifetime','version','key','secret','returnurl','passbackformat') { |
if (($title eq 'key') || ($title eq 'secret')) { |
if (($title eq 'key') || ($title eq 'secret')) { |
if (ref($ltienc{$id}) eq 'HASH') { |
if (ref($ltienc{$id}) eq 'HASH') { |
if (exists($ltienc{$id}{$title})) { |
if (exists($ltienc{$id}{$title})) { |
Line 3106 sub store_linkprot {
|
Line 3154 sub store_linkprot {
|
} |
} |
} elsif ($title eq 'returnurl') { |
} elsif ($title eq 'returnurl') { |
if ($values{$title}) { |
if ($values{$title}) { |
$display .= &mt('Return URL parameter').': '.$values{$title}.', '; |
$display .= &mt('Return URL parameter').': '.$values{$title}.', '; |
|
} |
|
} elsif ($title eq 'passbackformat') { |
|
if ($values{$title} eq '1.0') { |
|
$display .= &mt('Can return grades to Launcher with Outcomes Service 1.0 format').', '; |
|
} elsif ($values{$title} eq '1.1') { |
|
$display .= &mt('Can return grades to Launcher with Outcomes Service 1.1 format').', '; |
} |
} |
} else { |
} else { |
$display .= $desc{$title}.': '.$values{$title}.', '; |
$display .= $desc{$title}.': '.$values{$title}.', '; |
Line 3223 sub store_ltitools {
|
Line 3277 sub store_ltitools {
|
&Apache::lonnet::devalidate_cache_new('courseltitools',$hashid); |
&Apache::lonnet::devalidate_cache_new('courseltitools',$hashid); |
unless (($home eq 'no_host') || ($home eq '')) { |
unless (($home eq 'no_host') || ($home eq '')) { |
if (grep(/^\Q$home\E$/,@ids)) { |
if (grep(/^\Q$home\E$/,@ids)) { |
&Apache::lonnet::devalidate_cache_new('courseltitoolsenc',$hashid); |
&Apache::lonnet::devalidate_cache_new('crsltitoolsenc',$hashid); |
} |
} |
} |
} |
} else { |
} else { |
Line 3266 sub store_ltitools {
|
Line 3320 sub store_ltitools {
|
} |
} |
} |
} |
} |
} |
$output .= '<li>'.&mt('Configurable in course:'); |
$output .= '<li>'; |
|
if ($context eq 'domain') { |
|
$output .= &mt('Configurable in course'); |
|
} else { |
|
$output .= &mt('Configurable for each instance of tool in course'); |
|
} |
|
$output .= ':'; |
my @possconfig = ('label','title','target','linktext','explanation','append'); |
my @possconfig = ('label','title','target','linktext','explanation','append'); |
my $numconfig = 0; |
my $numconfig = 0; |
if (ref($changes->{$itemid}{'crsconf'}) eq 'HASH') { |
if (ref($changes->{$itemid}{'crsconf'}) eq 'HASH') { |
Line 3532 sub get_jscript {
|
Line 3592 sub get_jscript {
|
$local_to_standard{$code_order[$i]} = $standardnames[$i]; |
$local_to_standard{$code_order[$i]} = $standardnames[$i]; |
} |
} |
foreach my $cloner (@cloners) { |
foreach my $cloner (@cloners) { |
if (($cloner !~ /^\Q*:\E$match_domain$/) && |
if (($cloner !~ /^\Q*:\E$match_domain$/) && |
($cloner !~ /^$match_username\:$match_domain$/)) { |
($cloner !~ /^$match_username\:$match_domain$/)) { |
foreach my $item (split(/\&/,$cloner)) { |
foreach my $item (split(/\&/,$cloner)) { |
my ($key,$val) = split(/\=/,$item); |
my ($key,$val) = split(/\=/,$item); |
Line 3633 function syllabusinfo() {
|
Line 3693 function syllabusinfo() {
|
} |
} |
} |
} |
ENDSCRIPT |
ENDSCRIPT |
my $menuitems_js; |
my ($menuitems_js,$grading_js); |
unless ($noedit) { |
unless ($noedit) { |
my $collections; |
my $collections; |
my $next = 1; |
my $next = 1; |
Line 3715 function toggleAddmenucoll() {
|
Line 3775 function toggleAddmenucoll() {
|
} |
} |
} |
} |
ENDSCRIPT |
ENDSCRIPT |
|
$grading_js = <<"ENDSCRIPT"; |
|
function toggleGrading(form) { |
|
if (document.getElementById('hidetotalsdiv')) { |
|
var totalsdivid = document.getElementById('hidetotalsdiv'); |
|
var selname = form.elements['grading']; |
|
if (selname) { |
|
var current = selname.options[selname.selectedIndex].value |
|
if (current == 'standard') { |
|
totalsdivid.style.display = 'inline-block'; |
|
} else { |
|
totalsdivid.style.display = 'none'; |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
|
function toggleHiddenTotalsSec(form) { |
|
if (document.getElementById('sectotalsdiv')) { |
|
var sectotalsdivid = document.getElementById('sectotalsdiv'); |
|
var radioname = form.elements['hidetotals']; |
|
if (radioname) { |
|
if (radioname.length > 0) { |
|
var setvis; |
|
for (var i=0; i<radioname.length; i++) { |
|
if (radioname[i].checked == true) { |
|
if (radioname[i].value == 1) { |
|
sectotalsdivid.style.display = 'inline-block'; |
|
setvis = 1; |
|
} |
|
break; |
|
} |
|
} |
|
if (!setvis) { |
|
sectotalsdivid.style.display = 'none'; |
|
} |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
ENDSCRIPT |
} |
} |
$extresource_js = <<"ENDSCRIPT"; |
$extresource_js = <<"ENDSCRIPT"; |
function toggleExtRes() { |
function toggleExtRes() { |
Line 3759 function toggleTimeZone() {
|
Line 3861 function toggleTimeZone() {
|
} |
} |
ENDSCRIPT |
ENDSCRIPT |
$jscript = '<script type="text/javascript" language="Javascript">'."\n". |
$jscript = '<script type="text/javascript" language="Javascript">'."\n". |
'// <![CDATA['."\n". |
'// <![CDATA['."\n". |
$browse_js."\n".$categorize_js."\n".$loncaparev_js."\n". |
$browse_js."\n".$categorize_js."\n".$loncaparev_js."\n". |
$cloners_js."\n".$instcode_js."\n".$localization_js."\n". |
$cloners_js."\n".$instcode_js."\n".$localization_js."\n". |
$syllabus_js."\n".$menuitems_js."\n".$extresource_js."\n". |
$syllabus_js."\n".$menuitems_js."\n".$extresource_js."\n". |
&linkprot_javascript()."\n".'//]]>'."\n". |
$grading_js."\n".&linkprot_javascript()."\n".'//]]>'."\n". |
'</script>'."\n".$stubrowse_js."\n".$ltitools_js."\n"; |
'</script>'."\n".$stubrowse_js."\n".$ltitools_js."\n"; |
return $jscript; |
return $jscript; |
} |
} |
Line 3973 sub print_courseinfo {
|
Line 4075 sub print_courseinfo {
|
&mt('Modification may make assessment data inaccessible!'). |
&mt('Modification may make assessment data inaccessible!'). |
'</span>'; |
'</span>'; |
$editsyllabus = &mt('[_1]Edit[_2]','<a href="/public/'.$cdom.'/'.$cnum.'/syllabus?forceedit=1">', |
$editsyllabus = &mt('[_1]Edit[_2]','<a href="/public/'.$cdom.'/'.$cnum.'/syllabus?forceedit=1">', |
'</a>'); |
'</a>'); |
} |
} |
my %items = ( |
my %items = ( |
'url' => { |
'url' => { |
Line 4054 sub print_courseinfo {
|
Line 4156 sub print_courseinfo {
|
next if (!$env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'}); |
next if (!$env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'}); |
} |
} |
unless (($item eq 'cloners') || ($item eq 'rolenames')) { |
unless (($item eq 'cloners') || ($item eq 'rolenames')) { |
$colspan = 2; |
$colspan = 2; |
} |
} |
$count ++; |
$count ++; |
if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) { |
if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) { |
Line 4237 sub print_courseinfo {
|
Line 4339 sub print_courseinfo {
|
if ($clonesrc =~ m{/$match_domain/$match_courseid}) { |
if ($clonesrc =~ m{/$match_domain/$match_courseid}) { |
my %clonesrcinfo = &Apache::lonnet::coursedescription($clonesrc); |
my %clonesrcinfo = &Apache::lonnet::coursedescription($clonesrc); |
if ($clonesrcinfo{'description'}) { |
if ($clonesrcinfo{'description'}) { |
$clonedfrom = $clonesrcinfo{'description'}.' '.($clonesrc); |
$clonedfrom = $clonesrcinfo{'description'}.' '.($clonesrc); |
} |
} |
} |
} |
$datatable .= $clonedfrom; |
$datatable .= $clonedfrom; |
} elsif ($item eq 'uniquecode') { |
} elsif ($item eq 'uniquecode') { |
my $code = $env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'}; |
my $code = $env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'}; |
if ($code) { |
if ($code) { |
$datatable .= $code; |
$datatable .= $code; |
} |
} |
Line 4289 sub print_courseinfo {
|
Line 4391 sub print_courseinfo {
|
} elsif ($uploaded) { |
} elsif ($uploaded) { |
$datatable .= &mt('Uploaded file'); |
$datatable .= &mt('Uploaded file'); |
} else { |
} else { |
$datatable .= &mt('Standard template'); |
$datatable .= &mt('Standard template'); |
} |
} |
$datatable .= (' ' x 2). |
$datatable .= (' ' x 2). |
&mt('[_1]View[_2]', |
&mt('[_1]View[_2]', |
'<a href="javascript:syllabusinfo();">', |
'<a href="javascript:syllabusinfo();">', |
'</a>'); |
'</a>'); |
} elsif ($item eq 'loncaparev') { |
} elsif ($item eq 'loncaparev') { |
my $loncaparev = $env{'course.'.$env{'request.course.id'}.'.internal.releaserequired'}; |
my $loncaparev = $env{'course.'.$env{'request.course.id'}.'.internal.releaserequired'}; |
my $showreqd; |
my $showreqd; |
Line 4319 sub new_cloners_dom_row {
|
Line 4421 sub new_cloners_dom_row {
|
my ($output,$checkedon,$checkedoff); |
my ($output,$checkedon,$checkedoff); |
if ($newdom ne '') { |
if ($newdom ne '') { |
if ($num eq $default) { |
if ($num eq $default) { |
$checkedon = 'checked="checked" '; |
$checkedon = 'checked="checked" '; |
} else { |
} else { |
$checkedoff = 'checked="checked" '; |
$checkedoff = 'checked="checked" '; |
} |
} |
Line 4470 ENDSCRIPT
|
Line 4572 ENDSCRIPT
|
|
|
sub display_loncaparev_constraints { |
sub display_loncaparev_constraints { |
my ($r,$navmap,$loncaparev,$crstype) = @_; |
my ($r,$navmap,$loncaparev,$crstype) = @_; |
my ($reqdmajor,$reqdminor); |
my ($reqdmajor,$reqdminor); |
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
my $cdom = $env{'course.'.$cid.'.domain'}; |
my $cdom = $env{'course.'.$cid.'.domain'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
Line 4740 sub display_loncaparev_constraints {
|
Line 4842 sub display_loncaparev_constraints {
|
if (ref($fromblocks{$type}) eq 'HASH') { |
if (ref($fromblocks{$type}) eq 'HASH') { |
foreach my $rev (keys(%{$fromblocks{$type}})) { |
foreach my $rev (keys(%{$fromblocks{$type}})) { |
my ($major,$minor) = split(/\./,$rev); |
my ($major,$minor) = split(/\./,$rev); |
($reqdmajor,$reqdminor) = |
($reqdmajor,$reqdminor) = |
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor,$reqdmajor,$reqdminor); |
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor,$reqdmajor,$reqdminor); |
$output .= &Apache::loncommon::start_data_table_row(). |
$output .= &Apache::loncommon::start_data_table_row(). |
'<td>'.$rev.'</td><td>'.$lt{$type}.'</td><td>'; |
'<td>'.$rev.'</td><td>'.$lt{$type}.'</td><td>'; |
Line 4827 sub display_loncaparev_constraints {
|
Line 4929 sub display_loncaparev_constraints {
|
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor, |
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor, |
$reqdmajor,$reqdminor); |
$reqdmajor,$reqdminor); |
$checkedrev{$key} = 1; |
$checkedrev{$key} = 1; |
} |
} |
push(@{$byresponsetype{$symb}{$rev}},$key); |
push(@{$byresponsetype{$symb}{$rev}},$key); |
$allmaps{$enclosing_map} = 1; |
$allmaps{$enclosing_map} = 1; |
} |
} |
Line 5079 sub show_contents_view {
|
Line 5181 sub show_contents_view {
|
sub releases_by_map { |
sub releases_by_map { |
my ($r,$bymap,$url,$scopeorder,$lt) = @_; |
my ($r,$bymap,$url,$scopeorder,$lt) = @_; |
return unless ((ref($bymap) eq 'HASH') && (ref($scopeorder) eq 'ARRAY')); |
return unless ((ref($bymap) eq 'HASH') && (ref($scopeorder) eq 'ARRAY')); |
my $newrow = 0; |
my $newrow = 0; |
if (ref($bymap->{$url}) eq 'HASH') { |
if (ref($bymap->{$url}) eq 'HASH') { |
foreach my $rev (sort(keys(%{$bymap->{$url}}))) { |
foreach my $rev (sort(keys(%{$bymap->{$url}}))) { |
if ($newrow) { |
if ($newrow) { |
Line 5196 sub update_releasereq {
|
Line 5298 sub update_releasereq {
|
} |
} |
$modified_courses = []; |
$modified_courses = []; |
} |
} |
undef($registered_cleanup); |
return OK; |
return; |
|
} |
} |
|
|
sub show_autocoowners { |
sub show_autocoowners { |
Line 5400 sub print_localization {
|
Line 5501 sub print_localization {
|
undef,$includeempty,$disabled); |
undef,$includeempty,$disabled); |
} else { |
} else { |
if ($settings->{$item} eq '') { |
if ($settings->{$item} eq '') { |
unless ($noedit) { |
unless ($noedit) { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
&Apache::loncommon::select_language('languages_0','',1); |
&Apache::loncommon::select_language('languages_0','',1); |
} |
} |
Line 5437 sub print_localization {
|
Line 5538 sub print_localization {
|
&Apache::loncommon::select_language('languages_'.$num,'',1). |
&Apache::loncommon::select_language('languages_'.$num,'',1). |
'<input type="hidden" name="languages_total" value="'.$num.'" />'. |
'<input type="hidden" name="languages_total" value="'.$num.'" />'. |
'</td>'.&Apache::loncommon::end_data_table_row(); |
'</td>'.&Apache::loncommon::end_data_table_row(); |
} |
} |
$datatable .= &Apache::loncommon::end_data_table().'<br />'; |
$datatable .= &Apache::loncommon::end_data_table().'<br />'; |
} |
} |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
Line 5612 sub select_recipient {
|
Line 5713 sub select_recipient {
|
} |
} |
|
|
sub select_sections { |
sub select_sections { |
my ($item,$num,$sections,$selected,$noedit) = @_; |
my ($item,$num,$sections,$selected,$noedit,$allval) = @_; |
my ($output,@currsecs,$allsec,$disabled); |
my ($output,@currsecs,$allsec,$disabled); |
if (ref($selected) eq 'ARRAY') { |
if (ref($selected) eq 'ARRAY') { |
@currsecs = @{$selected}; |
@currsecs = @{$selected}; |
Line 5628 sub select_sections {
|
Line 5729 sub select_sections {
|
my $mult; |
my $mult; |
if (@{$sections} > 1) { |
if (@{$sections} > 1) { |
$mult = ' multiple="multiple"'; |
$mult = ' multiple="multiple"'; |
|
my $size; |
if (@{$sections} > 3) { |
if (@{$sections} > 3) { |
$mult .= ' size="4"'; |
$size = 4; |
|
} else { |
|
$size = 1 + scalar(@{$sections}); |
} |
} |
|
$mult .= ' size="'.$size.'"'; |
|
} |
|
my $name = $item.'_sections'; |
|
unless ($item eq 'hidetotals') { |
|
$name .= '_'.$num; |
} |
} |
$output = '<select name="'.$item.'_sections_'.$num.'"'.$mult.$disabled.'>'. |
$output = '<select name="'.$name.'"'.$mult.$disabled.'>'. |
' <option value=""'.$allsec.'>'.&mt('All').'</option>'; |
' <option value="'.$allval.'"'.$allsec.'>'.&mt('All').'</option>'; |
foreach my $sec (@{$sections}) { |
foreach my $sec (@{$sections}) { |
my $is_sel; |
my $is_sel; |
if ((@currsecs) && (grep(/^\Q$sec\E$/,@currsecs))) { |
if ((@currsecs) && (grep(/^\Q$sec\E$/,@currsecs))) { |
$is_sel = 'selected="selected"'; |
$is_sel = ' selected="selected"'; |
} |
} |
$output .= '<option value="'.$sec.'"'.$is_sel.'>'.$sec.'</option>'; |
$output .= '<option value="'.$sec.'"'.$is_sel.'>'.$sec.'</option>'; |
} |
} |
Line 5724 sub print_discussion {
|
Line 5833 sub print_discussion {
|
my $colspan; |
my $colspan; |
if ($item eq 'allow_limited_html_in_feedback') { |
if ($item eq 'allow_limited_html_in_feedback') { |
$colspan = 2; |
$colspan = 2; |
} |
} |
$datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); |
$datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); |
if ($item eq 'plc.roles.denied') { |
if ($item eq 'plc.roles.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
Line 5769 sub print_discussion {
|
Line 5878 sub print_discussion {
|
'<th align="center">'.&mt('font-size').'</th>'. |
'<th align="center">'.&mt('font-size').'</th>'. |
'<th align="center">'.&mt('font-weight').'</th>'. |
'<th align="center">'.&mt('font-weight').'</th>'. |
'<th align="center">'.&mt('font-style').'</th>'. |
'<th align="center">'.&mt('font-style').'</th>'. |
'<th align="center">'.&mt('Other css').'</th>'. |
'<th align="center">'.&mt('Other css').'</th>'. |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table_row(). |
&set_discussion_fonts($cdom,$cnum,$item,$settings,$noedit). |
&set_discussion_fonts($cdom,$cnum,$item,$settings,$noedit). |
&Apache::loncommon::end_data_table().'<br />'; |
&Apache::loncommon::end_data_table().'<br />'; |
Line 5821 sub role_checkboxes {
|
Line 5930 sub role_checkboxes {
|
my $count = 0; |
my $count = 0; |
my $disabled; |
my $disabled; |
if ($noedit) { |
if ($noedit) { |
$disabled = ' disabled="disabled"'; |
$disabled = ' disabled="disabled"'; |
} |
} |
foreach my $role (@roles) { |
foreach my $role (@roles) { |
my $checked = ''; |
my $checked = ''; |
Line 5949 sub set_discussion_fonts {
|
Line 6058 sub set_discussion_fonts {
|
|
|
sub discussion_vote_classes { |
sub discussion_vote_classes { |
my $classorder = ['twoplus','oneplus','zero','oneminus','twominus']; |
my $classorder = ['twoplus','oneplus','zero','oneminus','twominus']; |
my %classtitles = &Apache::lonlocal::texthash( |
my %classtitles = &Apache::lonlocal::texthash( |
'twoplus' => 'Two sigma above mean', |
'twoplus' => 'Two sigma above mean', |
'oneplus' => 'One sigma above mean', |
'oneplus' => 'One sigma above mean', |
'zero' => 'Within one sigma of mean', |
'zero' => 'Within one sigma of mean', |
Line 6015 sub print_classlists {
|
Line 6124 sub print_classlists {
|
'defaultcredits' => { |
'defaultcredits' => { |
text => '<b>'.&mt($itemtext->{'defaultcredits'}).'</b>', |
text => '<b>'.&mt($itemtext->{'defaultcredits'}).'</b>', |
}, |
}, |
|
|
'nothideprivileged' => { |
'nothideprivileged' => { |
text => '<b>'.&mt($itemtext->{'nothideprivileged'}).'</b>', |
text => '<b>'.&mt($itemtext->{'nothideprivileged'}).'</b>', |
input => 'checkbox', |
input => 'checkbox', |
Line 6121 sub print_appearance {
|
Line 6230 sub print_appearance {
|
} |
} |
|
|
sub print_grading { |
sub print_grading { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
my ($cdom,$cnum,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 6141 sub print_grading {
|
Line 6250 sub print_grading {
|
}, |
}, |
'rndseed' => { |
'rndseed' => { |
text => '<b>'.&mt($itemtext->{'rndseed'}).'</b>'. |
text => '<b>'.&mt($itemtext->{'rndseed'}).'</b>'. |
'<span class="LC_warning">'.'<br />'. |
'<br /><span class="LC_warning LC_nobreak">'. |
&mt('Modifying this will make problems have different numbers and answers!'). |
&mt('Modifying this will make problems have different numbers and answers!'). |
'</span>', |
'</span>', |
input => 'selectbox', |
input => 'selectbox', |
Line 6173 sub print_grading {
|
Line 6282 sub print_grading {
|
input => 'radio', |
input => 'radio', |
}, |
}, |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'grading',$noedit); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'grading',$noedit,$cnum); |
} |
} |
|
|
sub print_printouts { |
sub print_printouts { |
Line 6310 sub print_bridgetasks {
|
Line 6419 sub print_bridgetasks {
|
sub print_ltitools { |
sub print_ltitools { |
my ($cdom,$cnum,$settings,$rowtotal,$crstype,$noedit,$context) = @_; |
my ($cdom,$cnum,$settings,$rowtotal,$crstype,$noedit,$context) = @_; |
my ($datatable,$disabled,$css_class,$dest); |
my ($datatable,$disabled,$css_class,$dest); |
my %lt = <itools_names(); |
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
my $itemcount = 1; |
my $itemcount = 1; |
|
unless ($context eq 'domain') { |
|
my %tooltypes = &Apache::loncommon::usable_exttools(); |
|
unless ($tooltypes{'crs'}) { |
|
my $showtype = 'course'; |
|
if ($crstype eq 'Community') { |
|
$showtype = lc($crstype); |
|
} |
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
|
$datatable = '<tr '.$css_class.'><td colspan="2">'. |
|
&mt("Definition of external tools is not enabled for this $showtype.").'<br />'; |
|
if ($tooltypes{'dom'}) { |
|
$datatable .= &mt("Contact an administrator for the $showtype domain ([_1]) to request this feature be enabled.", |
|
'<i>'.$cdom.'</i>'). |
|
'<br /><br />'. |
|
&mt("Use of external tools defined at a domain level is enabled, so the $showtype editor can be used to add tool(s), if any have been defined."); |
|
} else { |
|
$datatable .= &mt("Use of external tools defined at a domain level is not enabled, either, for this $showtype."). |
|
'<br /><br />'. |
|
&mt("Contact an administrator for the $showtype domain ([_1]) to request changes.", |
|
'<i>'.$cdom.'</i>'); |
|
|
|
} |
|
$datatable .= '</tr>'; |
|
$itemcount ++; |
|
return $datatable; |
|
} |
|
} |
|
my %lt = <itools_names(); |
my $maxnum = 0; |
my $maxnum = 0; |
my %ordered; |
my %ordered; |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
Line 6393 sub print_ltitools {
|
Line 6532 sub print_ltitools {
|
'<option value="HMAC-SHA1"'.$sigsel{'HMAC-SHA1'}.'>HMAC-SHA1</option>'. |
'<option value="HMAC-SHA1"'.$sigsel{'HMAC-SHA1'}.'>HMAC-SHA1</option>'. |
'<option value="HMAC-SHA256"'.$sigsel{'HMAC-SHA256'}.'>HMAC-SHA256</option></select></span>'. |
'<option value="HMAC-SHA256"'.$sigsel{'HMAC-SHA256'}.'>HMAC-SHA256</option></select></span>'. |
'<br /><br />'. |
'<br /><br />'. |
'<span class="LC_nobreak">'.$lt{'url'}.':<input type="text" size="40" name="ltitools_url_'.$i.'"'. |
'<span class="LC_nobreak">'.$lt{'url'}.':<input type="text" size="60" name="ltitools_url_'.$i.'"'. |
' value="'.$url.'" /></span>'. |
' value="'.$url.'" /></span>'. |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'lifetime'}.':'. |
'<span class="LC_nobreak">'.$lt{'lifetime'}.':'. |
Line 6610 sub print_ltitools {
|
Line 6749 sub print_ltitools {
|
%courseconfig = %{$settings->{$item}->{'crsconf'}}; |
%courseconfig = %{$settings->{$item}->{'crsconf'}}; |
} |
} |
} |
} |
$datatable .= '<fieldset><legend>'.&mt('Configurable in course').'</legend><span class="LC_nobreak">'; |
$datatable .= '<fieldset><legend>'; |
|
if ($context eq 'domain') { |
|
$datatable .= &mt('Configurable in course'); |
|
} else { |
|
$datatable .= &mt('Configurable for each instance of tool in course'); |
|
} |
|
$datatable .= '</legend><span class="LC_nobreak">'; |
foreach my $item ('label','title','target','linktext','explanation','append') { |
foreach my $item ('label','title','target','linktext','explanation','append') { |
my $checked; |
my $checked; |
if ($courseconfig{$item}) { |
if ($courseconfig{$item}) { |
Line 6671 sub print_ltitools {
|
Line 6816 sub print_ltitools {
|
'<option value="HMAC-SHA1" selected="selected">HMAC-SHA1</option>'. |
'<option value="HMAC-SHA1" selected="selected">HMAC-SHA1</option>'. |
'<option value="HMAC-SHA256">HMAC-SHA256</option></select></span>'. |
'<option value="HMAC-SHA256">HMAC-SHA256</option></select></span>'. |
'<br />'. |
'<br />'. |
'<span class="LC_nobreak">'.$lt{'url'}.':<input type="text" size="40" name="ltitools_add_url" value="" /></span> '."\n". |
'<span class="LC_nobreak">'.$lt{'url'}.':<input type="text" size="60" name="ltitools_add_url" value="" /></span> '."\n". |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'lifetime'}.':<input type="text" size="5" name="ltitools_add_lifetime" value="300" /></span><br />'; |
'<span class="LC_nobreak">'.$lt{'lifetime'}.':<input type="text" size="5" name="ltitools_add_lifetime" value="300" /></span><br />'; |
if ($switchserver) { |
if ($switchserver) { |
Line 6679 sub print_ltitools {
|
Line 6824 sub print_ltitools {
|
} else { |
} else { |
$datatable .= '<span class="LC_nobreak">'.$lt{'key'}.':<input type="text" size="25" name="ltitools_add_key" value="" autocomplete="off"'.$disabled.' /></span> '."\n". |
$datatable .= '<span class="LC_nobreak">'.$lt{'key'}.':<input type="text" size="25" name="ltitools_add_key" value="" autocomplete="off"'.$disabled.' /></span> '."\n". |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'secret'}.':<input type="password" size="20" name="ltitools_add_secret" value="" autocomplete="new-password"'.$disabled.' />'. |
'<span class="LC_nobreak">'.$lt{'secret'}.':<input type="password" size="20" name="ltitools_secret_add" value="" autocomplete="new-password"'.$disabled.' />'. |
'<label><input type="checkbox" name="ltitools_add_visible" id="ltitools_add_visible" onclick="if (this.checked) { this.form.ltitools_add_secret.type='."'text'".' } else { this.form.ltitools_add_secret.type='."'password'".' }"'.$disabled.' />'.&mt('Visible input').'</label></span> '."\n"; |
'<label><input type="checkbox" name="ltitools_add_visible" id="ltitools_add_visible" onclick="if (this.checked) { this.form.ltitools_secret_add.type='."'text'".' } else { this.form.ltitools_secret_add.type='."'password'".' }"'.$disabled.' />'.&mt('Visible input').'</label></span> '."\n"; |
} |
} |
$datatable .= '<br /><br />'. |
$datatable .= '<br /><br />'. |
'</fieldset>'. |
'</fieldset>'. |
Line 6768 sub print_ltitools {
|
Line 6913 sub print_ltitools {
|
$datatable .= '</select></td>'; |
$datatable .= '</select></td>'; |
} |
} |
$datatable .= '</tr></table></fieldset>'. |
$datatable .= '</tr></table></fieldset>'. |
'<fieldset><legend>'.&mt('Configurable in course').'</legend><span class="LC_nobreak">'; |
'<fieldset><legend>'; |
|
if ($context eq 'domain') { |
|
$datatable .= &mt('Configurable in course'); |
|
} else { |
|
$datatable .= &mt('Configurable for each instance of tool in course'); |
|
} |
|
$datatable .= '</legend><span class="LC_nobreak">'; |
foreach my $item ('label','title','target','linktext','explanation','append') { |
foreach my $item ('label','title','target','linktext','explanation','append') { |
$datatable .= '<label>'. |
$datatable .= '<label>'. |
'<input type="checkbox" name="ltitools_add_courseconfig" value="'.$item.'" checked="checked" />'. |
'<input type="checkbox" name="ltitools_add_courseconfig" value="'.$item.'" checked="checked" />'. |
Line 7102 sub menuitems_categories {
|
Line 7253 sub menuitems_categories {
|
shown => ['top','inline','foot','main'], |
shown => ['top','inline','foot','main'], |
text => ['name','role','crs','disc','fdbk'], |
text => ['name','role','crs','disc','fdbk'], |
links => ['pers','logo','menu','comm','roles','help','logout'], |
links => ['pers','logo','menu','comm','roles','help','logout'], |
list => ['about','prefs','port','wish','anno','rss'], |
list => ['about','prefs','port','wish','anno','rss','srch','brse'], |
inline => ['cont','grades','chat','people','groups','resv','syll','feeds'], |
inline => ['cont','grades','chat','people','groups','resv','syll','feeds'], |
); |
); |
return (\@order,\%categories); |
return (\@order,\%categories); |
Line 7142 sub menuitems_fields {
|
Line 7293 sub menuitems_fields {
|
wish => 'Stored Links', |
wish => 'Stored Links', |
anno => 'Calendar', |
anno => 'Calendar', |
rss => 'RSS Feeds', |
rss => 'RSS Feeds', |
|
srch => 'Search Library', |
|
brse => 'Browse Library', |
cont => 'Contents', |
cont => 'Contents', |
grades => 'Grades', |
grades => 'Grades', |
chat => 'Chat', |
chat => 'Chat', |
Line 7197 sub menucollections_display {
|
Line 7350 sub menucollections_display {
|
'<legend>'.$menutitles{$category}.'</legend>'."\n"; |
'<legend>'.$menutitles{$category}.'</legend>'."\n"; |
if ($category eq 'text') { |
if ($category eq 'text') { |
$output .= '<b>'.&mt('Header Text').'</b><br /><br />'; |
$output .= '<b>'.&mt('Header Text').'</b><br /><br />'; |
} |
} |
foreach my $field (@{$categories{$category}}) { |
foreach my $field (@{$categories{$category}}) { |
if ($field eq 'disc') { |
if ($field eq 'disc') { |
$output .= '<br /><b>'.&mt('Footer Text').'</b><br /><br />'; |
$output .= '<br /><b>'.&mt('Footer Text').'</b><br /><br />'; |
Line 7252 sub print_linkprotection {
|
Line 7405 sub print_linkprotection {
|
} else { |
} else { |
$dest = '/adm/courseprefs'; |
$dest = '/adm/courseprefs'; |
} |
} |
|
|
my ($switchserver,$switchmessage); |
my ($switchserver,$switchmessage); |
$switchserver = &check_switchserver($cdom,$cnum,$context,$dest); |
$switchserver = &check_switchserver($cdom,$cnum,$context,$dest); |
if ($switchserver) { |
if ($switchserver) { |
if ($context eq 'domain') { |
if ($context eq 'domain') { |
$switchmessage = &mt("submit from domain's primary library server: [_1].",$switchserver); |
$switchmessage = &mt("submit from domain's primary library server: [_1].",$switchserver); |
} elsif ($crstype eq 'Community') { |
} elsif ($crstype eq 'Community') { |
$switchmessage = &mt("submit from community's home server: [_1].",$switchserver); |
$switchmessage = &mt("submit from community's home server: [_1].",$switchserver); |
} else { |
} else { |
Line 7286 sub print_linkprotection {
|
Line 7439 sub print_linkprotection {
|
'<tr '.$css_class.'><td><span class="LC_nobreak">'. |
'<tr '.$css_class.'><td><span class="LC_nobreak">'. |
'<label><input type="checkbox" name="linkprot_del" value="'.$i.'"'.$disabled.' />'. |
'<label><input type="checkbox" name="linkprot_del" value="'.$i.'"'.$disabled.' />'. |
&mt('Delete?').'</label></span></td><td>'; |
&mt('Delete?').'</label></span></td><td>'; |
my ($usersty,$onclickrequser,%checkedrequser,$onclickreturnurl,%checkedreturnurl); |
my ($usersty,$onclickrequser,%checkedrequser,$onclickreturnurl,%checkedreturnurl, |
|
$onclickpassback,%checkedpassback,$passbacksty,%checkedpassbackfmt); |
|
$passbacksty = 'none'; |
|
$onclickpassback = ' onclick="toggleLinkProtExtra(this.form,'."'passback','passbackparam','1','inline-block','$i'".');"'; |
|
%checkedpassback = ( |
|
'no' => ' checked="checked"', |
|
'yes' => '', |
|
); |
|
%checkedpassbackfmt = ( |
|
'1p1' => ' checked="checked"', |
|
'1p0' => '', |
|
); |
|
if ($values{'passback'} ne '') { |
|
$passbacksty = 'inline-block'; |
|
$checkedpassback{'yes'} = ' checked="checked"'; |
|
$checkedpassback{'no'} = ''; |
|
if ($values{'passbackformat'} eq '1.0') { |
|
$checkedpassbackfmt{'1p0'} = ' checked="checked"'; |
|
$checkedpassbackfmt{'1p1'} = ''; |
|
} |
|
} |
if ($ltiauth) { |
if ($ltiauth) { |
$usersty = 'display:none'; |
$usersty = 'display:none'; |
$onclickrequser = ' onclick="toggleLinkProtExtra(this.form,'."'requser','optional','1','block','$i'".');"'; |
$onclickrequser = ' onclick="toggleLinkProtExtra(this.form,'."'requser','optional','1','block','$i'".');"'; |
Line 7299 sub print_linkprotection {
|
Line 7472 sub print_linkprotection {
|
$checkedrequser{'no'} = ''; |
$checkedrequser{'no'} = ''; |
} |
} |
$datatable .= '<fieldset><legend>'.$lt{'requ'}.'</legend>'; |
$datatable .= '<fieldset><legend>'.$lt{'requ'}.'</legend>'; |
if ($values{'requser'}) { |
if ($values{'requser'}) { |
$usersty = 'display:inline-block'; |
$usersty = 'display:inline-block'; |
} |
} |
} |
} |
Line 7375 sub print_linkprotection {
|
Line 7548 sub print_linkprotection {
|
} |
} |
} |
} |
$datatable .= '<br /><br />'. |
$datatable .= '<br /><br />'. |
|
'<span class="LC_nobreak">'.$desc{'passback'}.'?'. |
|
'<label><input type="radio" name="linkprot_passback_'.$i.'" value="0"'. |
|
$onclickpassback.$checkedpassback{'no'}.$disabled.' />'.&mt('No').'</label> '. |
|
'<label><input type="radio" name="linkprot_passback_'.$i.'" value="1"'. |
|
$onclickpassback.$checkedpassback{'yes'}.$disabled.' />'.&mt('Yes').'</label></span><br />'. |
|
'<div id="linkprot_passbackparam_'.$i.'" class="LC_floatleft" style="display:'.$passbacksty.'" />'. |
|
'<span class="LC_nobreak">'.&mt('Grade format'). |
|
'<label><input type="radio" name="linkprot_passbackformat_'.$i.'" value="1.1"'.$checkedpassbackfmt{'1p1'}.' />'. |
|
&mt('Outcomes Service (1.1)').'</label>'.(' 'x2). |
|
'<label><input type="radio" name="linkprot_passbackformat_'.$i.'" value="1.0"'.$checkedpassbackfmt{'1p0'}.'/>'. |
|
&mt('Outcomes Extension (1.0)').'</label></span></div>'. |
|
'<div style="padding:0;clear:both;margin:0;border:0"></div>'. |
|
'<br />'. |
'<span class="LC_nobreak">'.$desc{'returnurl'}.'?'. |
'<span class="LC_nobreak">'.$desc{'returnurl'}.'?'. |
'<label><input type="radio" name="linkprot_returnurl_'.$i.'" value="0"'. |
'<label><input type="radio" name="linkprot_returnurl_'.$i.'" value="0"'. |
$onclickreturnurl.$checkedreturnurl{'no'}.$disabled.' />'.&mt('No').'</label> '. |
$onclickreturnurl.$checkedreturnurl{'no'}.$disabled.' />'.&mt('No').'</label> '. |
'<label><input type="radio" name="linkprot_returnurl_'.$i.'" value="1"'. |
'<label><input type="radio" name="linkprot_returnurl_'.$i.'" value="1"'. |
$onclickreturnurl.$checkedreturnurl{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
$onclickreturnurl.$checkedreturnurl{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
' </span><div id="linkprot_divurlparam_'.$i.'" style="display:none" />'. |
' <div id="linkprot_divurlparam_'.$i.'" style="display:none">'. |
'<span class="LC_nobreak">'.&mt('Parameter name').':'. |
'<span class="LC_nobreak">'.&mt('Parameter name').':'. |
'<input type="text" size="15" name="linkprot_urlparam_'.$i.'" value="'.$values{'returnurl'}.'" autocomplete="off"'.$disabled.' />'. |
'<input type="text" size="15" name="linkprot_urlparam_'.$i.'" value="'.$values{'returnurl'}.'" autocomplete="off"'.$disabled.' />'. |
'</span></div> '; |
'</span></div> '; |
Line 7405 sub print_linkprotection {
|
Line 7591 sub print_linkprotection {
|
'<input type="hidden" name="linkprot_maxnum" value="'.$next.'" />'."\n". |
'<input type="hidden" name="linkprot_maxnum" value="'.$next.'" />'."\n". |
'<input type="checkbox" name="linkprot_add" value="1"'.$disabled.' />'.&mt('Add').'</span></td>'."\n". |
'<input type="checkbox" name="linkprot_add" value="1"'.$disabled.' />'.&mt('Add').'</span></td>'."\n". |
'<td width="100%">'; |
'<td width="100%">'; |
my ($usersty,$onclickrequser,%checkedrequser,$onclickreturnurl,%checkedreturnurl); |
my ($usersty,$onclickrequser,%checkedrequser,$onclickreturnurl,%checkedreturnurl, |
|
$onclickpassback,%checkedpassback,%checkedpassbackfmt); |
if ($ltiauth) { |
if ($ltiauth) { |
$usersty = 'display:none'; |
$usersty = 'display:none'; |
$onclickrequser = ' onclick="toggleLinkProtExtra(this.form,'."'requser','optional','1','block','add'".');"'; |
$onclickrequser = ' onclick="toggleLinkProtExtra(this.form,'."'requser','optional','1','block','add'".');"'; |
Line 7415 sub print_linkprotection {
|
Line 7602 sub print_linkprotection {
|
); |
); |
$datatable .= '<fieldset><legend>'.$lt{'requ'}.'</legend>'; |
$datatable .= '<fieldset><legend>'.$lt{'requ'}.'</legend>'; |
} |
} |
|
$onclickpassback = ' onclick="toggleLinkProtExtra(this.form,'."'passback','passbackparam','1','inline-block','add'".');"'; |
|
%checkedpassback = ( |
|
'no' => ' checked="checked"', |
|
'yes' => '', |
|
); |
|
%checkedpassbackfmt = ( |
|
'1p1' => ' checked="checked"', |
|
'1p0' => '', |
|
); |
$onclickreturnurl = ' onclick="toggleLinkProtExtra(this.form,'."'returnurl','divurlparam','1','inline-block','add'".');"'; |
$onclickreturnurl = ' onclick="toggleLinkProtExtra(this.form,'."'returnurl','divurlparam','1','inline-block','add'".');"'; |
%checkedreturnurl = ( |
%checkedreturnurl = ( |
no => ' checked="checked"', |
no => ' checked="checked"', |
Line 7437 sub print_linkprotection {
|
Line 7633 sub print_linkprotection {
|
'<label><input type="checkbox" name="linkprot_visible_add" id="linkprot_visible_add" onclick="if (this.checked) { this.form.linkprot_secret_add.type='."'text'".' } else { this.form.linkprot_secret_add.type='."'password'".' }"'.$disabled.' />'.&mt('Visible input').'</label></span> '."\n"; |
'<label><input type="checkbox" name="linkprot_visible_add" id="linkprot_visible_add" onclick="if (this.checked) { this.form.linkprot_secret_add.type='."'text'".' } else { this.form.linkprot_secret_add.type='."'password'".' }"'.$disabled.' />'.&mt('Visible input').'</label></span> '."\n"; |
} |
} |
$datatable .= '<br /><br />'. |
$datatable .= '<br /><br />'. |
|
'<span class="LC_nobreak">'.$desc{'passback'}.'?'. |
|
'<label><input type="radio" name="linkprot_passback_add" value="0"'. |
|
$onclickpassback.$checkedpassback{'no'}.$disabled.' />'.&mt('No').'</label> '. |
|
'<label><input type="radio" name="linkprot_passback_add" value="1"'. |
|
$onclickpassback.$checkedpassback{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
|
'<br /><div id="linkprot_passbackparam_add" class="LC_floatleft" style="display:none">'. |
|
'<span class="LC_nobreak">'.&mt('Grade format'). |
|
'<label><input type="radio" name="linkprot_passbackformat_add" value="1.1"'.$checkedpassbackfmt{'1p1'}.$disabled.' />'. |
|
&mt('Outcomes Service (1.1)').'</label>'.(' 'x2). |
|
'<label><input type="radio" name="linkprot_passbackformat_add" value="1.0"'.$checkedpassbackfmt{'1p0'}.$disabled.' />'. |
|
&mt('Outcomes Extension (1.0)').'</label></span></div>'. |
|
'<div style="padding:0;clear:both;margin:0;border:0"></div>'. |
|
'<br />'. |
'<span class="LC_nobreak">'.$desc{'returnurl'}.'?'. |
'<span class="LC_nobreak">'.$desc{'returnurl'}.'?'. |
'<label><input type="radio" name="linkprot_returnurl_add" value="0"'. |
'<label><input type="radio" name="linkprot_returnurl_add" value="0"'. |
$onclickreturnurl.$checkedreturnurl{'no'}.$disabled.' />'.&mt('No').'</label> '. |
$onclickreturnurl.$checkedreturnurl{'no'}.$disabled.' />'.&mt('No').'</label> '. |
'<label><input type="radio" name="linkprot_returnurl_add" value="1"'. |
'<label><input type="radio" name="linkprot_returnurl_add" value="1"'. |
$onclickreturnurl.$checkedreturnurl{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
$onclickreturnurl.$checkedreturnurl{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
' </span><div id="linkprot_divurlparam_add" style="display:none" />'. |
' <div id="linkprot_divurlparam_add" style="display:none">'. |
'<span class="LC_nobreak">'.&mt('Parameter name').':'. |
'<span class="LC_nobreak">'.&mt('Parameter name').':'. |
'<input type="text" size="15" name="linkprot_urlparam_add" value="" autocomplete="off"'.$disabled.' />'. |
'<input type="text" size="15" name="linkprot_urlparam_add" value="" autocomplete="off"'.$disabled.' />'. |
'</span></div> '; |
'</span></div> '; |
Line 7469 sub linkprot_names {
|
Line 7678 sub linkprot_names {
|
'lifetime' => 'Nonce lifetime (s)', |
'lifetime' => 'Nonce lifetime (s)', |
'name' => 'Launcher Application', |
'name' => 'Launcher Application', |
'secret' => 'Secret', |
'secret' => 'Secret', |
|
'passback' => 'Can return grades to Launcher', |
'returnurl' => 'Launcher return URL', |
'returnurl' => 'Launcher return URL', |
'requser' => 'Use identity', |
'requser' => 'Use identity', |
'email' => 'Email address', |
'email' => 'Email address', |
Line 7561 sub print_extresource_row {
|
Line 7771 sub print_extresource_row {
|
$config->{'options'},$selected, |
$config->{'options'},$selected, |
$config->{'nullval'}, |
$config->{'nullval'}, |
undef,undef,$onchange,$noedit,$id); |
undef,undef,$onchange,$noedit,$id); |
my ($checked,$reusesty,$sizesty); |
my ($checked,$reusesty,$sizesty); |
if ($reuse) { |
if ($reuse) { |
$checked = ' checked="checked"'; |
$checked = ' checked="checked"'; |
} |
} |
Line 7665 sub item_table_row_end {
|
Line 7875 sub item_table_row_end {
|
} |
} |
|
|
sub yesno_radio { |
sub yesno_radio { |
my ($item,$settings,$unsetdefault,$valueyes,$valueno,$noedit) = @_; |
my ($item,$settings,$unsetdefault,$valueyes,$valueno,$noedit,$onclick,$reverse) = @_; |
my $itemon = ' '; |
my $itemon = ' '; |
my $itemoff = ' checked="checked" '; |
my $itemoff = ' checked="checked" '; |
if (($valueyes eq '') && ($valueno eq '')) { |
if (($valueyes eq '') && ($valueno eq '')) { |
Line 7687 sub yesno_radio {
|
Line 7897 sub yesno_radio {
|
my $disabled; |
my $disabled; |
if ($noedit) { |
if ($noedit) { |
$disabled = ' disabled="disabled"'; |
$disabled = ' disabled="disabled"'; |
|
} elsif ($onclick) { |
|
$onclick = ' onclick="'.$onclick.'"'; |
|
} |
|
if ($reverse) { |
|
return '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="'.$item.'"'. |
|
$itemoff.' value="'.$valueno.'"'.$disabled.$onclick.' />'.&mt('No').'</label> '. |
|
'<label><input type="radio" name="'.$item.'"'. |
|
$itemon.' value="'.$valueyes.'"'.$disabled.$onclick.' />'.&mt('Yes').'</label></span>'; |
|
} else { |
|
return '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="'.$item.'"'. |
|
$itemon.' value="'.$valueyes.'"'.$disabled.$onclick.' />'.&mt('Yes').'</label> '. |
|
'<label><input type="radio" name="'.$item.'"'. |
|
$itemoff.' value="'.$valueno.'"'.$disabled.$onclick.' />'.&mt('No').'</label></span>'; |
} |
} |
return '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="'.$item.'"'. |
|
$itemon.' value="'.$valueyes.'"'.$disabled.' />'.&mt('Yes').'</label> '. |
|
'<label><input type="radio" name="'.$item.'"'. |
|
$itemoff.' value="'.$valueno.'"'.$disabled.' />'.&mt('No').'</label></span>'; |
|
} |
} |
|
|
sub select_from_options { |
sub select_from_options { |
Line 7748 sub select_from_options {
|
Line 7968 sub select_from_options {
|
} |
} |
|
|
sub make_item_rows { |
sub make_item_rows { |
my ($cdom,$items,$ordered,$settings,$rowtotal,$crstype,$caller,$noedit) = @_; |
my ($cdom,$items,$ordered,$settings,$rowtotal,$crstype,$caller,$noedit,$cnum) = @_; |
my $datatable; |
my $datatable; |
if ((ref($items) eq 'HASH') && (ref($ordered) eq 'ARRAY')) { |
if ((ref($items) eq 'HASH') && (ref($ordered) eq 'ARRAY')) { |
my $count = 0; |
my $count = 0; |
Line 7811 sub make_item_rows {
|
Line 8031 sub make_item_rows {
|
} |
} |
$datatable .= &yesno_radio($item,$settings,$unsetdefault,$valueyes,$valueno,$noedit); |
$datatable .= &yesno_radio($item,$settings,$unsetdefault,$valueyes,$valueno,$noedit); |
} elsif ($items->{$item}{input} eq 'selectbox') { |
} elsif ($items->{$item}{input} eq 'selectbox') { |
my $id; |
my ($id,$onchange); |
if ($caller eq 'menuitems') { |
if ($caller eq 'menuitems') { |
$id = $item; |
$id = $item; |
|
} elsif ($caller eq 'grading') { |
|
if ($item eq 'grading') { |
|
$onchange = ' onchange="javascript:toggleGrading(this.form);"'; |
|
$id = $item; |
|
} |
} |
} |
my $curr = $settings->{$item}; |
my $curr = $settings->{$item}; |
$datatable .= |
$datatable .= |
&select_from_options($item,$items->{$item}{'order'}, |
&select_from_options($item,$items->{$item}{'order'}, |
$items->{$item}{'options'},$curr, |
$items->{$item}{'options'},$curr, |
$items->{$item}{'nullval'}, |
$items->{$item}{'nullval'}, |
undef,undef,undef,$noedit,$id); |
undef,undef,$onchange,$noedit,$id); |
|
if ($item eq 'grading') { |
|
my ($unsetdefault,$valueyes,$valueno,$sectionbox); |
|
my $gradingsty = 'none'; |
|
my $gradingsecsty = 'none'; |
|
$unsetdefault = 0; |
|
my (@selsec,@sections,%current); |
|
if ($curr eq 'standard') { |
|
$gradingsty = 'inline-block'; |
|
if (ref($settings) eq 'HASH') { |
|
$current{'hidetotals'} = $settings->{'hidetotals'}; |
|
if ($settings->{'hidetotals'} =~ /^([\w,]+)$/) { |
|
my $secstr = $1; |
|
unless ($secstr eq 'all') { |
|
@selsec = split(/,/,$secstr); |
|
} |
|
$current{'hidetotals'} = 1; |
|
} |
|
} |
|
} |
|
$valueyes = "1"; |
|
$valueno = "0"; |
|
my %sections = &Apache::loncommon::get_sections($cdom,$cnum); |
|
if (keys(%sections)) { |
|
@sections = sort( { $a <=> $b } keys(%sections)); |
|
} |
|
my $onclick = 'javascript:toggleHiddenTotalsSec(this.form);'; |
|
my $sectionbox = '<div id="sectotalsdiv" style="display:'.$gradingsecsty.'; float:right">'; |
|
my $reverse = 1; |
|
if (@sections) { |
|
$sectionbox .= ' ... '.&mt('hidden in sections').': '. |
|
'<div style="position: relative; top: 0%;">'. |
|
&select_sections('hidetotals','',\@sections,\@selsec,$noedit,'all'). |
|
'</div>'; |
|
} |
|
$sectionbox .= '</div>'; |
|
$datatable .= '<fieldset id="hidetotalsdiv" style="display:'.$gradingsty.';">'. |
|
'<legend style="font-weight: normal;">'. |
|
&mt('Hide Course Points Totals').'</legend>'. |
|
'<div style="position: relative; top: 0%; float:left">'. |
|
&yesno_radio('hidetotals',\%current,$unsetdefault,$valueyes,$valueno,$noedit, |
|
$onclick,$reverse).'</div>'. |
|
$sectionbox. |
|
'</fieldset><div style="padding:0;clear:both;margin:0;border:0"></div>'; |
|
} |
} elsif ($items->{$item}{input} eq 'textbox') { |
} elsif ($items->{$item}{input} eq 'textbox') { |
my $disabled; |
my $disabled; |
if ($noedit) { |
if ($noedit) { |
Line 7855 sub nothidepriv_row {
|
Line 8124 sub nothidepriv_row {
|
} |
} |
} |
} |
if ($settings->{'checkforpriv'}) { |
if ($settings->{'checkforpriv'}) { |
@checkdoms = split(/,/,$settings->{'checkforpriv'}); |
@checkdoms = split(/,/,$settings->{'checkforpriv'}); |
} |
} |
} |
} |
push(@checkdoms,$cdom); |
push(@checkdoms,$cdom); |
Line 7869 sub nothidepriv_row {
|
Line 8138 sub nothidepriv_row {
|
if ($end == -1 || $start == -1) { |
if ($end == -1 || $start == -1) { |
next; |
next; |
} |
} |
foreach my $dom (@checkdoms) { |
foreach my $dom (@checkdoms) { |
if (&Apache::lonnet::privileged($uname,$udom,\@checkdoms,['dc','su'])) { |
if (&Apache::lonnet::privileged($uname,$udom,\@checkdoms,['dc','su'])) { |
unless (grep(/^\Q$user\E$/,@privusers)) { |
unless (grep(/^\Q$user\E$/,@privusers)) { |
push(@privusers,$user); |
push(@privusers,$user); |
Line 7945 sub checkforpriv_row {
|
Line 8214 sub checkforpriv_row {
|
my $domdesc = &Apache::lonnet::domain($currdom,'description'); |
my $domdesc = &Apache::lonnet::domain($currdom,'description'); |
if ($domdesc eq '') { |
if ($domdesc eq '') { |
$domdesc = $currdom; |
$domdesc = $currdom; |
} |
} |
$datatable .= |
$datatable .= |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
Line 7957 sub checkforpriv_row {
|
Line 8226 sub checkforpriv_row {
|
&mt('Delete').'</label></span></td>'. |
&mt('Delete').'</label></span></td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
$num ++; |
$num ++; |
unless (grep(/^\Q$currdom\E$/,@excdoms)) { |
unless (grep(/^\Q$currdom\E$/,@excdoms)) { |
push(@excdoms,$currdom); |
push(@excdoms,$currdom); |
} |
} |
} |
} |
} |
} |
if ((scalar(keys(%domains)) - scalar(@excdoms)) > 0) { |
if ((scalar(keys(%domains)) - scalar(@excdoms)) > 0) { |
$datatable .= |
$datatable .= |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&mt('Additional domain:'). '</span><br />'. |
&mt('Additional domain:'). '</span><br />'. |
Line 8077 ENDJS
|
Line 8346 ENDJS
|
} |
} |
} |
} |
my $pos = $currnum+1; |
my $pos = $currnum+1; |
unless ($noedit) { |
unless ($noedit) { |
$output .= |
$output .= |
'<tr>'. |
'<tr>'. |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
Line 8224 sub devalidate_remote_courseprefs {
|
Line 8493 sub devalidate_remote_courseprefs {
|
my %servers = &Apache::lonnet::internet_dom_servers($cdom); |
my %servers = &Apache::lonnet::internet_dom_servers($cdom); |
my %thismachine; |
my %thismachine; |
map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids(); |
map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids(); |
my @posscached = ('courselti'); |
my @posscached = ('courselti','courseltitools'); |
if (keys(%servers)) { |
if (keys(%servers)) { |
foreach my $server (keys(%servers)) { |
foreach my $server (keys(%servers)) { |
next if ($thismachine{$server}); |
next if ($thismachine{$server}); |