mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-56958 ajax: Prefer the general renderer
This commit is contained in:
parent
0b8e0c374f
commit
946281d282
@ -32,6 +32,8 @@ define('AJAX_SCRIPT', true);
|
||||
require_once(__DIR__ . '/../../config.php');
|
||||
require_once($CFG->libdir . '/externallib.php');
|
||||
|
||||
define('PREFERRED_RENDERER_TARGET', RENDERER_TARGET_GENERAL);
|
||||
|
||||
$rawjson = file_get_contents('php://input');
|
||||
|
||||
$requests = json_decode($rawjson, true);
|
||||
|
@ -137,7 +137,9 @@ abstract class renderer_factory_base implements renderer_factory {
|
||||
// If the target hasn't been specified we need to guess the defaults.
|
||||
// We also override the target with the default if the maintenance target has been provided.
|
||||
// This ensures we don't use the maintenance renderer if we are processing a special target.
|
||||
if (CLI_SCRIPT) {
|
||||
if (defined('PREFERRED_RENDERER_TARGET')) {
|
||||
$target = PREFERRED_RENDERER_TARGET;
|
||||
} else if (CLI_SCRIPT) {
|
||||
$target = RENDERER_TARGET_CLI;
|
||||
} else if (AJAX_SCRIPT) {
|
||||
$target = RENDERER_TARGET_AJAX;
|
||||
|
Loading…
x
Reference in New Issue
Block a user