Stud.IP  4.2 Revision
UpdateInformation Class Reference
Collaboration diagram for UpdateInformation:
Collaboration graph

Static Public Member Functions

static getTimestamp ()
 
static hasData ($index)
 
static getData ($index)
 
static setInformation ($js_function, $information)
 
static getInformation ()
 
static isCollecting ()
 

Static Protected Member Functions

static getRequest ()
 

Static Protected Attributes

static $infos = array()
 
static $collecting = null
 
static $request = null
 

Detailed Description

Class to set information that should be given to javascript.

For a plugin to hand the information "test" to the javascript-function STUDIP.myplugin.myfunction just put the line: if (UpdateInformation::isCollecting()) { UpdateInformation::setInformation("myplugin.myfunction", "test"); }

Author
Rasmus Fuhse

Member Function Documentation

◆ getData()

static getData (   $index)
static

Returns request data for the given index.

Parameters
String$indexIndex to get the request data for
Returns
mixed Array with request data or null if index is invalid

◆ getInformation()

static getInformation ( )
static

returns the information to give it to javascript

Returns
array
Here is the caller graph for this function:

◆ getRequest()

static getRequest ( )
staticprotected

Extracts updater data from request

Returns
Array Request data (may be empty if no data is present)
Here is the call graph for this function:

◆ getTimestamp()

static getTimestamp ( )
static

Returns the timestamp of the beginning of the run before. Use this to only partially update new stuff.

Returns
int Timestamp of the last run
Here is the call graph for this function:

◆ hasData()

static hasData (   $index)
static

Checks whether the request has data for the given index.

Returns
bool indicating whether there is data present for the given index

◆ isCollecting()

static isCollecting ( )
static

returns if this request is a request, that wants to collect information to hand it to javascript. Ask for this in your SystemPlugin-constructor.

Returns
: boolean

◆ setInformation()

static setInformation (   $js_function,
  $information 
)
static

Gives information to the buffer for the javascript. The first parameter is the name of the corresponding javascript-function minus the "STUDIP" and the second parameter is the value handed to that function.

Parameters
string$js_function: "test.testfunction" to get the JS-function "STUDIP.test.testfunction(information);"
mixed$information: anything that could be translated into a json-object
Here is the caller graph for this function:

Field Documentation

◆ $collecting

$collecting = null
staticprotected

◆ $infos

$infos = array()
staticprotected

◆ $request

$request = null
staticprotected

The documentation for this class was generated from the following file: