Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | Protected Attributes | List of all members
YUI_config Class Reference

Public Member Functions

 add_group ($name, $config)
 Create a new group within the YUI_config system. More...
 
 add_module_config ($name, $config, $group=null)
 Add configuration for a specific module. More...
 
 add_moodle_metadata ()
 Add the moodle YUI module metadata for the moodle group to the YUI_config instance. More...
 
 define_patched_core_modules ($combobase, $yuiversion, $patchlevel, $patchedmodules)
 Define YUI modules which we have been required to patch between releases. More...
 
 get_config_functions ()
 Retrieve the list of JavaScript functions for YUI_config groups. More...
 
 set_config_function ($function)
 Set the value of a configuration function used by the YUI Loader's pattern testing. More...
 
 set_config_source ($file)
 Allow setting of the config function described in {. More...
 
 update_group ($name, $config)
 Update an existing group configuration. More...
 
 update_header_js ($js)
 Update the header JavaScript with any required modification for the YUI Loader. More...
 

Public Attributes

 $base
 
 $combine
 
 $comboBase
 
 $debug = false
 These settings must be public so that when the object is converted to json they are exposed. More...
 
 $filter = null
 
 $groups = array()
 
 $insertBefore = 'firstthemesheet'
 
 $modules = array()
 

Protected Attributes

array $jsconfigfunctions = array()
 List of functions used by the YUI Loader group pattern recognition.
 

Member Function Documentation

◆ add_group()

YUI_config::add_group (   $name,
  $config 
)

Create a new group within the YUI_config system.

Parameters
String$nameThe name of the group. This must be unique and not previously used.
Array$configThe configuration for this group.
Return values
void

◆ add_module_config()

YUI_config::add_module_config (   $name,
  $config,
  $group = null 
)

Add configuration for a specific module.

Parameters
String$nameThe name of the module to add configuration for.
Array$configThe configuration for the specified module.
String$groupThe name of the group to add configuration for. If not specified, then this module is added to the global configuration.
Return values
void

◆ 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
void

◆ 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
Stringcombobase The local combobase
Stringyuiversion The current YUI version
Intpatchlevel The patch level we're working to for YUI
Arraypatchedmodules An array containing the names of the patched modules
Return values
void

◆ get_config_functions()

YUI_config::get_config_functions ( )

Retrieve the list of JavaScript functions for YUI_config groups.

Return values
StringThe 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
$functionString the body of the JavaScript function. This should be used i
Return values
Stringthe 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
$fileThe path to the JavaScript function used for YUI configuration.
Return values
Stringthe 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$nameThe name of the group. This must be unique and not previously used.
Array$configThe configuration for this group.
Return values
void

◆ update_header_js()

YUI_config::update_header_js (   $js)

Update the header JavaScript with any required modification for the YUI Loader.

Parameters
$jsString The JavaScript to manipulate.
Return values
Stringthe modified JS string.

Member Data Documentation

◆ $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: