Location: PHPKode > projects > Simple Way to Usenet > libs/core/ajax/lib/xajaxRequestPlugin.class.php
<?php
/*
	Class: xajaxRequestPlugin
	
	The base class for all xajax request plugins.
	
	Request plugins handle the registration, client script generation and processing of
	xajax enabled requests.  Each plugin should have a unique signature for both
	the registration and processing of requests.  During registration, the user will
	specify a type which will allow the plugin to detect and handle it.  During client
	script generation, the plugin will generate a <xajax.request> stub with the
	prescribed call options and request signature.  During request processing, the
	plugin will detect the signature generated previously and process the request
	accordingly.
*/
class xajaxRequestPlugin extends xajaxPlugin
{
	/*
		Function: configure
		
		Called by the <xajaxPluginManager> when a configuration setting is changing.
		Plugins should store a local copy of the settings they wish to use during 
		registration, client script generation or request processing.
	*/
	function configure($sName, $mValue)
	{
	}
	
	/*
		Function: register
		
		Called by the <xajaxPluginManager> when a user script when a function, event 
		or callable object is to be registered.  Additional plugins may support other 
		registration types.
	*/
	function register($aArgs)
	{
		return false;
	}
	
	/*
		Function: generateClientScript
		
		Called by <xajaxPluginManager> when the page's HTML is being sent to the browser.
		This allows each plugin to inject some script / style or other appropriate tags
		into the HEAD of the document.  Each block must be appropriately enclosed, meaning
		javascript code must be enclosed in SCRIPT and /SCRIPT tags.
	*/
	function generateClientScript()
	{
	}
	
	/*
		Function: canProcessRequest
		
		Called by the <xajaxPluginManager> when a request has been received to determine
		if the request is for a xajax enabled function or for the initial page load.
	*/
	function canProcessRequest()
	{
		return false;
	}
	
	/*
		Function: processRequest
		
		Called by the <xajaxPluginManager> when a request is being processed.  This 
		will only occur when <xajax> has determined that the current request is a valid
		(registered) xajax enabled function via <xajax->canProcessRequest>.
	*/
	function processRequest()
	{
		return false;
	}
}
Return current item: Simple Way to Usenet