}
}
-echo $OUTPUT->header();
-
$data = data_submitted();
if (isset($data->submitbutton) && confirm_sesskey()) {
//Output script to update the calling window.
$script = "
- <script type=\"text/javascript\">
- window.opener.M.mod_lti.editor.updateToolType({$json});
- window.close();
- </script>
+ <html>
+ <script type=\"text/javascript\">
+ window.opener.M.mod_lti.editor.updateToolType({$json});
+ window.close();
+ </script>
+ </html>
";
echo $script;
//Output script to update the calling window.
$script = "
- <script type=\"text/javascript\">
- window.opener.M.mod_lti.editor.addToolType({$json});
- window.close();
- </script>
+ <html>
+ <script type=\"text/javascript\">
+ window.opener.M.mod_lti.editor.addToolType({$json});
+ window.close();
+ </script>
+ </html>
";
echo $script;
}
} else if (isset($data->cancel)) {
$script = "
- <script type=\"text/javascript\">
- window.close();
- </script>
+ <html>
+ <script type=\"text/javascript\">
+ window.close();
+ </script>
+ </html>
";
echo $script;
die;
}
+echo $OUTPUT->header();
+
echo $OUTPUT->heading(get_string('toolsetup', 'lti'));
if ($action == 'add') {
}
var selectedToolType = typeSelector.get('value');
- var selectedOption = typeSelector.one('option[value=' + selectedToolType + ']');
+ var selectedOption = typeSelector.one('option[value="' + selectedToolType + '"]');
- //A specific tool type is selected (not "auto")"
+ //A specific tool type is selected (not "auto")
if(selectedToolType > 0){
//If the entered domain matches the domain of the tool configuration...
var domainRegex = /(?:https?:\/\/)?(?:www\.)?([^\/]+)(?:\/|$)/i;
getSelectedToolTypeOption: function(){
var typeSelector = Y.one('#id_typeid');
- return typeSelector.one('option[value=' + typeSelector.get('value') + ']');
+ return typeSelector.one('option[value="' + typeSelector.get('value') + '"]');
},
/**
//Adding the new tool may affect which tool gets matched automatically
this.clearToolCache();
- this.updateAutomaticToolMatch();
+ this.updateAutomaticToolMatch(Y.one('#id_toolurl'));
+ this.updateAutomaticToolMatch(Y.one('#id_securetoolurl'));
},
updateToolType: function(toolType){
var typeSelector = Y.one('#id_typeid');
- var option = typeSelector.one('option[value=' + toolType.id + ']');
+ var option = typeSelector.one('option[value="' + toolType.id + '"]');
option.set('text', toolType.name)
.set('domain', toolType.tooldomain);
//Editing the tool may affect which tool gets matched automatically
this.clearToolCache();
- this.updateAutomaticToolMatch();
+ this.updateAutomaticToolMatch(Y.one('#id_toolurl'));
+ this.updateAutomaticToolMatch(Y.one('#id_securetoolurl'));
},
deleteTool: function(toolTypeId){
//Editing the tool may affect which tool gets matched automatically
self.clearToolCache();
- self.updateAutomaticToolMatch();
+ self.updateAutomaticToolMatch(Y.one('#id_toolurl'));
+ self.updateAutomaticToolMatch(Y.one('#id_securetoolurl'));
},
failure: function(){