LimeSurvey API - Master branch

LSYii_ClientScript extends CClientScript
in package

Table of Contents

Constants

POS_POSTSCRIPT  = 5
The script is rendered at the end of the body section.
POS_PREBEGIN  = 6

Methods

addFileToPackage()  : mixed
Add a file to a given package
getCoreScripts()  : array<string|int, mixed>
cssFicoreScripts is protected on CClientScript. It can be useful to access it for debugin purpose
getCssFiles()  : array<string|int, mixed>
cssFiles is protected on CClientScript. It can be useful to access it for debugin purpose
getFontPackages()  : array<string|int, mixed>
getRecursiveDependencies()  : mixed
Return a list of all the recursive dependencies of a packages eg: If a package A depends on B, and B depends on C, getRecursiveDependencies('A') will return {B,C}
getScriptFiles()  : mixed
IsFileInPackage()  : bool
Check if a file is in a given package
recordCachingAction()  : mixed
registerCssFile()  : mixed
registerPackage()  : void|static
The method will first check if a devbaseUrl parameter is provided, so when debug mode is on, it doens't use the asset manager
registerPackageScriptOnPosition()  : static
Registers a script package that is listed in {@link packages}.
registerScriptFile()  : void|static
In LimeSurvey, if debug mode is OFF we use the asset manager (so participants never needs to update their webbrowser cache).
removeFileFromPackage()  : mixed
Remove a file from a given package
render()  : mixed
Renders the registered scripts.
renderBodyBegin()  : mixed
Inserts the scripts at the beginning of the body section.
renderBodyEnd()  : mixed
Inserts the scripts at the end of the body section.
renderCoreScripts()  : mixed
Renders the specified core javascript library.
renderHead()  : mixed
Inserts the scripts in the head section.
unregisterPackage()  : mixed
Remove a package from coreScript.
unregisterScriptFile()  : mixed
analyzeUrl()  : array<string|int, mixed>
This function will analyze the url of a file (css/js) to register It will check if it can be published via the asset manager and if so will retrieve its path
convertDevBaseUrl()  : mixed
Convert one package to baseUrl Overwrite the package definition using a base url instead of a base path The package must have a devBaseUrl, else it will remain unchanged (for core/external package); so third party package are not concerned

Constants

POS_POSTSCRIPT

The script is rendered at the end of the body section.

public mixed POS_POSTSCRIPT = 5

only for scripts not script files

Methods

addFileToPackage()

Add a file to a given package

public addFileToPackage(mixed $sPackageName, mixed $sType, mixed $sFileName) : mixed
Parameters
$sPackageName : mixed
$sType : mixed
$sFileName : mixed

getCoreScripts()

cssFicoreScripts is protected on CClientScript. It can be useful to access it for debugin purpose

public getCoreScripts() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCssFiles()

cssFiles is protected on CClientScript. It can be useful to access it for debugin purpose

public getCssFiles() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFontPackages()

public getFontPackages() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRecursiveDependencies()

Return a list of all the recursive dependencies of a packages eg: If a package A depends on B, and B depends on C, getRecursiveDependencies('A') will return {B,C}

public getRecursiveDependencies(string $sPackageName) : mixed
Parameters
$sPackageName : string

IsFileInPackage()

Check if a file is in a given package

public IsFileInPackage(mixed $sPackageName, mixed $sType, mixed $sFileName) : bool
Parameters
$sPackageName : mixed
$sType : mixed
$sFileName : mixed
Return values
bool

recordCachingAction()

public recordCachingAction(mixed $context, mixed $method, mixed $params) : mixed
Parameters
$context : mixed
$method : mixed
$params : mixed

registerCssFile()

public registerCssFile(mixed $url[, mixed $media = '' ]) : mixed
Parameters
$url : mixed
$media : mixed = ''

registerPackage()

The method will first check if a devbaseUrl parameter is provided, so when debug mode is on, it doens't use the asset manager

public registerPackage(string $name) : void|static
Parameters
$name : string
Return values
void|static

registerPackageScriptOnPosition()

Registers a script package that is listed in {@link packages}.

public registerPackageScriptOnPosition(string $name, mixed $position) : static
Parameters
$name : string

the name of the script package.

$position : mixed
Tags
see
renderCoreScript
throws
CException
Return values
static

the CClientScript object itself (to support method chaining, available since version 1.1.5).

registerScriptFile()

In LimeSurvey, if debug mode is OFF we use the asset manager (so participants never needs to update their webbrowser cache).

public registerScriptFile(string $url[, string $position = null ][, array<string|int, mixed> $htmlOptions = array() ]) : void|static

If debug mode is ON, we don't use the asset manager, so developpers just have to refresh their browser cache to reload the new scripts. To make developer life easier, if they want to register a single script file, they can use App()->getClientScript()->registerScriptFile({url to script file}) if the file exist in local file system and debug mode is off, it will find the path to the file, and it will publish it via the asset manager

Parameters
$url : string
$position : string = null
$htmlOptions : array<string|int, mixed> = array()
Return values
void|static

removeFileFromPackage()

Remove a file from a given package

public removeFileFromPackage(mixed $sPackageName, mixed $sType, mixed $sFileName) : mixed
Parameters
$sPackageName : mixed
$sType : mixed
$sFileName : mixed

render()

Renders the registered scripts.

public render(string &$output) : mixed

This method is called in when it finishes rendering content. CClientScript thus gets a chance to insert script tags at head and body sections in the HTML output.

Parameters
$output : string

the existing output that needs to be inserted with script tags

renderBodyBegin()

Inserts the scripts at the beginning of the body section.

public renderBodyBegin(string &$output) : mixed

This is overwriting the core method and is exactly the same except the marked parts

Parameters
$output : string

the output to be inserted with scripts.

renderBodyEnd()

Inserts the scripts at the end of the body section.

public renderBodyEnd(string &$output) : mixed

This is overwriting the core method and is exactly the same except the marked parts

Parameters
$output : string

the output to be inserted with scripts.

renderCoreScripts()

Renders the specified core javascript library.

public renderCoreScripts() : mixed

renderHead()

Inserts the scripts in the head section.

public renderHead(string &$output) : mixed
Parameters
$output : string

the output to be inserted with scripts.

unregisterPackage()

Remove a package from coreScript.

public unregisterPackage(mixed $sName) : mixed

It can be useful when mixing backend/frontend rendering (see: template editor)

Parameters
$sName : mixed

unregisterScriptFile()

public unregisterScriptFile(mixed $sName) : mixed
Parameters
$sName : mixed

analyzeUrl()

This function will analyze the url of a file (css/js) to register It will check if it can be published via the asset manager and if so will retrieve its path

private analyzeUrl( $sUrl) : array<string|int, mixed>
Parameters
$sUrl :
Return values
array<string|int, mixed>

convertDevBaseUrl()

Convert one package to baseUrl Overwrite the package definition using a base url instead of a base path The package must have a devBaseUrl, else it will remain unchanged (for core/external package); so third party package are not concerned

private convertDevBaseUrl(string $package) : mixed
Parameters
$package : string

        
On this page

Search results