MDL-81047 core: Rename standard_head_html_prepend hook

This commit updates the name of the standard_head_html_prepend hook to
meet coding style agreed in MDL-79077.
This commit is contained in:
Andrew Nicols
2024-03-08 23:56:39 +08:00
parent 38a3310c92
commit 0a30867cdf
6 changed files with 12 additions and 15 deletions
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_mobile\local\hooks\output;
namespace tool_mobile\local\hook\output;
/**
* Allows plugins to add any elements to the page <head> html tag
@@ -23,14 +23,13 @@ namespace tool_mobile\local\hooks\output;
* @copyright 2023 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class standard_head_html_prepend {
class before_standard_head_html_generation {
/**
* Callback to add head elements.
*
* @param \core\hook\output\standard_head_html_prepend $hook
* @param \core\hook\output\before_standard_head_html_generation $hook
*/
public static function callback(\core\hook\output\standard_head_html_prepend $hook): void {
public static function callback(\core\hook\output\before_standard_head_html_generation $hook): void {
global $CFG, $PAGE;
// Smart App Banners meta tag is only displayed if mobile services are enabled and configured.
if (!empty($CFG->enablemobilewebservice)) {
@@ -45,7 +44,7 @@ class standard_head_html_prepend {
if (!empty($mobilesettings->androidappid)) {
$mobilemanifesturl = "$CFG->wwwroot/$CFG->admin/tool/mobile/mobile.webmanifest.php";
$hook->add_html('<link rel="manifest" href="'.$mobilemanifesturl.'" />');
$hook->add_html('<link rel="manifest" href="' . $mobilemanifesturl . '" />');
}
}
}
+2 -2
View File
@@ -26,8 +26,8 @@ defined('MOODLE_INTERNAL') || die();
$callbacks = [
[
'hook' => core\hook\output\standard_head_html_prepend::class,
'callback' => 'tool_mobile\local\hooks\output\standard_head_html_prepend::callback',
'hook' => core\hook\output\before_standard_head_html_generation::class,
'callback' => 'tool_mobile\local\hook\output\before_standard_head_html_generation::callback',
'priority' => 0,
],
];
+1 -1
View File
@@ -23,7 +23,7 @@
*/
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2023100900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2024022600; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2023100400; // Requires this Moodle version.
$plugin->component = 'tool_mobile'; // Full name of the plugin (used for diagnostics).
$plugin->dependencies = [