mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
Merge branch 'MDL-78012' of https://github.com/paulholden/moodle
This commit is contained in:
commit
e82aed72e6
@ -1,48 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Sends request to check web site availability.
|
||||
*
|
||||
* @package core
|
||||
* @subpackage badges
|
||||
* @copyright 2013 onwards Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @author Yuliya Bozhko <yuliya.bozhko@totaralms.com>
|
||||
*/
|
||||
|
||||
define('AJAX_SCRIPT', true);
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once($CFG->libdir . '/badgeslib.php');
|
||||
|
||||
require_login();
|
||||
$PAGE->set_url('/badges/ajax.php');
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
// Unlock session during potentially long curl request.
|
||||
\core\session\manager::write_close();
|
||||
|
||||
$result = badges_check_backpack_accessibility();
|
||||
|
||||
$outcome = new stdClass();
|
||||
$outcome->code = $result;
|
||||
$outcome->response = get_string('error:backpacknotavailable', 'badges') . $OUTPUT->help_icon('backpackavailability', 'badges');
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo json_encode($outcome);
|
||||
|
||||
die();
|
@ -1,5 +1,13 @@
|
||||
This files describes API changes in /badges/*,
|
||||
information provided here is intended especially for developers.
|
||||
|
||||
=== 4.3 ===
|
||||
* The following, deprecated since 3.11, have been removed and can no longer be used:
|
||||
- `badges/ajax.js`
|
||||
- `badges_check_backpack_accessibility`
|
||||
- `badges_setup_backpack_js`
|
||||
- `badges_local_backpack_js`
|
||||
|
||||
=== 4.0 ===
|
||||
* Function print_badge_tabs has been deprecated in favour of manage_badge_action_bar instead
|
||||
|
||||
|
@ -632,20 +632,6 @@ function badges_download($userid) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if badges can be pushed to external backpack.
|
||||
*
|
||||
* @deprecated Since Moodle 3.11.
|
||||
* @return string Code of backpack accessibility status.
|
||||
*/
|
||||
function badges_check_backpack_accessibility() {
|
||||
// This method was used for OBv1.0. It can be deprecated because OBv1.0 support will be removed.
|
||||
// When this method will be removed, badges/ajax.php can be removed too (if it keeps containing only a call to it).
|
||||
debugging('badges_check_backpack_accessibility() can not be used any more, it was only used for OBv1.0', DEBUG_DEVELOPER);
|
||||
|
||||
return 'curl-request-timeout';
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if user has external backpack connected.
|
||||
*
|
||||
@ -687,30 +673,6 @@ function badges_handle_course_deletion($courseid) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads JS files required for backpack support.
|
||||
*
|
||||
* @deprecated Since Moodle 3.11.
|
||||
* @return void
|
||||
*/
|
||||
function badges_setup_backpack_js() {
|
||||
// This method was used for OBv1.0. It can be deprecated because OBv1.0 support will be removed.
|
||||
debugging('badges_setup_backpack_js() can not be used any more, it was only used for OBv1.0.', DEBUG_DEVELOPER);
|
||||
}
|
||||
|
||||
/**
|
||||
* No js files are required for backpack support.
|
||||
* This only exists to directly support the custom V1 backpack api.
|
||||
*
|
||||
* @deprecated Since Moodle 3.11.
|
||||
* @param boolean $checksite Call check site function.
|
||||
* @return void
|
||||
*/
|
||||
function badges_local_backpack_js($checksite = false) {
|
||||
// This method was used for OBv1.0. It can be deprecated because OBv1.0 support will be removed.
|
||||
debugging('badges_local_backpack_js() can not be used any more, it was only used for OBv1.0.', DEBUG_DEVELOPER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the site backpack with this data.
|
||||
*
|
||||
|
@ -3230,6 +3230,27 @@ function serialise_tool_proxy() {
|
||||
throw new coding_exception('serialise_tool_proxy has been removed.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Since Moodle 3.11.
|
||||
*/
|
||||
function badges_check_backpack_accessibility() {
|
||||
throw new coding_exception('badges_check_backpack_accessibility() can not be used any more, it was only used for OBv1.0');
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Since Moodle 3.11.
|
||||
*/
|
||||
function badges_setup_backpack_js() {
|
||||
throw new coding_exception('badges_setup_backpack_js() can not be used any more, it was only used for OBv1.0');
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Since Moodle 3.11.
|
||||
*/
|
||||
function badges_local_backpack_js() {
|
||||
throw new coding_exception('badges_local_backpack_js() can not be used any more, it was only used for OBv1.0');
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if current user is shown any extra fields when listing users.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user