version 1.108, 2022/04/05 12:27:39
|
version 1.114, 2022/08/28 02:41:29
|
Line 492 sub handler {
|
Line 492 sub handler {
|
help => 'Course_Prefs_Display', |
help => 'Course_Prefs_Display', |
ordered => ['default_xml_style','pageseparators', |
ordered => ['default_xml_style','pageseparators', |
'disable_receipt_display','texengine', |
'disable_receipt_display','texengine', |
'tthoptions','uselcmath','usejsme','inline_chem'], |
'tthoptions','uselcmath','usejsme', |
|
'inline_chem','extresource'], |
itemtext => { |
itemtext => { |
default_xml_style => 'Default XML style file', |
default_xml_style => 'Default XML style file', |
pageseparators => 'Visibly Separate Items on Pages', |
pageseparators => 'Visibly Separate Items on Pages', |
Line 502 sub handler {
|
Line 503 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', |
}, |
}, |
}, |
}, |
'grading' => |
'grading' => |
Line 1464 sub process_changes {
|
Line 1466 sub process_changes {
|
$newvalues{$entry} = ''; |
$newvalues{$entry} = ''; |
} |
} |
} |
} |
|
} elsif ($entry eq 'extresource') { |
|
if ($env{'form.'.$entry} =~ /^iframe|tab|window$/) { |
|
$newvalues{$entry} = $env{'form.'.$entry}; |
|
if ($env{'form.'.$entry} ne 'iframe') { |
|
if ($env{'form.extwintabreuse'}) { |
|
$newvalues{$entry} .= ':1'; |
|
} else { |
|
$newvalues{$entry} .= ':0'; |
|
} |
|
if ($env{'form.'.$entry} eq 'window') { |
|
foreach my $dim ('width','height') { |
|
$env{'form.extreswin'.$dim} =~ s/^\s+|\s+$//g; |
|
if ($env{'form.extreswin'.$dim} =~ /^\d+$/) { |
|
$newvalues{$entry} .= ':'.$env{'form.extreswin'.$dim}; |
|
} else { |
|
$newvalues{$entry} .= ':'; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
unless (($newvalues{$entry} eq 'iframe') && ($values->{$entry} eq '')) { |
|
if ($newvalues{$entry} ne $values->{$entry}) { |
|
$changes->{$entry} = $newvalues{$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')) { |
if ($newvalues{$entry} ne $values->{$entry}) { |
if ($newvalues{$entry} ne $values->{$entry}) { |
$changes->{$entry} = $newvalues{$entry}; |
$changes->{$entry} = $newvalues{$entry}; |
} |
} |
Line 1548 sub process_linkprot {
|
Line 1576 sub process_linkprot {
|
if (ref($values) eq 'HASH') { |
if (ref($values) eq 'HASH') { |
my @todelete = &Apache::loncommon::get_env_multiple('form.linkprot_del'); |
my @todelete = &Apache::loncommon::get_env_multiple('form.linkprot_del'); |
my $maxnum = $env{'form.linkprot_maxnum'}; |
my $maxnum = $env{'form.linkprot_maxnum'}; |
for (my $i=0; $i<=$maxnum; $i++) { |
for (my $i=0; $i<$maxnum; $i++) { |
my $itemid = $env{'form.linkprot_id_'.$i}; |
my $itemid = $env{'form.linkprot_id_'.$i}; |
$itemid =~ s/\D+//g; |
$itemid =~ s/\D+//g; |
if ($itemid) { |
if ($itemid) { |
Line 1593 sub process_linkprot {
|
Line 1621 sub process_linkprot {
|
$linkprot{$itemid}{$inner} = $env{$formitem}; |
$linkprot{$itemid}{$inner} = $env{$formitem}; |
} |
} |
} |
} |
|
my $urlitem = 'form.linkprot_returnurl_'.$idx; |
|
my $urlparamname = 'form.linkprot_urlparam_'.$idx; |
|
if ($env{$urlitem} == 1) { |
|
$env{$urlparamname} =~ s/(`)/'/g; |
|
} elsif (exists($env{$urlparamname})) { |
|
$env{$urlparamname} = ''; |
|
} |
|
unless ($idx eq 'add') { |
|
if ((!$current{'returnurl'} && ($env{$urlparamname} ne '')) || |
|
($current{'returnurl'} && ($env{$urlparamname} eq ''))) { |
|
$haschanges{$itemid} = 1; |
|
} |
|
} |
|
if ($env{$urlparamname} ne '') { |
|
$linkprot{$itemid}{'returnurl'} = $env{$urlparamname}; |
|
} |
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 1678 sub process_linkprot {
|
Line 1722 sub process_linkprot {
|
$changes->{$entry} = $linkprot{$entry}; |
$changes->{$entry} = $linkprot{$entry}; |
} |
} |
if (ref($lastactref) eq 'HASH') { |
if (ref($lastactref) eq 'HASH') { |
$lastactref->{'courselti'} = 1'; |
$lastactref->{'courselti'} = 1; |
} |
} |
} |
} |
return $errors; |
return $errors; |
Line 1887 sub store_changes {
|
Line 1931 sub store_changes {
|
my ($displayname,$text); |
my ($displayname,$text); |
$text = $prefs->{$item}->{'itemtext'}{$key}; |
$text = $prefs->{$item}->{'itemtext'}{$key}; |
my $displayval; |
my $displayval; |
unless (($key eq 'co-owners') || ($key eq 'discussion_post_fonts')) { |
unless (($key eq 'co-owners') || ($key eq 'discussion_post_fonts') || ($key eq 'extresource')) { |
$displayval = $changes->{$item}{$key}; |
$displayval = $changes->{$item}{$key}; |
} |
} |
if ($item eq 'feedback') { |
if ($item eq 'feedback') { |
Line 2012 sub store_changes {
|
Line 2056 sub store_changes {
|
} elsif ($changes->{$item}{$key} eq '0') { |
} elsif ($changes->{$item}{$key} eq '0') { |
$displayval = &mt('No'); |
$displayval = &mt('No'); |
} |
} |
|
} elsif ($key eq 'extresource') { |
|
if ($changes->{$item}{$key} eq 'iframe') { |
|
$displayval = &mt('In iframe'); |
|
} else { |
|
my ($selected,$reuse,$width,$height) = split(/:/,$changes->{$item}{$key}); |
|
if ($selected eq 'tab') { |
|
if ($reuse) { |
|
$displayval = &mt('[_1]In tab[_2],[_3] and tab re-used for different external resources in course', |
|
"'<b>","</b>'",'<br />'); |
|
} else { |
|
$displayval = &mt('[_1]In tab[_2],[_3] with new tab for each external resource in course', |
|
"'<b>","</b>'",'<br />'); |
|
} |
|
} elsif ($selected eq 'window') { |
|
if ($reuse) { |
|
$displayval = &mt('[_1]In pop-up window[_2],[_3] and window re-used for different external resources in course', |
|
"'<b>","</b>'",'<br />'); |
|
} else { |
|
$displayval = &mt('[_1]In pop-up window[_2],[_3] with new window for each external resource in course', |
|
"'<b>","</b>'",'<br />'); |
|
} |
|
if (($width ne '') || ($height ne '')) { |
|
if ($width ne '') { |
|
$displayval .= '<br />'.&mt('Window width: [_1]px',$width); |
|
} |
|
if ($height ne '') { |
|
$displayval .= '<br />'.&mt('Window height: [_1]px',$height); |
|
} |
|
} |
|
} |
|
} |
} |
} |
if ($key eq 'co-owners') { |
if ($key eq 'co-owners') { |
if (ref($changes->{$item}{$key}) eq 'HASH') { |
if (ref($changes->{$item}{$key}) eq 'HASH') { |
Line 2083 sub store_changes {
|
Line 2158 sub store_changes {
|
$output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt('Numbered menu collections:')).'<br />'. |
$output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt('Numbered menu collections:')).'<br />'. |
$displayval.'</li>'; |
$displayval.'</li>'; |
} else { |
} else { |
|
unless (($key eq 'extresource') && ($changes->{$item}{$key} ne 'iframe')) { |
|
$displayval = "'<b>$displayval</b>'"; |
|
} |
$output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt('[_1] set to [_2]', |
$output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt('[_1] set to [_2]', |
'<i>'.$displayname.'</i>', |
'<i>'.$displayname.'</i>',$displayval)); |
"'<b>$displayval</b>'")); |
|
if ($key eq 'url') { |
if ($key eq 'url') { |
my $bkuptime=time; |
my $bkuptime=time; |
$output .= (' 'x2).&mt('(Previous URL backed up)').': '. |
$output .= (' 'x2).&mt('(Previous URL backed up)').': '. |
Line 2213 sub store_linkprot {
|
Line 2290 sub store_linkprot {
|
if (exists($oldlinkprot->{$id}{'usable'})) { |
if (exists($oldlinkprot->{$id}{'usable'})) { |
$changes->{$id}->{'usable'} = 1; |
$changes->{$id}->{'usable'} = 1; |
} |
} |
|
if (exists($oldlinkprot->{$id}{'cipher'})) { |
|
$changes->{$id}->{'cipher'} = $oldlinkprot->{$id}{'cipher'}; |
|
} |
} |
} |
} |
} |
} |
} |
Line 2263 sub store_linkprot {
|
Line 2343 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') { |
foreach my $title ('name','lifetime','version','key','secret','returnurl') { |
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 2279 sub store_linkprot {
|
Line 2359 sub store_linkprot {
|
if ($values{$title} eq 'LTI-1p0') { |
if ($values{$title} eq 'LTI-1p0') { |
$display .= $desc{$title}.': 1.1, '; |
$display .= $desc{$title}.': 1.1, '; |
} |
} |
|
} elsif ($title eq 'returnurl') { |
|
if ($values{$title}) { |
|
$display .= &mt('Return URL parameter').': '.$values{$title}.', '; |
|
} |
} else { |
} else { |
$display .= $desc{$title}.': '.$values{$title}.', '; |
$display .= $desc{$title}.': '.$values{$title}.', '; |
} |
} |
Line 2467 sub get_course {
|
Line 2551 sub get_course {
|
sub get_jscript { |
sub get_jscript { |
my ($cid,$cdom,$phase,$crstype,$settings,$noedit) = @_; |
my ($cid,$cdom,$phase,$crstype,$settings,$noedit) = @_; |
my ($can_toggle_cat,$can_categorize) = &can_modify_catsettings($cdom,$crstype); |
my ($can_toggle_cat,$can_categorize) = &can_modify_catsettings($cdom,$crstype); |
my ($jscript,$categorize_js,$loncaparev_js,$instcode_js); |
my ($jscript,$categorize_js,$loncaparev_js,$instcode_js,$extresource_js); |
my $stubrowse_js = &Apache::loncommon::studentbrowser_javascript(); |
my $stubrowse_js = &Apache::loncommon::studentbrowser_javascript(); |
my $browse_js = &Apache::loncommon::browser_and_searcher_javascript('parmset'); |
my $browse_js = &Apache::loncommon::browser_and_searcher_javascript('parmset'); |
my $cloners_js = &cloners_javascript($phase); |
my $cloners_js = &cloners_javascript($phase); |
Line 2674 function toggleAddmenucoll() {
|
Line 2758 function toggleAddmenucoll() {
|
} |
} |
ENDSCRIPT |
ENDSCRIPT |
} |
} |
|
$extresource_js = <<"ENDSCRIPT"; |
|
function toggleExtRes() { |
|
if (document.getElementById('LC_extresource')) { |
|
var extressel = document.getElementById('LC_extresource').value; |
|
if (document.getElementById('LC_extresreusediv')) { |
|
var extresreuse = document.getElementById('LC_extresreusediv'); |
|
if (document.getElementById('LC_extressize')) { |
|
var extressize = document.getElementById('LC_extressize'); |
|
var setvis; |
|
if ((extressel == 'tab') || (extressel == 'window')) { |
|
extresreuse.style.display = 'inline-block'; |
|
setvis = 1; |
|
if (extressel == 'window') { |
|
extressize.style.display = 'inline-block'; |
|
} else { |
|
extressize.style.display = 'none'; |
|
} |
|
} |
|
if (!setvis) { |
|
extresreuse.style.display = 'none'; |
|
extressize.style.display = 'none'; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
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. |
$cloners_js."\n".$instcode_js. |
$syllabus_js."\n".$menuitems_js."\n". |
$syllabus_js."\n".$menuitems_js."\n".$extresource_js."\n". |
&linkprot_javascript()."\n".'//]]>'."\n". |
&linkprot_javascript()."\n".'//]]>'."\n". |
'</script>'."\n".$stubrowse_js."\n"; |
'</script>'."\n".$stubrowse_js."\n"; |
return $jscript; |
return $jscript; |
Line 2799 function toggleLinkProt(form,num,item) {
|
Line 2910 function toggleLinkProt(form,num,item) {
|
return; |
return; |
} |
} |
|
|
function toggleLinkProtReqUser(form,item,extra,valon,styleon,num) { |
function toggleLinkProtExtra(form,item,extra,valon,styleon,num) { |
if (document.getElementById('linkprot_'+extra+'_'+num)) { |
if (document.getElementById('linkprot_'+extra+'_'+num)) { |
var extraid = document.getElementById('linkprot_'+extra+'_'+num); |
var extraid = document.getElementById('linkprot_'+extra+'_'+num); |
var itemname = form.elements['linkprot_'+item+'_'+num]; |
var itemname = form.elements['linkprot_'+item+'_'+num]; |
Line 5053 sub print_appearance {
|
Line 5164 sub print_appearance {
|
text => '<b>'.&mt($itemtext->{'inline_chem'}).'</b>', |
text => '<b>'.&mt($itemtext->{'inline_chem'}).'</b>', |
input => 'radio', |
input => 'radio', |
}, |
}, |
|
'extresource' => { |
|
text => '<b>'.&mt($itemtext->{'extresource'}).'</b>', |
|
input => 'selectbox', |
|
options => { |
|
iframe => 'In iframe', |
|
tab => 'In new tab', |
|
window => 'In pop-up window', |
|
}, |
|
order => ['iframe','tab','window'], |
|
}, |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'appearance',$noedit); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'appearance',$noedit); |
} |
} |
Line 5706 sub print_linkprotection {
|
Line 5827 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); |
my ($usersty,$onclickrequser,%checkedrequser,$onclickreturnurl,%checkedreturnurl); |
if ($ltiauth) { |
if ($ltiauth) { |
$usersty = 'display:none'; |
$usersty = 'display:none'; |
$onclickrequser = ' onclick="toggleLinkProtReqUser(this.form,'."'requser','optional','1','block','$i'".');"'; |
$onclickrequser = ' onclick="toggleLinkProtExtra(this.form,'."'requser','optional','1','block','$i'".');"'; |
%checkedrequser = ( |
%checkedrequser = ( |
no => ' checked="checked"', |
no => ' checked="checked"', |
yes => '', |
yes => '', |
Line 5723 sub print_linkprotection {
|
Line 5844 sub print_linkprotection {
|
$usersty = 'display:inline-block'; |
$usersty = 'display:inline-block'; |
} |
} |
} |
} |
|
$onclickreturnurl = ' onclick="toggleLinkProtExtra(this.form,'."'returnurl','divurlparam','1','inline-block','$i'".');"'; |
|
%checkedreturnurl = ( |
|
no => ' checked="checked"', |
|
yes => '', |
|
); |
|
if ($values{'returnurl'} ne '') { |
|
$checkedreturnurl{'yes'} = $checkedreturnurl{'no'}; |
|
$checkedreturnurl{'no'} = ''; |
|
} |
$datatable .= |
$datatable .= |
'<span class="LC_nobreak">'.$desc{'name'}. |
'<span class="LC_nobreak">'.$desc{'name'}. |
':<input type="text" size="15" name="linkprot_name_'.$i.'" value="'.$values{'name'}.'" autocomplete="off"'.$disabled.' /></span> '. |
':<input type="text" size="15" name="linkprot_name_'.$i.'" value="'.$values{'name'}.'" autocomplete="off"'.$disabled.' /></span> '. |
Line 5731 sub print_linkprotection {
|
Line 5861 sub print_linkprotection {
|
'<option value="LTI-1p0" '.$selected.'>1.1</option></select></span> '."\n". |
'<option value="LTI-1p0" '.$selected.'>1.1</option></select></span> '."\n". |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$desc{'lifetime'}.':<input type="text" name="linkprot_lifetime_'.$i.'"'. |
'<span class="LC_nobreak">'.$desc{'lifetime'}.':<input type="text" name="linkprot_lifetime_'.$i.'"'. |
' value="'.$values{'lifetime'}.'" size="3"'.$disabled.' /></span>'; |
' value="'.$values{'lifetime'}.'" size="3"'.$disabled.' /></span><br /><br />'; |
if ($ltiauth) { |
|
$datatable .= (' 'x2).'<span class="LC_nobreak">'.$desc{'requser'}.'?'. |
|
'<label><input type="radio" name="linkprot_requser_'.$i.'" value="0"'. |
|
$onclickrequser.$checkedrequser{'no'}.$disabled.' />'.&mt('No').'</label> '. |
|
'<label><input type="radio" name="linkprot_requser_'.$i.'" value="1"'. |
|
$onclickrequser.$checkedrequser{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'; |
|
} |
|
$datatable .= '<br /><br />'; |
|
if ($values{'key'} ne '') { |
if ($values{'key'} ne '') { |
$datatable .= '<span class="LC_nobreak">'.$desc{'key'}; |
$datatable .= '<span class="LC_nobreak">'.$desc{'key'}; |
if ($noedit) { |
if ($noedit) { |
Line 5771 sub print_linkprotection {
|
Line 5893 sub print_linkprotection {
|
} else { |
} else { |
$datatable .= '<span class="LC_nobreak">'.&mt('Secret required').' - '.$switchmessage.'</span>'."\n"; |
$datatable .= '<span class="LC_nobreak">'.&mt('Secret required').' - '.$switchmessage.'</span>'."\n"; |
} |
} |
|
$datatable .= '<input type="hidden" name="linkprot_id_'.$i.'" value="'.$num.'" />'; |
} else { |
} else { |
if ($values{'usable'} ne '') { |
if ($values{'usable'} ne '') { |
$datatable .= '<div id="linkprot_divcurrsecret_'.$i.'" style="display:inline-block" /><span class="LC_nobreak">'. |
$datatable .= '<div id="linkprot_divcurrsecret_'.$i.'" style="display:inline-block" /><span class="LC_nobreak">'. |
Line 5792 sub print_linkprotection {
|
Line 5915 sub print_linkprotection {
|
'<input type="hidden" name="linkprot_id_'.$i.'" value="'.$num.'" /></span>'; |
'<input type="hidden" name="linkprot_id_'.$i.'" value="'.$num.'" /></span>'; |
} |
} |
} |
} |
|
$datatable .= '<br /><br />'. |
|
'<span class="LC_nobreak">'.$desc{'returnurl'}.'?'. |
|
'<label><input type="radio" name="linkprot_returnurl_'.$i.'" value="0"'. |
|
$onclickreturnurl.$checkedreturnurl{'no'}.$disabled.' />'.&mt('No').'</label> '. |
|
'<label><input type="radio" name="linkprot_returnurl_'.$i.'" value="1"'. |
|
$onclickreturnurl.$checkedreturnurl{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
|
' </span><div id="linkprot_divurlparam_'.$i.'" style="display:none" />'. |
|
'<span class="LC_nobreak">'.&mt('Parameter name').':'. |
|
'<input type="text" size="15" name="linkprot_urlparam_'.$i.'" value="'.$values{'returnurl'}.'" autocomplete="off"'.$disabled.' />'. |
|
'</span></div> '; |
if ($ltiauth) { |
if ($ltiauth) { |
$datatable .= |
$datatable .= (' 'x2).'<span class="LC_nobreak">'.$desc{'requser'}.'?'. |
|
'<label><input type="radio" name="linkprot_requser_'.$i.'" value="0"'. |
|
$onclickrequser.$checkedrequser{'no'}.$disabled.' />'.&mt('No').'</label> '. |
|
'<label><input type="radio" name="linkprot_requser_'.$i.'" value="1"'. |
|
$onclickrequser.$checkedrequser{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
'</fieldset>'. |
'</fieldset>'. |
'<fieldset id="linkprot_optional_'.$i.'" style="'.$usersty.'"><legend>'.$lt{'opti'}.'</legend>'. |
'<fieldset id="linkprot_optional_'.$i.'" style="'.$usersty.'"><legend>'.$lt{'opti'}.'</legend>'. |
&linkprot_options($i,$itemcount,$disabled,\%values,\%desc). |
&linkprot_options($i,$itemcount,$disabled,\%values,\%desc). |
Line 5809 sub print_linkprotection {
|
Line 5946 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); |
my ($usersty,$onclickrequser,%checkedrequser,$onclickreturnurl,%checkedreturnurl); |
if ($ltiauth) { |
if ($ltiauth) { |
$usersty = 'display:none'; |
$usersty = 'display:none'; |
$onclickrequser = ' onclick="toggleLinkProtReqUser(this.form,'."'requser','optional','1','block','add'".');"'; |
$onclickrequser = ' onclick="toggleLinkProtExtra(this.form,'."'requser','optional','1','block','add'".');"'; |
%checkedrequser = ( |
%checkedrequser = ( |
no => ' checked="checked"', |
no => ' checked="checked"', |
yes => '', |
yes => '', |
); |
); |
$datatable .= '<fieldset><legend>'.$lt{'requ'}.'</legend>'; |
$datatable .= '<fieldset><legend>'.$lt{'requ'}.'</legend>'; |
} |
} |
|
$onclickreturnurl = ' onclick="toggleLinkProtExtra(this.form,'."'returnurl','divurlparam','1','inline-block','add'".');"'; |
|
%checkedreturnurl = ( |
|
no => ' checked="checked"', |
|
yes => '', |
|
); |
$datatable .= '<span class="LC_nobreak">'.$desc{'name'}. |
$datatable .= '<span class="LC_nobreak">'.$desc{'name'}. |
':<input type="text" size="15" name="linkprot_name_add" value="" autocomplete="off"'.$disabled.' /></span> '."\n". |
':<input type="text" size="15" name="linkprot_name_add" value="" autocomplete="off"'.$disabled.' /></span> '."\n". |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$desc{'version'}.':<select name="linkprot_version_add"'.$disabled.'>'. |
'<span class="LC_nobreak">'.$desc{'version'}.':<select name="linkprot_version_add"'.$disabled.'>'. |
'<option value="LTI-1p0" selected="selected">1.1</option></select></span> '."\n". |
'<option value="LTI-1p0" selected="selected">1.1</option></select></span> '."\n". |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$desc{'lifetime'}.':<input type="text" size="3" name="linkprot_lifetime_add" value="300"'.$disabled.' /></span> '."\n"; |
'<span class="LC_nobreak">'.$desc{'lifetime'}.':<input type="text" size="3" name="linkprot_lifetime_add" value="300"'.$disabled.' /></span> '."\n". |
if ($ltiauth) { |
'<br /><br />'; |
$datatable .= (' 'x2).'<span class="LC_nobreak">'.$desc{'requser'}.'?'. |
|
'<label><input type="radio" name="linkprot_requser_add" value="0"'. |
|
$onclickrequser.$checkedrequser{'no'}.$disabled.' />'.&mt('No').'</label> '. |
|
'<label><input type="radio" name="linkprot_requser_add" value="1"'. |
|
$onclickrequser.$checkedrequser{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'; |
|
} |
|
$datatable .= '<br /><br />'; |
|
if ($switchserver) { |
if ($switchserver) { |
$datatable .= '<span class="LC_nobreak">'.&mt('Key and Secret are required').' - '.$switchmessage.'</span>'."\n"; |
$datatable .= '<span class="LC_nobreak">'.&mt('Key and Secret are required').' - '.$switchmessage.'</span>'."\n"; |
} else { |
} else { |
Line 5842 sub print_linkprotection {
|
Line 5977 sub print_linkprotection {
|
'<span class="LC_nobreak">'.$desc{'secret'}.':<input type="password" size="20" name="linkprot_secret_add" value="" autocomplete="off"'.$disabled.' />'. |
'<span class="LC_nobreak">'.$desc{'secret'}.':<input type="password" size="20" name="linkprot_secret_add" value="" autocomplete="off"'.$disabled.' />'. |
'<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 />'. |
|
'<span class="LC_nobreak">'.$desc{'returnurl'}.'?'. |
|
'<label><input type="radio" name="linkprot_returnurl_add" value="0"'. |
|
$onclickreturnurl.$checkedreturnurl{'no'}.$disabled.' />'.&mt('No').'</label> '. |
|
'<label><input type="radio" name="linkprot_returnurl_add" value="1"'. |
|
$onclickreturnurl.$checkedreturnurl{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
|
' </span><div id="linkprot_divurlparam_add" style="display:none" />'. |
|
'<span class="LC_nobreak">'.&mt('Parameter name').':'. |
|
'<input type="text" size="15" name="linkprot_urlparam_add" value="" autocomplete="off"'.$disabled.' />'. |
|
'</span></div> '; |
if ($ltiauth) { |
if ($ltiauth) { |
$datatable .= '</fieldset>'. |
$datatable .= (' 'x2).'<span class="LC_nobreak">'.$desc{'requser'}.'?'. |
|
'<label><input type="radio" name="linkprot_requser_add" value="0"'. |
|
$onclickrequser.$checkedrequser{'no'}.$disabled.' />'.&mt('No').'</label> '. |
|
'<label><input type="radio" name="linkprot_requser_add" value="1"'. |
|
$onclickrequser.$checkedrequser{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
|
'</fieldset>'. |
'<fieldset id="linkprot_optional_add" style="'.$usersty.'"><legend>'.$lt{'opti'}.'</legend>'. |
'<fieldset id="linkprot_optional_add" style="'.$usersty.'"><legend>'.$lt{'opti'}.'</legend>'. |
&linkprot_options('add',$itemcount,$disabled,{},\%desc). |
&linkprot_options('add',$itemcount,$disabled,{},\%desc). |
'</fieldset>'; |
'</fieldset>'; |
Line 5860 sub linkprot_names {
|
Line 6010 sub linkprot_names {
|
'lifetime' => 'Nonce lifetime (s)', |
'lifetime' => 'Nonce lifetime (s)', |
'name' => 'Launcher Application', |
'name' => 'Launcher Application', |
'secret' => 'Secret', |
'secret' => 'Secret', |
|
'returnurl' => 'Launcher return URL', |
'requser' => 'Use identity', |
'requser' => 'Use identity', |
'email' => 'Email address', |
'email' => 'Email address', |
'sourcedid' => 'User ID', |
'sourcedid' => 'User ID', |
Line 5915 sub linkprot_options {
|
Line 6066 sub linkprot_options {
|
$checked{'auth'} = ' checked="checked"'; |
$checked{'auth'} = ' checked="checked"'; |
} |
} |
} |
} |
my $onclickuser = ' onclick="toggleLinkProtReqUser(this.form,'."'mapuser','userfield','other','inline-block','$num'".');"'; |
my $onclickuser = ' onclick="toggleLinkProtExtra(this.form,'."'mapuser','userfield','other','inline-block','$num'".');"'; |
my $output = '<div class="LC_floatleft"><span class="LC_nobreak">'. |
my $output = '<div class="LC_floatleft"><span class="LC_nobreak">'. |
&mt('Source of LON-CAPA username in LTI request').': '; |
&mt('Source of LON-CAPA username in LTI request').': '; |
foreach my $option ('sourcedid','email','other') { |
foreach my $option ('sourcedid','email','other') { |
Line 5939 sub linkprot_options {
|
Line 6090 sub linkprot_options {
|
return $output; |
return $output; |
} |
} |
|
|
|
sub print_extresource_row { |
|
my ($item,$config,$curr,$noedit) = @_; |
|
my $onchange; |
|
unless ($noedit) { |
|
$onchange = ' onchange="javascript:toggleExtRes();"'; |
|
} |
|
my $id = 'LC_'.$item; |
|
my ($selected,$reuse,$width,$height) = split(/:/,$curr); |
|
my $output = &select_from_options($item,$config->{'order'}, |
|
$config->{'options'},$selected, |
|
$config->{'nullval'}, |
|
undef,undef,$onchange,$noedit,$id); |
|
my ($checked,$reusesty,$sizesty); |
|
if ($reuse) { |
|
$checked = ' checked="checked"'; |
|
} |
|
$reusesty = 'none'; |
|
$sizesty = 'none'; |
|
if (($selected eq 'window') || ($selected eq 'tab')) { |
|
$reusesty = 'inline-block'; |
|
if ($selected eq 'window') { |
|
$sizesty = 'inline-block'; |
|
} |
|
} |
|
$output .= '<div id="LC_extresreusediv" style="display:'.$reusesty.';">'. |
|
'<span class="LC_nobreak">'. |
|
'<label><input type="checkbox" name="extwintabreuse" value="1"'.$checked.'>'. |
|
&mt('Re-use tab/window').'</label>'. |
|
'</span></div>'. |
|
'<fieldset id="LC_extressize" style="display:'.$sizesty.';">'. |
|
'<legend>'.&mt('Window size (optional)').'</legend>'. |
|
'<span class="LC_nobreak">'. |
|
&mt('width').':<input type="text" name="extreswinwidth" value="'.$width.'" size="3" />px'. |
|
(' ' x 3). |
|
&mt('height').':<input type="text" name="extreswinheight" value="'.$height.'" size="3" />px'. |
|
'</span></fieldset>'; |
|
return $output; |
|
} |
|
|
sub print_other { |
sub print_other { |
my ($cdom,$settings,$allitems,$rowtotal,$crstype,$noedit) = @_; |
my ($cdom,$settings,$allitems,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($allitems) eq 'ARRAY')) { |
unless ((ref($settings) eq 'HASH') && (ref($allitems) eq 'ARRAY')) { |
Line 6110 sub make_item_rows {
|
Line 6300 sub make_item_rows {
|
(($caller eq 'printouts') && ($item ne 'print_header_format'))) { |
(($caller eq 'printouts') && ($item ne 'print_header_format'))) { |
$colspan = 2; |
$colspan = 2; |
} |
} |
|
my $rowdesc; |
|
if ($caller eq 'appearance') { |
|
$rowdesc = '<span class="LC_nobreak">'.$items->{$item}{text}.'</span>'; |
|
} else { |
|
$rowdesc = $items->{$item}{text}; |
|
} |
if (exists $items->{$item}{advanced} && $items->{$item}{advanced} == 1) { |
if (exists $items->{$item}{advanced} && $items->{$item}{advanced} == 1) { |
$datatable .= &item_table_row_start($items->{$item}{text},$count,"advanced",$colspan); |
$datatable .= &item_table_row_start($rowdesc,$count,"advanced",$colspan); |
} else { |
} else { |
$datatable .= &item_table_row_start($items->{$item}{text},$count,undef,$colspan); |
$datatable .= &item_table_row_start($rowdesc,$count,undef,$colspan); |
} |
} |
if ($item eq 'defaultcredits') { |
if ($item eq 'defaultcredits') { |
my $defaultcredits = $env{'course.'.$env{'request.course.id'}.'.internal.defaultcredits'}; |
my $defaultcredits = $env{'course.'.$env{'request.course.id'}.'.internal.defaultcredits'}; |
Line 6132 sub make_item_rows {
|
Line 6328 sub make_item_rows {
|
$datatable .= &print_hdrfmt_row($item,$settings,$noedit); |
$datatable .= &print_hdrfmt_row($item,$settings,$noedit); |
} elsif ($item eq 'lti.lcmenu') { |
} elsif ($item eq 'lti.lcmenu') { |
$datatable .= &lcmenu_checkboxes($cdom,$item,$settings,$crstype,$noedit); |
$datatable .= &lcmenu_checkboxes($cdom,$item,$settings,$crstype,$noedit); |
|
} elsif ($item eq 'extresource') { |
|
$datatable .= &print_extresource_row($item,$items->{$item},$settings->{$item},$noedit); |
} elsif ($items->{$item}{input} eq 'dates') { |
} elsif ($items->{$item}{input} eq 'dates') { |
my $disabled; |
my $disabled; |
if ($noedit) { |
if ($noedit) { |