This class represents the YUI configuration.
More...
|
| $base |
|
| $combine |
|
| $comboBase |
|
| $debug = false |
| These settings must be public so that when the object is converted to json they are exposed.
|
|
| $filter = null |
|
| $groups = array() |
|
| $insertBefore = 'firstthemesheet' |
|
array | $logExclude = [] |
| Tog sources that should be logged.
|
|
array | $logInclude = [] |
| The log sources that should be not be logged.
|
|
string | $logLevel |
| The minimum log level for YUI logging statements.
|
|
| $modules = array() |
|
|
array | $jsconfigfunctions = array() |
| List of functions used by the YUI Loader group pattern recognition.
|
|
This class represents the YUI configuration.
- Copyright
- 2013 Andrew Nicols
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- Since
- Moodle 2.5
◆ add_group()
YUI_config::add_group |
( |
| $name, |
|
|
| $config ) |
Create a new group within the YUI_config system.
- Parameters
-
String | $name | The name of the group. This must be unique and not previously used. |
Array | $config | The configuration for this group. |
- Return values
-
◆ add_module_config()
YUI_config::add_module_config |
( |
| $name, |
|
|
| $config, |
|
|
| $group = null ) |
Add configuration for a specific module.
- Parameters
-
String | $name | The name of the module to add configuration for. |
Array | $config | The configuration for the specified module. |
String | $group | The name of the group to add configuration for. If not specified, then this module is added to the global configuration. |
- Return values
-
◆ add_moodle_metadata()
YUI_config::add_moodle_metadata |
( |
| ) |
|
Add the moodle YUI module metadata for the moodle group to the YUI_config instance.
If js caching is disabled, metadata will not be served causing YUI to calculate module dependencies as each module is loaded.
If metadata does not exist it will be created and stored in a MUC entry.
- Return values
-
◆ define_patched_core_modules()
YUI_config::define_patched_core_modules |
( |
| $combobase, |
|
|
| $yuiversion, |
|
|
| $patchlevel, |
|
|
| $patchedmodules ) |
Define YUI modules which we have been required to patch between releases.
We must do this because we aggressively cache content on the browser, and we must also override use of the external CDN which will serve the true authoritative copy of the code without our patches.
- Parameters
-
String | combobase The local combobase |
String | yuiversion The current YUI version |
Int | patchlevel The patch level we're working to for YUI |
Array | patchedmodules An array containing the names of the patched modules |
- Return values
-
◆ get_config_functions()
YUI_config::get_config_functions |
( |
| ) |
|
Retrieve the list of JavaScript functions for YUI_config groups.
- Return values
-
String | The complete set of config functions |
◆ set_config_function()
YUI_config::set_config_function |
( |
| $function | ) |
|
Set the value of a configuration function used by the YUI Loader's pattern testing.
Only the body of the function should be passed, and not the whole function wrapper.
The JS function your write will be passed a single argument 'name' containing the name of the module being loaded.
- Parameters
-
$function | String the body of the JavaScript function. This should be used i |
- Return values
-
String | the name of the function to use in the group pattern configuration. |
◆ set_config_source()
YUI_config::set_config_source |
( |
| $file | ) |
|
Allow setting of the config function described in {.
- See also
- set_config_function} from a file. The contents of this file are then passed to set_config_function.
When jsrev is positive, the function is minified and stored in a MUC cache for subsequent uses.
- Parameters
-
$file | The path to the JavaScript function used for YUI configuration. |
- Return values
-
String | the name of the function to use in the group pattern configuration. |
◆ update_group()
YUI_config::update_group |
( |
| $name, |
|
|
| $config ) |
Update an existing group configuration.
Note, any existing configuration for that group will be wiped out. This includes module configuration.
- Parameters
-
String | $name | The name of the group. This must be unique and not previously used. |
Array | $config | The configuration for this group. |
- Return values
-
◆ update_header_js()
YUI_config::update_header_js |
( |
| $js | ) |
|
Update the header JavaScript with any required modification for the YUI Loader.
- Parameters
-
$js | String The JavaScript to manipulate. |
- Return values
-
String | the modified JS string. |
◆ $debug
YUI_config::$debug = false |
These settings must be public so that when the object is converted to json they are exposed.
Note: Some of these are camelCase because YUI uses camelCase variable names.
The settings are described and documented in the YUI API at:
The documentation for this class was generated from the following file:
- lib/outputrequirementslib.php