Class Wigbi__JS

Description

The Wigbi class (ignore the file's __JS suffix).

This class is the most central class of the Wigbi JavaScript layer. It is used to initialize the JavaScript layer and has some central utility functionality.

Two important properties are serverRoot and webRoot, which points out the application root folder for the executing FILE and PAGE. Except these two properties the class contains handy functions that do not belong anywhere else, in order to keep Wigbi stripped of small classes that only serves a very limited purpose.

Another very important function is the executeFunction function. This is the "heart" of the Wigbi AJAX pipeline and is used by all AJAX-based operations that execute PHP functions asynchronously.

Located in /wigbi_source/php/__js__system/Wigbi.php (line 50)


	
			
Method Summary
 static void addControl ($control $control)
 static void addSeedControlBehavior ( $controlId)
 static string asyncPostBackPage ()
 static array controlClasses ()
 static string controls ()
 static void executeFunction ($className $className, $object $object, functionName $functionName, parameters $parameters, callBack $callBack)
 static BaseControl getControl ($controlId $controlId)
 static void initSeedControl ($viewControlId $viewControlId, $editControlId $editControlId, $viewDivId $viewDivId, $editDivId $editDivId, $viewButtonId $viewButtonId, $editButtonId $editButtonId)
 static void rootPath ()
 static array seedClasses ()
 static void start (bool $rootPath, string $asyncPostBackPage, array $controlClasses, array $seedClasses, string $languageString)
 static string webRoot ()
Methods
static addControl (line 121)

Register a Wigbi control instance.

  • access: public
static void addControl ($control $control)
  • $control $control: mixed The control to register.
static addSeedControlBehavior (line 200)
  • deprecated:
  • access: public
static void addSeedControlBehavior ( $controlId)
  • $controlId
static asyncPostBackPage (line 62)

Get the relative path to the Wigbi async postback page.

  • return: The relative path to the Wigbi async postback page.
  • access: public
static string asyncPostBackPage ()
static controlClasses (line 82)

Get all classes that have been added to the wigbi/controls folder.

  • return: All classes that have been added to the wigbi/controls folder.
  • access: public
static array controlClasses ()
static controls (line 72)

Get all control that have been added with addControl so far.

  • return: All control that have been added with addControl
  • access: public
static string controls ()
static executeFunction (line 176)

[ASYNC] Execute a server side function asynchronously.

Function parameters are defined as a value array. They MUST be provided in the correct order.

The function has no return value, since it is executed with AJAX. The return value is applied to the callBack function as a parameter instead, e.g.

onLogin(bool success) { ... }

  • access: public
static void executeFunction ($className $className, $object $object, functionName $functionName, parameters $parameters, callBack $callBack)
  • $className $className: string The name of the class to which the function belongs.
  • $object $object: object The object that is to execute the function, if any.
  • functionName $functionName: string The name of the function to execute.
  • parameters $parameters: array A list of function parameter values.
  • callBack $callBack: function The function to execute when the operation is done.
static getControl (line 153)

Retrieve a control that has been registered with addControl.

  • return: The control instance.
  • access: public
static BaseControl getControl ($controlId $controlId)
  • $controlId $controlId: string The ID of the control to retrieve.
static initSeedControl (line 142)

Initialize view/edit seed behavior for a Wigbi control.

This is a temporary function that has been added here since no better option existed. It may be removed in the future.

To use this function, the view control must a setObject property function while the edit control must have an object get property.

  • access: public
static void initSeedControl ($viewControlId $viewControlId, $editControlId $editControlId, $viewDivId $viewDivId, $editDivId $editDivId, $viewButtonId $viewButtonId, $editButtonId $editButtonId)
  • $viewControlId $viewControlId: The ID of the control that is used to display the seed.
  • $editControlId $editControlId: The ID of the control that is used to edit the seed.
  • $viewDivId $viewDivId: The ID of the div element that contains the view control.
  • $editDivId $editDivId: The ID of the div element that contains the edit control.
  • $viewButtonId $viewButtonId: The ID of the link/button element that is used to display the view div.
  • $editButtonId $editButtonId: The ID of the link/button element that is used to display the edit div.
static rootPath (line 205)
  • deprecated:
  • access: public
static void rootPath ()
static seedClasses (line 92)

Get all classes that have been added to the wigbi/seeds folder.

  • return: All classes that have been added to the wigbi/seeds folder.
  • access: public
static array seedClasses ()
static start (line 190)

Start the Wigbi application.

  • access: public
static void start (bool $rootPath, string $asyncPostBackPage, array $controlClasses, array $seedClasses, string $languageString)
  • bool $rootPath: The relative path to the project root.
  • string $asyncPostBackPage: The relative path to the Wigbi postback page.
  • array $controlClasses: The control classes that are added to the application.
  • array $seedClasses: The seed classes that are added to the application.
  • string $languageString: A serialized PHP LanguageHandler object with the current language mdoel.
static webRoot (line 108)

Get the path to the application root folder for the PAGE.

The application root folder is where the wigbi folder exists.

Use this property if a path is to be used by the CLIENT. It will make the path context independent, unlike absolute and relative URLs.

  • return: The path to the application root folder for the PAGE.
  • access: public
static string webRoot ()

Documentation generated on Sun, 27 Dec 2009 20:12:08 +0100 by phpDocumentor 1.4.1