Moodle Plugins directory: Dyslexia | Moodle.org
Dyslexia
Local plugins ::: local_dyslexia
Maintained by
Astor Bizard
This plugin adds a user preference to use Dyslexia mode.
Dyslexia mode is meant to improve readability for dyslexic users.
Latest release:
129 sites
57 downloads
7 fans
Current versions available: 2
Dyslexia mode
This plugin adds a user preference to use Dyslexia mode.
Dyslexia mode is meant to improve readability and accessibility for dyslexic users.
It will change the font throughout the site to OpenDyslexic, or to another font (currently supported fonts: OpenDyslexic, Comic Sans). It will also increase letter and word spacing.
Each user can enable or disable it on their preferences page.
Please feel free to submit any feedback or suggestions for improvement in the comment section below!
About
This software was developped with the Caseine project, with the support of Université Grenoble Alpes.
Useful links
Contributors
Astor Bizard (Lead maintainer)
Please login to view contributors details and/or to contact them
# Deprecation Warning: Migration to New Hook System in Moodle
## Problem:
The function `before_standard_html_head` used in the `local_dyslexia` plugin is deprecated.
This causes the following debugging message in recent Moodle versions:
```
Callback before_standard_html_head in local_dyslexia component should be migrated to new hook callback for core\hook\output\before_standard_head_html_generation.
```
## Root Cause:
Moodle now uses a hook-based system for functionality previously implemented via callbacks. The plugin needs to migrate to the `core\hook\output\before_standard_head_html_generation` hook.
## Proposed Solution:
1. Replace the `before_standard_html_head` function with the new hook-based implementation:
- Create a class in `local/dyslexia/classes/hook/output/before_standard_head_html_generation.php`.
- Implement the `core\output\before_standard_head_html_generation` interface.
2. Example:
```php
namespace local_dyslexia\hook\output;
use core\output\before_standard_head_html_generation;
class before_standard_head_html_generation implements before_standard_head_html_generation {
public static function execute($page) {
// Custom logic here
$page->requires->js_call_amd('local_dyslexia/custom_script', 'init');
}
}
```
## Impact:
Migrating to the new hook system ensures compatibility with current and future Moodle versions, removing debugging warnings and maintaining best practices.
## Testing:
1. Validate in environments running Moodle 4.0+.
2. Confirm functionality across different themes, including Boost Union.
3. Ensure no regression occurs in features that rely on this callback.
Thank you for pointing this out.
However, please note that a lot of the information you provide is highly incorrect and error-prone:
- "before_standard_head_html_generation" is **not** an interface.
- This hook was introduced in Moodle 4.4, so adressing this issue has to differentiate versions 4.0-4.3 and 4.4+.
I will release an update with appropriate modifications.
Best regards,
Astor
Any requirements we might be missing or thoughts on what the issue might be?
I am sorry that you are having this issue. I do not see any reason for this problem to occur (and I have it tested on 4.1 so it should not be a version problem).
Just to be clear, are you truly looking at the page at "/user/preferences.php"?
Feel free to DM me about this.
Best regards,
Astor