version 1.322, 2017/12/07 01:36:11
|
version 1.323, 2017/12/30 14:03:53
|
Line 4112 sub print_ltitools {
|
Line 4112 sub print_ltitools {
|
for (my $i=0; $i<@items; $i++) { |
for (my $i=0; $i<@items; $i++) { |
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
my $item = $ordered{$items[$i]}; |
my $item = $ordered{$items[$i]}; |
my ($title,$key,$secret,$url,$lifetime,$imgsrc); |
my ($title,$key,$secret,$url,$lifetime,$imgsrc,%sigsel); |
if (ref($settings->{$item}) eq 'HASH') { |
if (ref($settings->{$item}) eq 'HASH') { |
$title = $settings->{$item}->{'title'}; |
$title = $settings->{$item}->{'title'}; |
$url = $settings->{$item}->{'url'}; |
$url = $settings->{$item}->{'url'}; |
Line 4123 sub print_ltitools {
|
Line 4123 sub print_ltitools {
|
if ($image ne '') { |
if ($image ne '') { |
$imgsrc = '<img src="'.$image.'" alt="'.&mt('Tool Provider icon').'" />'; |
$imgsrc = '<img src="'.$image.'" alt="'.&mt('Tool Provider icon').'" />'; |
} |
} |
|
if ($settings->{$item}->{'sigmethod'} eq 'HMAC-256') { |
|
$sigsel{'HMAC-256'} = ' selected="selected"'; |
|
} else { |
|
$sigsel{'HMAC-SHA1'} = ' selected="selected"'; |
|
} |
} |
} |
my $chgstr = ' onchange="javascript:reorderLTITools(this.form,'."'ltitools_".$item."'".');"'; |
my $chgstr = ' onchange="javascript:reorderLTITools(this.form,'."'ltitools_".$item."'".');"'; |
$datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">' |
$datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">' |
Line 4140 sub print_ltitools {
|
Line 4145 sub print_ltitools {
|
&mt('Delete?').'</label></span></td>'. |
&mt('Delete?').'</label></span></td>'. |
'<td colspan="2">'. |
'<td colspan="2">'. |
'<fieldset><legend>'.&mt('Required settings').'</legend>'. |
'<fieldset><legend>'.&mt('Required settings').'</legend>'. |
'<span class="LC_nobreak">'.$lt{'title'}.':<input type="text" size="30" name="ltitools_title_'.$i.'" value="'.$title.'" /></span> '. |
'<span class="LC_nobreak">'.$lt{'title'}.':<input type="text" size="20" name="ltitools_title_'.$i.'" value="'.$title.'" /></span> '. |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'version'}.':<select name="ltitools_version_'.$i.'">'. |
'<span class="LC_nobreak">'.$lt{'version'}.':<select name="ltitools_version_'.$i.'">'. |
'<option value="LTI-1p0" selected="selected">1.1</option></select></span> '. |
'<option value="LTI-1p0" selected="selected">1.1</option></select></span> '. |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'msgtype'}.':<select name="ltitools_msgtype_'.$i.'">'. |
'<span class="LC_nobreak">'.$lt{'msgtype'}.':<select name="ltitools_msgtype_'.$i.'">'. |
'<option value="basic-lti-launch-request" selected="selected">Launch</option></select></span> '. |
'<option value="basic-lti-launch-request" selected="selected">Launch</option></select></span> '. |
|
(' 'x2). |
|
'<span class="LC_nobreak">'.$lt{'sigmethod'}.':<select name="ltitools_sigmethod_'.$i.'">'. |
|
'<option value="HMAC-SHA1"'.$sigsel{'HMAC-SHA1'}.'>HMAC-SHA1</option>'. |
|
'<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="30" name="ltitools_url_'.$i.'"'. |
'<span class="LC_nobreak">'.$lt{'url'}.':<input type="text" size="40" name="ltitools_url_'.$i.'"'. |
' value="'.$url.'" /></span>'. |
' value="'.$url.'" /></span>'. |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'key'}.':'. |
'<span class="LC_nobreak">'.$lt{'key'}.':'. |
Line 4345 sub print_ltitools {
|
Line 4354 sub print_ltitools {
|
'<input type="checkbox" name="ltitools_add" value="1" />'.&mt('Add').'</td>'."\n". |
'<input type="checkbox" name="ltitools_add" value="1" />'.&mt('Add').'</td>'."\n". |
'<td colspan="2">'. |
'<td colspan="2">'. |
'<fieldset><legend>'.&mt('Required settings').'</legend>'. |
'<fieldset><legend>'.&mt('Required settings').'</legend>'. |
'<span class="LC_nobreak">'.$lt{'title'}.':<input type="text" size="30" name="ltitools_add_title" value="" /></span> '."\n". |
'<span class="LC_nobreak">'.$lt{'title'}.':<input type="text" size="20" name="ltitools_add_title" value="" /></span> '."\n". |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'version'}.':<select name="ltitools_add_version">'. |
'<span class="LC_nobreak">'.$lt{'version'}.':<select name="ltitools_add_version">'. |
'<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">'.$lt{'msgtype'}.':<select name="ltitools_add_msgtype">'. |
'<span class="LC_nobreak">'.$lt{'msgtype'}.':<select name="ltitools_add_msgtype">'. |
'<option value="basic-lti-launch-request" selected="selected">Launch</option></select></span> '. |
'<option value="basic-lti-launch-request" selected="selected">Launch</option></select></span> '. |
|
'<span class="LC_nobreak">'.$lt{'sigmethod'}.':<select name="ltitools_add_sigmethod">'. |
|
'<option value="HMAC-SHA1" selected="selected">HMAC-SHA1</option>'. |
|
'<option value="HMAC-SHA256">HMAC-SHA256</option></select></span>'. |
'<br />'. |
'<br />'. |
'<span class="LC_nobreak">'.$lt{'url'}.':<input type="text" size="30" name="ltitools_add_url" value="" /></span> '."\n". |
'<span class="LC_nobreak">'.$lt{'url'}.':<input type="text" size="40" name="ltitools_add_url" value="" /></span> '."\n". |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'key'}.':<input type="text" size="25" name="ltitools_add_key" value="" /></span> '."\n". |
'<span class="LC_nobreak">'.$lt{'key'}.':<input type="text" size="25" name="ltitools_add_key" value="" /></span> '."\n". |
(' 'x2). |
(' 'x2). |
Line 4457 sub ltitools_names {
|
Line 4469 sub ltitools_names {
|
'title' => 'Title', |
'title' => 'Title', |
'version' => 'Version', |
'version' => 'Version', |
'msgtype' => 'Message Type', |
'msgtype' => 'Message Type', |
|
'sigmethod' => 'Signature Method', |
'url' => 'URL', |
'url' => 'URL', |
'key' => 'Key', |
'key' => 'Key', |
'lifetime' => 'Nonce lifetime (s)', |
'lifetime' => 'Nonce lifetime (s)', |
Line 10670 sub modify_ltitools {
|
Line 10683 sub modify_ltitools {
|
if ($env{'form.ltitools_add_msgtype'} eq 'basic-lti-launch-request') { |
if ($env{'form.ltitools_add_msgtype'} eq 'basic-lti-launch-request') { |
$confhash{$newid}{'msgtype'} = $env{'form.ltitools_add_msgtype'}; |
$confhash{$newid}{'msgtype'} = $env{'form.ltitools_add_msgtype'}; |
} |
} |
|
if ($env{'form.ltitools_add_sigmethod'} eq 'HMAC-SHA256') { |
|
$confhash{$newid}{'sigmethod'} = $env{'form.ltitools_add_sigmethod'}; |
|
} else { |
|
$confhash{$newid}{'sigmethod'} = 'HMAC-SHA1'; |
|
} |
foreach my $item ('width','height','linktext','explanation') { |
foreach my $item ('width','height','linktext','explanation') { |
$env{'form.ltitools_add_'.$item} =~ s/^\s+//; |
$env{'form.ltitools_add_'.$item} =~ s/^\s+//; |
$env{'form.ltitools_add_'.$item} =~ s/\s+$//; |
$env{'form.ltitools_add_'.$item} =~ s/\s+$//; |
Line 10796 sub modify_ltitools {
|
Line 10814 sub modify_ltitools {
|
if ($env{'form.ltitools_msgtype_'.$i} eq 'basic-lti-launch-request') { |
if ($env{'form.ltitools_msgtype_'.$i} eq 'basic-lti-launch-request') { |
$confhash{$itemid}{'msgtype'} = $env{'form.ltitools_msgtype_'.$i}; |
$confhash{$itemid}{'msgtype'} = $env{'form.ltitools_msgtype_'.$i}; |
} |
} |
|
if ($env{'form.ltitools_sigmethod_'.$i} eq 'HMAC-SHA256') { |
|
$confhash{$itemid}{'sigmethod'} = $env{'form.ltitools_sigmethod_'.$i}; |
|
} else { |
|
$confhash{$itemid}{'sigmethod'} = 'HMAC-SHA1'; |
|
} |
|
if ($domconfig{$action}{$itemid}{'sigmethod'} eq '') { |
|
if ($confhash{$itemid}{'sigmethod'} ne 'HMAC-SHA1') { |
|
$changes{$itemid} = 1; |
|
} |
|
} elsif ($domconfig{$action}{$itemid}{'sigmethod'} ne $confhash{$itemid}{'sigmethod'}) { |
|
$changes{$itemid} = 1; |
|
} |
foreach my $size ('width','height') { |
foreach my $size ('width','height') { |
$env{'form.ltitools_'.$size.'_'.$i} =~ s/^\s+//; |
$env{'form.ltitools_'.$size.'_'.$i} =~ s/^\s+//; |
$env{'form.ltitools_'.$size.'_'.$i} =~ s/\s+$//; |
$env{'form.ltitools_'.$size.'_'.$i} =~ s/\s+$//; |
Line 11042 sub modify_ltitools {
|
Line 11072 sub modify_ltitools {
|
$resulttext .= '</li><ul>'; |
$resulttext .= '</li><ul>'; |
my $position = $pos + 1; |
my $position = $pos + 1; |
$resulttext .= '<li>'.&mt('Order: [_1]',$position).'</li>'; |
$resulttext .= '<li>'.&mt('Order: [_1]',$position).'</li>'; |
foreach my $item ('version','msgtype','url','lifetime') { |
foreach my $item ('version','msgtype','sigmethod','url','lifetime') { |
if ($confhash{$itemid}{$item} ne '') { |
if ($confhash{$itemid}{$item} ne '') { |
$resulttext .= '<li>'.$lt{$item}.': '.$confhash{$itemid}{$item}.'</li>'; |
$resulttext .= '<li>'.$lt{$item}.': '.$confhash{$itemid}{$item}.'</li>'; |
} |
} |