diff --git a/badges/ajax.php b/badges/ajax.php index 76e8c26581b..0435a6cdc83 100644 --- a/badges/ajax.php +++ b/badges/ajax.php @@ -41,6 +41,8 @@ $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(); diff --git a/badges/assertion.php b/badges/assertion.php index 24b8e603310..df18a0af2a4 100644 --- a/badges/assertion.php +++ b/badges/assertion.php @@ -24,6 +24,8 @@ * @author Yuliya Bozhko */ +define('AJAX_SCRIPT', true); + require_once(dirname(dirname(__FILE__)) . '/config.php'); require_once($CFG->libdir . '/badgeslib.php'); @@ -35,6 +37,5 @@ $hash = required_param('b', PARAM_ALPHANUM); $badge = badges_get_issued_badge_info($hash); -header('Content-type: application/json; charset=utf-8'); - +echo $OUTPUT->header(); echo json_encode($badge); \ No newline at end of file diff --git a/badges/backpackconnect.php b/badges/backpackconnect.php index 55bc2ecf0c8..bbcc78f64d8 100644 --- a/badges/backpackconnect.php +++ b/badges/backpackconnect.php @@ -34,6 +34,7 @@ require_sesskey(); require_login(); $PAGE->set_url('/badges/backpackconnect.php'); $PAGE->set_context(context_system::instance()); +echo $OUTPUT->header(); // Use PHP input filtering as there is no PARAM type for // the type of cleaning that is required (ASCII chars 32-127 only).