Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Tiny text editor integration - Language Producer.

Copyright: 2021 Andrew Lyons <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 357 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: lang  - X-Ref

An anonymous class to handle loading and serving lang files for TinyMCE.

__construct()   X-Ref
Constructor to load and serve the langfile.


parse_file_information_from_url()   X-Ref
Parse the file information from the URL.


serve_file()   X-Ref
Serve the language pack content.


load_full_moodle()   X-Ref
Load the full Moodle Framework.


is_full_moodle_loaded()   X-Ref
Check whether Moodle is fully loaded.

return: bool

load_language_pack()   X-Ref
Load the language pack strings.

return: string[]

send_cached_pack()   X-Ref
No description

store_lang_file(array $strings)   X-Ref
Store a langauge cache file containing all of the processed strings.

param: string[] $strings The strings to store

is_candidate_file_available()   X-Ref
Check whether the candidate file exists.

return: bool

get_etag()   X-Ref
Get the eTag for the candidate file.

This is a unique hash based on the file arguments.
It does not need to consider the file content because we use a cache busting URL.

return: string The eTag content

send_cached()   X-Ref
Send the candidate file, with aggressive cachign headers.

This includdes eTags, a last-modified, and expiry approximately 90 days in the future.

send_uncached(array $strings)   X-Ref
Sends the content directly without caching it.

param: string[] $strings

send_unmodified_headers($lastmodified)   X-Ref
Send file not modified headers.

param: int $lastmodified

send_not_found(?string $message = null)   X-Ref
Sends a 404 message to indicate that the content was not found.

param: null|string $message An optional informative message to include to help debugging