Moodle  2.2.1
http://www.collinsharper.com
YAHOO_util_Loader Class Reference

Public Member Functions

 YAHOO_util_Loader ($yuiVersion, $cacheKey=null, $modules=null, $noYUI=false)
 updateCache ()
 load ()
 setProcessedModuleType ($moduleType='ALL')
 hasProcessedModuleType ($moduleType='ALL')
 setLoaded ()
 skinSetup ($name)
 parseSkin ($moduleName)
 formatSkin ($skin, $moduleName)
 loadSingle ($name)
 script ()
 css ()
 tags ($moduleType=null, $skipSort=false)
 script_embed ()
 css_embed ()
 embed ($moduleType=null, $skipSort=false)
 script_data ()
 css_data ()
 data ($moduleType=null, $allowRollups=false, $skipSort=false)
 script_json ()
 css_json ()
 json ($moduleType=null, $allowRollups=false, $skipSort=false, $full=false)
 script_raw ()
 css_raw ()
 raw ($moduleType=null, $allowRollups=false, $skipSort=false)
 log ($msg)
 accountFor ($name)
 prune ($deps, $moduleType)
 getSuperceded ($name)
 getAllDependencies ($mname, $loadOptional=false, $completed=array())
 getGlobalDependencies ()
 moduleSatisfies ($satisfied, $satisfier)
 overrideBase ($base, $modules)
 listSatisfies ($satisfied, $moduleList)
 checkThreshold ($module, $moduleList)
 sortDependencies ($moduleType, $skipSort=false)
 mapSatisfyingModule ($satisfied, $satisfier)
 processDependencies ($outputType, $moduleType, $skipSort=false, $showLoaded=false)
 getUrl ($name)
 getRemoteContent ($url)
 getRaw ($name)
 getContent ($name, $type)
 getLink ($name, $type)
 getComboLink ($type)
 clearComboLink ($type)
 addToCombo ($name, $type)
 canJSON ()
 getProvides ($name)
 getLoadedModules ()
 getLoadedModulesAsJSON ()

Data Fields

 $base = ""
 $filter = ""
 $filters = array()
 $filterList = null
 $allowRollups = true
 $loadOptional = false
 $rollupsToTop = false
 $processedModuleTypes = array()
 $requests = array()
 $loaded = array()
 $superceded = array()
 $undefined = array()
 $dirty = true
 $sorted = null
 $accountedFor = array()
 $skins = array()
 $modules = array()
 $fullCacheKey = null
 $baseOverrides = array()
 $cacheFound = false
 $delayCache = false
 $version = null
 $versionKey = "_yuiversion"
 $skin = array()
 $rollupModules = array()
 $globalModules = array()
 $satisfactionMap = array()
 $depCache = array()
 $combine = false
 $comboBase = "http://yui.yahooapis.com/combo?"
 $cssComboLocation = null
 $jsComboLocation = null

Detailed Description

The YUI PHP loader base class which provides dynamic server-side loading for YUI

Definition at line 59 of file loader.php.


Member Function Documentation

accountFor ( name)

Markes a module as being accounted for. Used in dependency testing. accountFor

Parameters:
{string}name Module to mark as being accounted for

Definition at line 796 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

addToCombo ( name,
type 
)

Adds a module the combo collection for a specified resource type addToCombo

Parameters:
{string}name The module name to add
{string}type Resource type (i.e.) YUI_JS or YUI_CSS

Definition at line 1563 of file loader.php.

Here is the caller graph for this function:

canJSON ( )

Detects if environment supports JSON encode/decode canJSON

Returns:
boolean

Definition at line 1589 of file loader.php.

Here is the caller graph for this function:

checkThreshold ( module,
moduleList 
)

Determine if rollup replacement threshold has been met checkThreshold

Parameters:
{string}Module name
{array}moduleList List of modules names
Returns:
{boolean}

Definition at line 1029 of file loader.php.

Here is the caller graph for this function:

clearComboLink ( type)

Clears the combo url of already loaded modules for a specific resource type. Prevents duplicate loading of modules if the page makes multiple calls to tags, css, or script. clearComboLink

Parameters:
{string}type Resource type (i.e.) YUI_JS or YUI_CSS

Definition at line 1546 of file loader.php.

Here is the caller graph for this function:

css ( )

Used to output each of the required link tags css

Returns:
{string}

Definition at line 630 of file loader.php.

Here is the call graph for this function:

css_data ( )

Used to fetch an array of the required CSS components css_data

Returns:
{array} Returns an array of data about each of the identified JavaScript components

Definition at line 688 of file loader.php.

Here is the call graph for this function:

css_embed ( )

Used to embed the raw CSS css_embed

Returns:
{string} (e.g.) Returns the style tag(s) with the CSS inline

Definition at line 659 of file loader.php.

Here is the call graph for this function:

css_json ( )

Used to fetch a JSON object with the required CSS components css_json

Returns:
{string} Returns a JSON object containing urls for each CSS component

Definition at line 724 of file loader.php.

Here is the call graph for this function:

css_raw ( )

Used to produce the raw CSS code inline without the actual style tags css_raw

Returns:
{string} Returns the raw CSS code inline without the actual style tags

Definition at line 766 of file loader.php.

Here is the call graph for this function:

data ( moduleType = null,
allowRollups = false,
skipSort = false 
)

Used to output an Array which contains data about the required JavaScript & CSS components data

Parameters:
{string}moduleType Type of html tag to return (i.e.) js or css. Default is both.
{boolean}allowRollups
{boolean}skipSort
Returns:
{string}

Definition at line 700 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

embed ( moduleType = null,
skipSort = false 
)

Used to output each of the required html tags inline (i.e.) script and/or style embed

Parameters:
{string}moduleType Type of html tag to return (i.e.) js or css. Default is both.
{boolean}skipSort
Returns:
{string} Returns the style tag(s) with the CSS inline and/or the script tag(s) with the JavaScript inline

Definition at line 670 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

formatSkin ( skin,
moduleName 
)

Add prefix to module skin formatSkin

Parameters:
string$skinthe skin name
string$moduleNamethe name of a module
Returns:
{string} prefixed skin name

Definition at line 576 of file loader.php.

Here is the caller graph for this function:

getAllDependencies ( mname,
loadOptional = false,
completed = array() 
)

Identify dependencies for a give module name getAllDependencies

Parameters:
{string}mname Module name
{boolean}loadOptional Load optional dependencies
{array}completed
Returns:
{array}

Definition at line 873 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getComboLink ( type)

Retrieves the combo link or script include for the currently loaded modules of a specific resource type getComboLink

Parameters:
{string}type Resource type (i.e.) YUI_JS or YUI_CSS
Returns:
{string} link or script include

Definition at line 1507 of file loader.php.

Here is the caller graph for this function:

getContent ( name,
type 
)

Retrieve the style or script node with embedded source for a given module name and resource type getContent

Parameters:
{string}name The module name to fetch the source from
{string}type Resource type (i.e.) YUI_JS or YUI_CSS
Returns:
{string} style or script node with embedded source

Definition at line 1466 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 965 of file loader.php.

Here is the caller graph for this function:

getLink ( name,
type 
)

Retrieve the link or script include for a given module name and resource type getLink

Parameters:
{string}name The module name to fetch the include for
{string}type Resource type (i.e.) YUI_JS or YUI_CSS
Returns:
{string} link or script include

Definition at line 1489 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Identifies what module(s) have been loaded via the load method and/or marked as loaded via the setLoaded method getLoadedModules

Returns:
{array}

Definition at line 1618 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Identifies what module(s) have been loaded via the load method and/or marked as loaded via the setLoaded method getLoadedModulesAsJSON

Returns:
{json}

Definition at line 1639 of file loader.php.

Here is the call graph for this function:

getProvides ( name)

Identifies what module(s) are provided by a given module name (e.g.) yaho-dom-event provides yahoo, dom, and event getProvides

Parameters:
{string}name Module name
Returns:
{array}

Definition at line 1599 of file loader.php.

Here is the caller graph for this function:

getRaw ( name)

Retrieve the raw source contents for a given module name getRaw

Parameters:
{string}name The module name you wish to fetch the source from
Returns:
{string} raw source

Definition at line 1450 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getRemoteContent ( url)

Retrieve the contents of a remote resource getRemoteContent

Parameters:
{string}url URL to fetch data from
Returns:
raw source

Definition at line 1407 of file loader.php.

Here is the caller graph for this function:

getSuperceded ( name)

Use to get a list of modules superseded by the given module name getSuperceded

Parameters:
{string}name Module name
Returns:
{array}

Definition at line 837 of file loader.php.

Here is the caller graph for this function:

getUrl ( name)

Retrieve the calculated url for the component in question getUrl

Parameters:
{string}name YUI component name

Definition at line 1365 of file loader.php.

Here is the caller graph for this function:

hasProcessedModuleType ( moduleType = 'ALL')

Used to determine if a module type has been processed hasProcessedModuleType

Parameters:
string$moduleType

Definition at line 467 of file loader.php.

json ( moduleType = null,
allowRollups = false,
skipSort = false,
full = false 
)

Used to fetch a JSON object with the required JavaScript and CSS components json

Parameters:
{string}moduleType
{boolean}allowRollups
{boolean}skipSort
{boolean}full
Returns:
{string} Returns a JSON object with the required JavaScript and CSS components

Definition at line 737 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

listSatisfies ( satisfied,
moduleList 
)

Used to determine if one module is satisfied by provided array of modules listSatisfies

Parameters:
{string}satisfied Module name
{array}moduleList List of modules names
Returns:
{boolean}

Definition at line 1005 of file loader.php.

Here is the caller graph for this function:

load ( )

Used to load YUI and/or custom components load

Parameters:
string$varname[, string $... ] List of component names

Definition at line 445 of file loader.php.

Here is the call graph for this function:

loadSingle ( name)

Loads the requested module loadSingle

Parameters:
string$namethe name of a module to load
Returns:
{boolean}

Definition at line 592 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

log ( msg)

General logging function. Writes a message to the PHP error log. log

Parameters:
{string}msg Message to write

Definition at line 787 of file loader.php.

mapSatisfyingModule ( satisfied,
satisfier 
)

Definition at line 1242 of file loader.php.

Here is the caller graph for this function:

moduleSatisfies ( satisfied,
satisfier 
)

Returns true if the supplied $satisfied module is satisfied by the supplied $satisfier module

Definition at line 973 of file loader.php.

Here is the caller graph for this function:

overrideBase ( base,
modules 
)

Used to override the base dir for specific set of modules (Note: not supported when using the combo service) overrideBase

Parameters:
{string}base Base path (e.g.) 2.6.0/build
{array}modules Module names of which to override base

Definition at line 992 of file loader.php.

parseSkin ( moduleName)

Parses a module's skin. A modules skin is typically prefixed. parseSkin

Parameters:
string$namethe name of a module to parse
Returns:
{array}

Definition at line 561 of file loader.php.

Here is the caller graph for this function:

processDependencies ( outputType,
moduleType,
skipSort = false,
showLoaded = false 
)

Used to process the dependency list and retrieve the actual CSS and/or JavaScript resources in requested output format (e.g.) json, link/script nodes, embeddable code, php array, etc. processDependencies

Parameters:
{string}outputType the format you like the response to be in
{string}moduleType Type of module to return (i.e.) js or css
{boolean}skipSort
{boolean}showLoaded
Returns:
{varies} output format based on requested outputType

Definition at line 1260 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

prune ( deps,
moduleType 
)

Used during dependecy processing to prune modules from the list of modules requiring further processing prune

Parameters:
{array}deps List of module dependencies
{string}moduleType Type of modules to prune (i.e.) js or css
Returns:
{array}

Definition at line 816 of file loader.php.

Here is the caller graph for this function:

raw ( moduleType = null,
allowRollups = false,
skipSort = false 
)

Used to produce the raw Javacript and CSS code inline without the actual script or style tags raw

Parameters:
{string}moduleType
{boolean}allowRollups
{boolean}skipSort
Returns:
{string} Returns the raw JavaScript and/or CSS code inline without the actual style tags

Definition at line 778 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

script ( )

Used to output each of the required script tags script

Returns:
{string}

Definition at line 621 of file loader.php.

Here is the call graph for this function:

Used to fetch an array of the required JavaScript components script_data

Returns:
{array} Returns an array of data about each of the identified JavaScript components

Definition at line 679 of file loader.php.

Here is the call graph for this function:

Used to embed the raw JavaScript inline script_embed

Returns:
{string} Returns the script tag(s) with the JavaScript inline

Definition at line 650 of file loader.php.

Here is the call graph for this function:

Used to fetch a JSON object with the required JavaScript components script_json

Returns:
{string} Returns a JSON object containing urls for each JavaScript component

Definition at line 715 of file loader.php.

Here is the call graph for this function:

Used to produce the raw JavaScript code inline without the actual script tags script_raw

Returns:
{string} Returns the raw JavaScript code inline without the actual script tags

Definition at line 757 of file loader.php.

Here is the call graph for this function:

setLoaded ( )

Used to specify modules that are already on the page that should not be loaded again setLoaded

Parameters:
string$varname[, string $... ] List of module names

Definition at line 476 of file loader.php.

Here is the call graph for this function:

setProcessedModuleType ( moduleType = 'ALL')

Used to mark a module type as processed setProcessedModuleType

Parameters:
string$moduleType

Definition at line 458 of file loader.php.

Here is the caller graph for this function:

skinSetup ( name)

Sets up skin for skinnable modules skinSetup

Parameters:
string$namemodule name
Returns:
{string}

Definition at line 505 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

sortDependencies ( moduleType,
skipSort = false 
)

Used to sort dependencies in the proper order (Note: only call this if the loader is dirty) sortDependencies

Parameters:
{string}Module name
{array}moduleList List of modules names
Returns:
{boolean}

Definition at line 1052 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

tags ( moduleType = null,
skipSort = false 
)

Used to output each of the required html tags (i.e.) script or link tags

Parameters:
{string}moduleType Type of html tag to return (i.e.) js or css. Default is both.
{boolean}skipSort
Returns:
{string}

Definition at line 641 of file loader.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Used to update the APC cache updateCache

Definition at line 426 of file loader.php.

Here is the caller graph for this function:

YAHOO_util_Loader ( yuiVersion,
cacheKey = null,
modules = null,
noYUI = false 
)

The YAHOO_util_Loader class constructor

Parameters:
{string}yuiVersion Defines which version of YUI metadata to load
{string}cacheKey Unique APC cache key. This is combined with the YUI base so that updates to YUI will force a new cache entry. However, if your custom config changes, this key should be changed (otherwise the old values will be used until the cache expires).
{array}modules A list of custom modules
{boolean}noYUI Pass true if you do not want the YUI metadata

Definition at line 330 of file loader.php.

Here is the call graph for this function:


Field Documentation

$accountedFor = array()

Definition at line 185 of file loader.php.

$allowRollups = true

Definition at line 103 of file loader.php.

$base = ""

Definition at line 67 of file loader.php.

$baseOverrides = array()

Definition at line 217 of file loader.php.

$cacheFound = false

Definition at line 225 of file loader.php.

$combine = false

Definition at line 288 of file loader.php.

$comboBase = "http://yui.yahooapis.com/combo?"

Definition at line 298 of file loader.php.

$cssComboLocation = null

Definition at line 308 of file loader.php.

$delayCache = false

Definition at line 233 of file loader.php.

$depCache = array()

Definition at line 279 of file loader.php.

$dirty = true

Definition at line 169 of file loader.php.

$filter = ""

Definition at line 78 of file loader.php.

$filterList = null

Definition at line 95 of file loader.php.

$filters = array()

Definition at line 86 of file loader.php.

$fullCacheKey = null

Definition at line 209 of file loader.php.

$globalModules = array()

Definition at line 265 of file loader.php.

$jsComboLocation = null

Definition at line 318 of file loader.php.

$loaded = array()

Definition at line 145 of file loader.php.

$loadOptional = false

Definition at line 111 of file loader.php.

$modules = array()

Definition at line 201 of file loader.php.

$processedModuleTypes = array()

Definition at line 129 of file loader.php.

$requests = array()

Definition at line 137 of file loader.php.

$rollupModules = array()

Definition at line 257 of file loader.php.

$rollupsToTop = false

Definition at line 120 of file loader.php.

$satisfactionMap = array()

Definition at line 272 of file loader.php.

$skin = array()

Definition at line 250 of file loader.php.

$skins = array()

Definition at line 193 of file loader.php.

$sorted = null

Definition at line 177 of file loader.php.

$superceded = array()

Definition at line 153 of file loader.php.

$undefined = array()

Definition at line 161 of file loader.php.

$version = null

Definition at line 242 of file loader.php.

$versionKey = "_yuiversion"

Definition at line 243 of file loader.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations