PRAjax
[ class tree: PRAjax ] [ index: PRAjax ] [ all elements ]

Class: PRAjax

Source Location: /PRAjax.php

Class Overview


PRAjax - PHP Reflected Ajax


Author(s):

Variables

Methods



Class Details

[line 33]
PRAjax - PHP Reflected Ajax

The PRAjax class is the base class for handling Ajax calls and reflections/conversions.




Tags:

author:  Maarten Balliauw <maartenba@users.sourceforge.net>


[ Top ]


Class Variables

$aAllowedDynamicLibraries = array( 'Component_UpdatePanel' )

[line 77]


Type:   mixed


[ Top ]

$aRegisteredClasses = array()

[line 41]


Type:   mixed


[ Top ]

$aRegisteredClassFunctions = array()

[line 44]


Type:   mixed


[ Top ]

$aRegisteredFunctions = array()

[line 38]


Type:   mixed


[ Top ]

$blnIsAjaxCall =  false

[line 53]


Type:   mixed


[ Top ]

$blnShowBusyMessage =  false

[line 56]


Type:   mixed


[ Top ]

$blnShowWaitCursor =  false

[line 65]


Type:   mixed


[ Top ]

$blnUsePRAjaxTransport =  true

[line 71]


Type:   mixed


[ Top ]

$objJSON =  null

[line 68]


Type:   mixed


[ Top ]

$strBusyMessage =  'Busy...'

[line 59]


Type:   mixed


[ Top ]

$strCharset =  'utf-8'

[line 74]


Type:   mixed


[ Top ]

$strMode =  'POST'

[line 47]


Type:   mixed


[ Top ]

$strPRAjaxFilesRoot =  ''

[line 35]


Type:   mixed


[ Top ]

$strShowStatusId =  'prajax_status'

[line 62]


Type:   mixed


[ Top ]

$strUri =  ''

[line 50]


Type:   mixed


[ Top ]



Class Methods


constructor PRAjax [line 87]

PRAjax PRAjax( [string $pPRAjaxFilesRoot = ''], [string $pUri = ''])

PRAJax constructor

Create a new instance of the PRAjax class




Parameters:

string   $pUri   Request URI (defaults to the current script URI)
string   $pPRAjaxFilesRoot   PRAjax files root (defaults to '/js/')

[ Top ]

method AddScript [line 358]

void AddScript( mixed $pScript)

Add a JavaScript script



Tags:

access:  public


[ Top ]

method Alert [line 368]

void Alert( string $pText)

Show a JavaScript alert()



Tags:

access:  public


Parameters:

string   $pText   Text to alert

[ Top ]

method ClassToJS [line 279]

string ClassToJS( [object $pObject = NULL])

Create a PHP class wrapper for JavaScript



Tags:

return:  String containing a JavaScript constructor
access:  private


Parameters:

object   $pObject   Object whose class to convert to JavaScript

[ Top ]

method ErrorHandler [line 496]

void ErrorHandler( $errno, $errstr, $errfile, $errline)

Output Ajax errors as a simple echo and stop script execution.

The client will see a JavaScript alert mentioning the PHP error information.




Tags:

access:  private


Parameters:

   $errno  
   $errstr  
   $errfile  
   $errline  

[ Top ]

method ExecuteScript [line 346]

void ExecuteScript( mixed $pScript)

Execute a JavaScript script



Tags:

access:  public


[ Top ]

method FunctionToJS [line 313]

string FunctionToJS( function $pFunction)

Create a PHP function wrapper for JavaScript



Tags:

return:  String containing a JavaScript constructor
access:  private


Parameters:

function   $pFunction   Function to convert to JavaScript

[ Top ]

method getCharset [line 156]

string getCharset( )

Get Charset



Tags:

return:  Charset used for Ajax requests
access:  public


[ Top ]

method GetJavaScript [line 429]

string GetJavaScript( [boolean $pEcho = true])

Print the PRAjax code to output (echo of script)

All necessary JavaScript code is printed to the client. This function call should only be issued once in a script, otherwise JavaScript errors might occur.




Tags:

return:  PRAjax client script in a string
access:  public


Parameters:

boolean   $pEcho   True/false if you want to echo the script or put it in a variable. Defaults to "echo".

[ Top ]

method getPRAjaxFilesRoot [line 179]

string getPRAjaxFilesRoot( )

Get PRAjaxFilesRoot



Tags:

return:  PRAjaxFilesRoot used for Ajax requests
access:  public


[ Top ]

method getURI [line 114]

string getURI( )

Get URI



Tags:

return:  URI used for Ajax requests
access:  public


[ Top ]

method getUsePRAjaxTransport [line 136]

boolean getUsePRAjaxTransport( )

Get use PRAjax transport object



Tags:

return:  Use PRAjax transport object?
access:  public


[ Top ]

method HandleClientRequest [line 528]

void HandleClientRequest( )

Handle an eventual incoming client request

Results of an eventual incoming client request are printed to the client (echo)




Tags:

access:  public


[ Top ]

method isAjaxCall [line 486]

boolean isAjaxCall( )

Is the current call an Ajax Call?



Tags:

return:  Returns true if the current call is an Ajax Call. Otherwise, false.
access:  public


[ Top ]

method isClassFunctionRegistered [line 268]

boolean isClassFunctionRegistered( string $pClassName, string $pFunctionName)

Is PHP class function registered for use in JavaScript?



Tags:

return:  True/false if class function has been registered
access:  public


Parameters:

string   $pClassName   Class name to verify registration
string   $pFunctionName   Function name to verify registration

[ Top ]

method isClassRegistered [line 241]

boolean isClassRegistered( string $pClassName)

Is PHP class registered for use in JavaScript?



Tags:

return:  True/false if class has been registered
access:  public


Parameters:

string   $pClassName   Class name to verify registration

[ Top ]

method isFunctionRegistered [line 216]

boolean isFunctionRegistered( string $pFunctionName)

Is PHP function registered for use in JavaScript?



Tags:

return:  True/false if function has been registered
access:  public


Parameters:

string   $pFunctionName   Function name to verify registration

[ Top ]

method PRAjaxToPHP [line 379]

mixed PRAjaxToPHP( string $pValue)

Convert PRAjax-encoded value to PHP



Tags:

return:  PHP value (can be of any data type)
access:  public


Parameters:

string   $pValue   PRAjax-encoded value, received from client

[ Top ]

method RegisterClass [line 226]

void RegisterClass( [string $pClassName = ''])

Register a PHP class for use in JavaScript



Tags:

access:  public


Parameters:

string   $pClassName   Class name to register

[ Top ]

method RegisterClassFunction [line 252]

void RegisterClassFunction( [string $pClassName = ''], [string $pFunctionName = ''])

Register a PHP class function for use in JavaScript



Tags:

access:  public


Parameters:

string   $pClassName   Class name to register
string   $pFunctionName   Function name to register

[ Top ]

method RegisterFunction [line 201]

void RegisterFunction( [string $pFunctionName = ''])

Register a PHP function for use in JavaScript



Tags:

access:  public


Parameters:

string   $pFunctionName   Function name to register

[ Top ]

method setCharset [line 166]

void setCharset( [string $pCharset = 'utf-8'])

Set Charset



Tags:

access:  public


Parameters:

string   $pCharset   Charset used for Ajax requests, default UTF-8

[ Top ]

method setPRAjaxFilesRoot [line 189]

void setPRAjaxFilesRoot( [string $pPRAjaxFilesRoot = ''])

Set PRAjaxFilesRoot



Tags:

access:  public


Parameters:

string   $pPRAjaxFilesRoot   PRAjaxFilesRoot used for Ajax requests

[ Top ]

method setURI [line 124]

void setURI( [string $pUri = ''])

Set URI



Tags:

access:  public


Parameters:

string   $pUri   URI used for Ajax requests

[ Top ]

method setUsePRAjaxTransport [line 146]

void setUsePRAjaxTransport( [boolean $pUsePRAjaxTransport = true])

Set use PRAjax transport object



Tags:

access:  public


Parameters:

boolean   $pUsePRAjaxTransport   Use PRAjax transport object?

[ Top ]

method ShowBusyMessage [line 398]

void ShowBusyMessage( [boolean $pShow = true], [array $pMessage = ''], [string $pStatusId = 'prajax_status'])

Set to true/false if you want PRAjax to display a busy message on the client-side. Optionaly, specify the busy message and/or DOM element id to display the status in.



Tags:

access:  public


Parameters:

boolean   $pShow   True/false if you want to show the busy message
array   $pMessage   String containing the "busy" message
string   $pStatusId   DOM element to display the status in (default: 'prajax_status')

[ Top ]

method ShowWaitCursor [line 415]

void ShowWaitCursor( [boolean $pShowWaitCursor = true])

Set to true/false if you want PRAjax to display a wait cursor on the client-side when waiting for a callback.



Tags:

access:  public


Parameters:

boolean   $pShowWaitCursor   True/false if you want to show the wait cursor

[ Top ]

method ValueToJS [line 331]

string ValueToJS( [mixed $pValue = ''])

Convert a PHP value to JavaScript



Tags:

return:  String containing a JavaScript constructor
access:  private


Parameters:

mixed   $pValue   Value to convert to JavaScript

[ Top ]


Documentation generated on Wed, 30 Aug 2006 11:35:52 +0200 by phpDocumentor 1.3.0RC6