# f-acedo/moodle-theme_accessible architecture

> Architecture diagram of the GitHub repository f-acedo/moodle-theme_accessible, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/f-acedo/moodle-theme_accessible
- Repository: https://github.com/f-acedo/moodle-theme_accessible

## Overview

Accessible is a Moodle Boost-based theme focused on blind, low-vision, and colour-blind users. The main workflow is choosing accessibility options, saving them as account preferences or a visitor cookie, and applying the choices to Moodle’s rendered pages. Separate capabilities include administrator defaults and information, a configuration status check, privacy export, and a user guide. Some subsystem paths and links are supported only by the README; unsampled implementation details are not inferred as verified calls.

Main entry points: [`classes/preferences.php`](https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/preferences.php) (Preference handling), [`preferences.php`](https://github.com/f-acedo/moodle-theme_accessible/blob/main/preferences.php) (Options page), [`templates`](https://github.com/f-acedo/moodle-theme_accessible/tree/main/templates) (Theme templates), [`layout/drawers.php`](https://github.com/f-acedo/moodle-theme_accessible/blob/main/layout/drawers.php) (Page layouts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_preferences["User preferences"]
  node_options_page["Options page<br/>[preferences.php]"]
  node_options_form["Options form"]
  node_preference_logic["Preference handling<br/>[preferences.php]"]
  node_account_store[("Account preferences")]
  node_visitor_cookie[("Visitor cookie")]
end

subgraph group_presentation["Accessible presentation"]
  node_theme_layout["Page layouts<br/>[drawers.php]"]
  node_login_layout["Login layout<br/>[login.php]"]
  node_theme_templates["Theme templates"]
  node_theme_styles["Accessibility styling<br/>[styles.scss]"]
  node_browser_behaviour["Browser enhancements<br/>[accessible.js]"]
  node_renderer["Core renderer<br/>[core_renderer.php]"]
end

subgraph group_administration["Administration"]
  node_admin_settings["Theme settings<br/>[settings.php]"]
  node_admin_information["Information tab<br/>[about.php]"]
  node_information_content["Information content<br/>[about.php]"]
  node_status_check["User-theme check<br/>[userthemes.php]"]
  node_theme_hooks["Theme callbacks<br/>[hook_callbacks.php]"]
  node_login_events["Login events<br/>[events.php]"]
end

subgraph group_support["Privacy and guidance"]
  node_privacy_provider["Privacy export<br/>[provider.php]"]
  node_guide_page["Guide page<br/>[guide.php]"]
  node_guide_content["Guide content<br/>[guide.php]"]
end

node_user(("Moodle user"))

node_user -->|"opens options"| node_options_page
node_options_page -->|"renders form"| node_options_form
node_options_page -->|"saves choices"| node_preference_logic
node_options_form -->|"defines choices"| node_preference_logic
node_preference_logic -->|"stores account choices"| node_account_store
node_preference_logic -->|"stores visitor choices"| node_visitor_cookie
node_theme_layout -->|"applies body settings"| node_preference_logic
node_theme_layout -->|"renders layout"| node_theme_templates
node_login_layout -.->|"renders login"| node_theme_templates
node_theme_styles -.->|"styles accessible pages"| node_user
node_browser_behaviour -.->|"enhances navigation"| node_user
node_renderer -.->|"supports rendering"| node_theme_templates
node_admin_settings -->|"includes tab"| node_admin_information
node_admin_information -->|"renders information"| node_information_content
node_theme_hooks -->|"registers check"| node_status_check
node_login_events -->|"dispatches callbacks"| node_theme_hooks
node_privacy_provider -->|"exports preferences"| node_preference_logic
node_user -->|"opens guide"| node_guide_page
node_guide_page -.->|"loads guide"| node_guide_content

click node_options_page "https://github.com/f-acedo/moodle-theme_accessible/blob/main/preferences.php"
click node_options_form "https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/form/preferences_form.php"
click node_preference_logic "https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/preferences.php"
click node_theme_layout "https://github.com/f-acedo/moodle-theme_accessible/blob/main/layout/drawers.php"
click node_login_layout "https://github.com/f-acedo/moodle-theme_accessible/blob/main/layout/login.php"
click node_theme_templates "https://github.com/f-acedo/moodle-theme_accessible/tree/main/templates"
click node_theme_styles "https://github.com/f-acedo/moodle-theme_accessible/blob/main/scss/styles.scss"
click node_browser_behaviour "https://github.com/f-acedo/moodle-theme_accessible/blob/main/javascript/accessible.js"
click node_renderer "https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/output/core_renderer.php"
click node_admin_settings "https://github.com/f-acedo/moodle-theme_accessible/blob/main/settings.php"
click node_admin_information "https://github.com/f-acedo/moodle-theme_accessible/blob/main/settings/about.php"
click node_information_content "https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/about.php"
click node_status_check "https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/check/userthemes.php"
click node_theme_hooks "https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/hook_callbacks.php"
click node_login_events "https://github.com/f-acedo/moodle-theme_accessible/blob/main/db/events.php"
click node_privacy_provider "https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/privacy/provider.php"
click node_guide_page "https://github.com/f-acedo/moodle-theme_accessible/blob/main/guide.php"
click node_guide_content "https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/guide.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_options_page,node_options_form,node_preference_logic,node_account_store,node_visitor_cookie,node_user toneBlue
class node_theme_layout,node_login_layout,node_theme_templates,node_theme_styles,node_browser_behaviour,node_renderer toneAmber
class node_admin_settings,node_admin_information,node_information_content,node_status_check,node_theme_hooks,node_login_events toneMint
class node_privacy_provider,node_guide_page,node_guide_content toneRose
```

## Components

### User preferences

- [Options page](https://github.com/f-acedo/moodle-theme_accessible/blob/main/preferences.php): `preferences.php`
- [Options form](https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/form/preferences_form.php): `classes/form/preferences_form.php`
- [Preference handling](https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/preferences.php): `classes/preferences.php`
- **Account preferences**
- **Visitor cookie**

### Accessible presentation

- [Page layouts](https://github.com/f-acedo/moodle-theme_accessible/blob/main/layout/drawers.php): `layout/drawers.php`
- [Login layout](https://github.com/f-acedo/moodle-theme_accessible/blob/main/layout/login.php): `layout/login.php`
- [Theme templates](https://github.com/f-acedo/moodle-theme_accessible/tree/main/templates): `templates`
- [Accessibility styling](https://github.com/f-acedo/moodle-theme_accessible/blob/main/scss/styles.scss): `scss/styles.scss`
- [Browser enhancements](https://github.com/f-acedo/moodle-theme_accessible/blob/main/javascript/accessible.js): `javascript/accessible.js`
- [Core renderer](https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/output/core_renderer.php): `classes/output/core_renderer.php`

### Administration

- [Theme settings](https://github.com/f-acedo/moodle-theme_accessible/blob/main/settings.php): `settings.php`
- [Information tab](https://github.com/f-acedo/moodle-theme_accessible/blob/main/settings/about.php): `settings/about.php`
- [Information content](https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/about.php): `classes/about.php`
- [User-theme check](https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/check/userthemes.php): `classes/check/userthemes.php`
- [Theme callbacks](https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/hook_callbacks.php): `classes/hook_callbacks.php`
- [Login events](https://github.com/f-acedo/moodle-theme_accessible/blob/main/db/events.php): `db/events.php`

### Privacy and guidance

- [Privacy export](https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/privacy/provider.php): `classes/privacy/provider.php`
- [Guide page](https://github.com/f-acedo/moodle-theme_accessible/blob/main/guide.php): `guide.php`
- [Guide content](https://github.com/f-acedo/moodle-theme_accessible/blob/main/classes/guide.php): `classes/guide.php`

### Other components

- **Moodle user**

## Connections

- Moodle user → Options page: opens options (evidence: `README.md`)
- Options page → Options form: renders form (evidence: `preferences.php`)
- Options page → Preference handling: saves choices (evidence: `preferences.php`)
- Options form → Preference handling: defines choices (evidence: `classes/form/preferences_form.php`)
- Preference handling → Account preferences: stores account choices (evidence: `classes/preferences.php`)
- Preference handling → Visitor cookie: stores visitor choices (evidence: `classes/preferences.php`)
- Page layouts → Preference handling: applies body settings (evidence: `layout/drawers.php`)
- Page layouts → Theme templates: renders layout (evidence: `layout/drawers.php`)
- Login layout → Theme templates: renders login
- Accessibility styling → Moodle user: styles accessible pages
- Browser enhancements → Moodle user: enhances navigation
- Core renderer → Theme templates: supports rendering
- Theme settings → Information tab: includes tab (evidence: `settings.php`)
- Information tab → Information content: renders information (evidence: `settings/about.php`)
- Theme callbacks → User-theme check: registers check
- Login events → Theme callbacks: dispatches callbacks (evidence: `db/events.php`)
- Privacy export → Preference handling: exports preferences (evidence: `classes/privacy/provider.php`)
- Moodle user → Guide page: opens guide (evidence: `README.md`)
- Guide page → Guide content: loads guide
