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

Static Public Member Functions

static function_call ($function, array $arguments=null, $delay=0)
static function_call_with_Y ($function, array $extraarguments=null)
static object_init ($var, $class, array $arguments=null, array $requirements=null, $delay=0)
static set_variable ($name, $value, $usevar=true)
static event_handler ($selector, $event, $function, array $arguments=null)

Detailed Description

Simple javascript output class

Definition at line 1582 of file outputcomponents.php.


Member Function Documentation

static event_handler ( selector,
event,
function,
array arguments = null 
) [static]

Writes event handler attaching code

Parameters:
mixed$selectorstandard YUI selector for elements, may be array or string, element id is in the form "#idvalue"
string$eventA valid DOM event (click, mousedown, change etc.)
string$functionThe name of the function to call
array$argumentsAn optional array of argument parameters to pass to the function
Returns:
string JS code fragment

Definition at line 1688 of file outputcomponents.php.

static function_call ( function,
array arguments = null,
delay = 0 
) [static]

Returns javascript code calling the function

Parameters:
string$functionfunction name, can be complex like Y.Event.purgeElement
array$argumentsparameters
int$delayexecution delay in seconds
Returns:
string JS code fragment

Definition at line 1590 of file outputcomponents.php.

Here is the caller graph for this function:

static function_call_with_Y ( function,
array extraarguments = null 
) [static]

Special function which adds Y as first argument of fucntion call.

Parameters:
string$function
array$extraarguments
Returns:
string

Definition at line 1612 of file outputcomponents.php.

Here is the caller graph for this function:

static object_init ( var,
class,
array arguments = null,
array requirements = null,
delay = 0 
) [static]

Returns JavaScript code to initialise a new object

Parameters:
string | null$varIf it is null then no var is assigned the new object
string$class
array$arguments
array$requirements
int$delay
Returns:
string

Definition at line 1631 of file outputcomponents.php.

static set_variable ( name,
value,
usevar = true 
) [static]

Returns code setting value to variable

Parameters:
string$name
mixed$valuejson serialised value
bool$usevaradd var definition, ignored for nested properties
Returns:
string JS code fragment

Definition at line 1664 of file outputcomponents.php.

Here is the caller graph for this function:


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