MDL-80468 tool_mfa: Allow loading factor defined externalpages correctly

This commit is contained in:
Benjamin Walker
2025-01-10 21:14:50 +10:00
parent a843eab495
commit 59591eb4b0
14 changed files with 284 additions and 257 deletions
+5 -3
View File
@@ -256,6 +256,10 @@ class factor extends \core\plugininfo\base {
* @param bool $hassiteconfig whether the current user has moodle/site:config capability
*/
public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig): void {
global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them.
/** @var \admin_root $ADMIN */
$ADMIN = $adminroot; // May be used in settings.php.
$plugininfo = $this; // Also can be used inside settings.php.
if (!$this->is_installed_and_upgraded()) {
return;
@@ -269,9 +273,7 @@ class factor extends \core\plugininfo\base {
$settings = new \admin_settingpage($section, $this->displayname, 'moodle/site:config', $this->is_enabled() === false);
if ($adminroot->fulltree) {
include($this->full_path('settings.php'));
}
include($this->full_path('settings.php'));
$adminroot->add($parentnodename, $settings);
}