c6d4066201
When a site has policies but a user has not logged in, a banner is displayed to inform the guest user of the polciies. This banner was inserted by Javascript at the end of the DOM, so keyboard users had to tab through the whole page to reach it. This commit makes the following changes: * Change the callback used to display the policy banner from _before_standard_html_head to _before_standard_top_of_body_html. * Define the banner's body text in an HTML element, rather than a Javascript parameter. * Set absolute positioning on the banner for behat sites, so it does not display at the top of the page and overlap the site header. * Revert use of the standard_head_html_prepend hook in tool_policy from MDL-79076. The combination of these changes means that the banner will be output near the start of the HTML DOM, so will be accessible to keyboard users early on in the tab order until dismissed. However, it will still appear visually at the end of the page, to avoid clashing with the site header.
30 lines
1.2 KiB
PHP
30 lines
1.2 KiB
PHP
<?php
|
|
// This file is part of Moodle - http://moodle.org/
|
|
//
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
/**
|
|
* Plugin version and other meta-data are defined here.
|
|
*
|
|
* @package tool_policy
|
|
* @copyright 2018 David Mudrák <david@moodle.com>
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
*/
|
|
|
|
defined('MOODLE_INTERNAL') || die();
|
|
|
|
$plugin->version = 2024022000; // The current plugin version (Date: YYYYMMDDXX).
|
|
$plugin->requires = 2023100400; // Requires this Moodle version.
|
|
$plugin->component = 'tool_policy'; // Full name of the plugin (used for diagnostics).
|