Skip to content

Commit f652f35

Browse files
committed
INT-20323: Fix deprected callbacks for EDU plugins
1 parent 96bb6ad commit f652f35

File tree

4 files changed

+65
-10
lines changed

4 files changed

+65
-10
lines changed

classes/hook_callbacks.php

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
// This file is part of Moodle - http://moodle.org/
3+
//
4+
// Moodle is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// Moodle is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16+
17+
/**
18+
* @package local_liquidus
19+
* @author Jonathan Garcia Gomez <[email protected]>
20+
* @copyright Copyright (c) 2024 Open LMS (https://www.openlms.net)
21+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
22+
*/
23+
24+
namespace local_liquidus;
25+
26+
class hook_callbacks {
27+
28+
/**
29+
* @param \core\hook\output\before_footer_html_generation $hook
30+
*/
31+
public static function before_footer_html_generation(\core\hook\output\before_footer_html_generation $hook): void {
32+
injector::get_instance()->inject();
33+
}
34+
}

db/hooks.php

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
// This file is part of Moodle - http://moodle.org/
3+
//
4+
// Moodle is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// Moodle is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16+
17+
/**
18+
* @package local_liquidus
19+
* @author Jonathan Garcia Gomez <[email protected]>
20+
* @copyright Copyright (c) 2024 Open LMS (https://www.openlms.net)
21+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
22+
*/
23+
24+
$callbacks = [
25+
[
26+
'hook' => core\hook\output\before_footer_html_generation::class,
27+
'callback' => [\local_liquidus\hook_callbacks::class, 'before_footer_html_generation'],
28+
'priority' => 0,
29+
],
30+
];

lib.php

-9
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,6 @@
2727

2828
require_once(__DIR__.'/../../config.php');
2929

30-
31-
/**
32-
* Used in Moodle 3.3+ to inject a chunk of JS or CSS into every page.
33-
* Used because this callback does not buffer outputs.
34-
*/
35-
//function local_liquidus_before_footer() { To be reviewed in INT-20323.
36-
// injector::get_instance()->inject();
37-
//}
38-
3930
function local_liquidus_create_consent_log() {
4031
global $USER, $DB;
4132

version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
defined('MOODLE_INTERNAL') || die();
2424
/** @var object $plugin */
25-
$plugin->version = 2024091700; // The current plugin version (Date: YYYYMMDDXX).
25+
$plugin->version = 2024091701; // The current plugin version (Date: YYYYMMDDXX).
2626
$plugin->requires = 2022112800; // Requires this Moodle version.
2727
$plugin->component = 'local_liquidus'; // Full name of the plugin (used for diagnostics).
2828
$plugin->maturity = MATURITY_STABLE;

0 commit comments

Comments
 (0)