Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.
/lib/ -> jslib.php (source)

This file contains various javascript related functions, all functions here are self contained and can be used in ABORT_AFTER_CONFIG scripts.

Copyright: 2012 Petr Skoda (skodak) {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 133 lines (4 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 1 file
 lib/xsendfilelib.php

Defines 5 functions


Functions that are not part of a class:

js_send_cached($jspath, $etag, $filename = 'javascript.php')   X-Ref
Send javascript file content with as much caching as possible

param: string $jspath
param: string $etag
param: string $filename

js_send_uncached($js, $filename = 'javascript.php')   X-Ref
Send javascript without any caching

param: string $js
param: string $filename

js_send_unmodified($lastmodified, $etag)   X-Ref
Send file not modified headers

param: int $lastmodified
param: string $etag

js_write_cache_file_content($file, $content)   X-Ref
Create cache file for JS content

param: string $file full file path to cache file
param: string $content JS code

js_send_css_not_found()   X-Ref
Sends a 404 message about CSS not being found.