Skip to content

Commit

Permalink
Merge branch 'MDL-52154-master-wip2' of https://github.com/xow/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Apr 29, 2016
2 parents 4871514 + af9d3a9 commit 5ea0c56
Show file tree
Hide file tree
Showing 55 changed files with 5,170 additions and 153 deletions.
58 changes: 31 additions & 27 deletions mod/lti/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,42 @@
require_capability('moodle/course:manageactivities', $context);
require_capability('mod/lti:addinstance', $context);

if (empty($toolid) && !empty($toolurl)) {
$tool = lti_get_tool_by_url_match($toolurl, $courseid);
if (!empty($toolurl) && lti_is_cartridge($toolurl)) {
$response->cartridge = true;
} else {
if (empty($toolid) && !empty($toolurl)) {
$tool = lti_get_tool_by_url_match($toolurl, $courseid);

if (!empty($tool)) {
$toolid = $tool->id;
if (!empty($tool)) {
$toolid = $tool->id;

$response->toolid = $tool->id;
$response->toolname = s($tool->name);
$response->tooldomain = s($tool->tooldomain);
$response->toolid = $tool->id;
$response->toolname = s($tool->name);
$response->tooldomain = s($tool->tooldomain);
}
} else {
$response->toolid = $toolid;
}
} else {
$response->toolid = $toolid;
}

if (!empty($toolid)) {
// Look up privacy settings.
$query = '
SELECT name, value
FROM {lti_types_config}
WHERE
typeid = :typeid
AND name IN (\'sendname\', \'sendemailaddr\', \'acceptgrades\')
';
if (!empty($toolid)) {
// Look up privacy settings.
$query = '
SELECT name, value
FROM {lti_types_config}
WHERE
typeid = :typeid
AND name IN (\'sendname\', \'sendemailaddr\', \'acceptgrades\')
';

$privacyconfigs = $DB->get_records_sql($query, array('typeid' => $toolid));
$success = count($privacyconfigs) > 0;
foreach ($privacyconfigs as $config) {
$configname = $config->name;
$response->$configname = $config->value;
}
if (!$success) {
$response->error = s(get_string('tool_config_not_found', 'mod_lti'));
$privacyconfigs = $DB->get_records_sql($query, array('typeid' => $toolid));
$success = count($privacyconfigs) > 0;
foreach ($privacyconfigs as $config) {
$configname = $config->name;
$response->$configname = $config->value;
}
if (!$success) {
$response->error = s(get_string('tool_config_not_found', 'mod_lti'));
}
}
}

Expand Down
1 change: 1 addition & 0 deletions mod/lti/amd/build/cartridge_registration_form.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mod/lti/amd/build/events.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mod/lti/amd/build/external_registration.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mod/lti/amd/build/external_registration_return.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mod/lti/amd/build/keys.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
define([],function(){return{ENTER:13,SPACE:32}});
1 change: 1 addition & 0 deletions mod/lti/amd/build/tool_card_controller.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mod/lti/amd/build/tool_configure_controller.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mod/lti/amd/build/tool_proxy.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mod/lti/amd/build/tool_type.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5ea0c56

Please sign in to comment.