|
|
|
|
@ -30,24 +30,36 @@ if ($baseTool && !$baseTool->isGlobal()) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$form = new FormValidator('ims_lti_add_tool'); |
|
|
|
|
$form->addHeader($plugin->get_lang('ToolSettings')); |
|
|
|
|
|
|
|
|
|
if ($baseTool) { |
|
|
|
|
$form->addHtml('<p class="lead">'.Security::remove_XSS($baseTool->getDescription()).'</p>'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$form->addText('name', get_lang('Title')); |
|
|
|
|
$form->addTextarea('description', get_lang('Description'), ['rows' => 10]); |
|
|
|
|
|
|
|
|
|
if (!$baseTool) { |
|
|
|
|
$form->addElement('url', 'url', $plugin->get_lang('LaunchUrl')); |
|
|
|
|
$form->addText('consumer_key', $plugin->get_lang('ConsumerKey'), true); |
|
|
|
|
$form->addText('shared_secret', $plugin->get_lang('SharedSecret'), true); |
|
|
|
|
$form->addTextarea('custom_params', $plugin->get_lang('CustomParams')); |
|
|
|
|
$form->addRule('url', get_lang('Required'), 'required'); |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$form->addButtonAdvancedSettings('lti_adv'); |
|
|
|
|
$form->addHtml('<div id="lti_adv_options" style="display:none;">'); |
|
|
|
|
$form->addTextarea('description', get_lang('Description'), ['rows' => 3]); |
|
|
|
|
|
|
|
|
|
if (!$baseTool) { |
|
|
|
|
$form->addTextarea('custom_params', [$plugin->get_lang('CustomParams'), $plugin->get_lang('CustomParamsHelp')]); |
|
|
|
|
$form->addCheckBox('deep_linking', $plugin->get_lang('SupportDeepLinking'), get_lang('Yes')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($baseTool) { |
|
|
|
|
$form->addHidden('type', $baseTool->getId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$form->addHtml('</div>'); |
|
|
|
|
|
|
|
|
|
$form->addButtonCreate($plugin->get_lang('AddExternalTool')); |
|
|
|
|
|
|
|
|
|
if ($form->validate()) { |
|
|
|
|
@ -93,5 +105,11 @@ $template->assign('form', $form->returnForm()); |
|
|
|
|
|
|
|
|
|
$content = $template->fetch('ims_lti/view/add.tpl'); |
|
|
|
|
|
|
|
|
|
$actions = Display::url( |
|
|
|
|
Display::return_icon('add.png', $plugin->get_lang('AddExternalTool'), [], ICON_SIZE_MEDIUM), |
|
|
|
|
api_get_self().'?'.api_get_cidreq() |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$template->assign('actions', Display::toolbarAction('lti_toolbar', [$actions])); |
|
|
|
|
$template->assign('content', $content); |
|
|
|
|
$template->display_one_col_template(); |
|
|
|
|
|