|
|
|
|
@ -57,11 +57,33 @@ class FrmEdit extends FormValidator |
|
|
|
|
|
|
|
|
|
$this->addText('name', get_lang('Name')); |
|
|
|
|
$this->addTextarea('description', get_lang('Description')); |
|
|
|
|
$this->addRadio( |
|
|
|
|
'version', |
|
|
|
|
$plugin->get_lang('LtiVersion'), |
|
|
|
|
[ |
|
|
|
|
ImsLti::V_1P1 => 'LTI 1.0 / 1.1', |
|
|
|
|
ImsLti::V_1P3 => 'LTI 1.3.0', |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
|
$this->freeze(['version']); |
|
|
|
|
|
|
|
|
|
if (null === $parent) { |
|
|
|
|
$this->addUrl('launch_url', $plugin->get_lang('LaunchUrl'), true); |
|
|
|
|
$this->addText('consumer_key', $plugin->get_lang('ConsumerKey'), false); |
|
|
|
|
$this->addText('shared_secret', $plugin->get_lang('SharedSecret'), false); |
|
|
|
|
if ($this->tool->getVersion() === ImsLti::V_1P1) { |
|
|
|
|
$this->addText('consumer_key', $plugin->get_lang('ConsumerKey'), false); |
|
|
|
|
$this->addText('shared_secret', $plugin->get_lang('SharedSecret'), false); |
|
|
|
|
} elseif ($this->tool->getVersion() === ImsLti::V_1P3) { |
|
|
|
|
$this->addText('client_id', $plugin->get_lang('ClientId'), true); |
|
|
|
|
$this->freeze(['client_id']); |
|
|
|
|
$this->addTextarea( |
|
|
|
|
'public_key', |
|
|
|
|
$plugin->get_lang('PublicKey'), |
|
|
|
|
['style' => 'font-family: monospace;', 'rows' => 5], |
|
|
|
|
true |
|
|
|
|
); |
|
|
|
|
$this->addUrl('login_url', $plugin->get_lang('LoginUrl')); |
|
|
|
|
$this->addUrl('redirect_url', $plugin->get_lang('RedirectUrl')); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$this->addButtonAdvancedSettings('lti_adv'); |
|
|
|
|
@ -81,6 +103,18 @@ class FrmEdit extends FormValidator |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (null === $parent && $this->tool->getVersion() === ImsLti::V_1P3) { |
|
|
|
|
$this->addRadio( |
|
|
|
|
'1p3_ags', |
|
|
|
|
$plugin->get_lang('AssigmentAndGradesService'), |
|
|
|
|
[ |
|
|
|
|
LtiAssignmentGradesService::AGS_NONE => $plugin->get_lang('DontUseService'), |
|
|
|
|
LtiAssignmentGradesService::AGS_SIMPLE => $plugin->get_lang('AGServiceSimple'), |
|
|
|
|
LtiAssignmentGradesService::AGS_FULL => $plugin->get_lang('AGServiceFull'), |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$this->addHtml('</div>'); |
|
|
|
|
$this->addButtonAdvancedSettings('lti_privacy', get_lang('Privacy')); |
|
|
|
|
$this->addHtml('<div id="lti_privacy_options" style="display:none;">'); |
|
|
|
|
@ -96,6 +130,8 @@ class FrmEdit extends FormValidator |
|
|
|
|
|
|
|
|
|
public function setDefaultValues() |
|
|
|
|
{ |
|
|
|
|
$advServices = $this->tool->getAdvantageServices(); |
|
|
|
|
|
|
|
|
|
$this->setDefaults( |
|
|
|
|
[ |
|
|
|
|
'name' => $this->tool->getName(), |
|
|
|
|
@ -108,6 +144,12 @@ class FrmEdit extends FormValidator |
|
|
|
|
'share_name' => $this->tool->isSharingName(), |
|
|
|
|
'share_email' => $this->tool->isSharingEmail(), |
|
|
|
|
'share_picture' => $this->tool->isSharingPicture(), |
|
|
|
|
'version' => $this->tool->getVersion(), |
|
|
|
|
'client_id' => $this->tool->getClientId(), |
|
|
|
|
'public_key' => $this->tool->publicKey, |
|
|
|
|
'login_url' => $this->tool->getLoginUrl(), |
|
|
|
|
'redirect_url' => $this->tool->getRedirectUrl(), |
|
|
|
|
'1p3_ags' => $advServices['ags'] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|