SFAutoeditAPI Class Reference

The SF_AutoEditAPI class. More...

List of all members.

Public Member Functions

 isApiQuery ()
 Getter/setter for the ApiQuery flag.
 setOptionsString ($options)
 Converts an options string into an options array and stores it.
 getOptions ()
 Returns the options array.
 setOptions ($options)
 Sets the options array.
 execute ()
 Evaluates the parameters, performs the requested API query, and sets up the result.
 isWriteMode ()
 Indicates whether this module requires write mode.
 getAllowedParams ()
 Returns the array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed.
 getParamDescription ()
 Returns an array of parameter descriptions.
 getDescription ()
 Returns the description string for this module.
 getVersion ()
 Returns a string that identifies the version of the class.
 storeSemanticData ($prefillFromExisting=true)
 This method will try to store the data in mOptions.

Static Public Member Functions

static handleAutoEdit ($optionsString=null, $prefillFromExisting= 'true')
 Handles autoedit Ajax call from autoedit parser function and from save and continue button.
static addToArray (&$array, $key, $value, $toplevel=true)

Protected Member Functions

 getExamples ()
 Returns usage examples for this module.

Private Member Functions

 parseDataFromHTMLFrag (&$data, $html, $formID)
 parseDataFromQueryString (&$data, $queryString)
 Parses data from a query string into the $data array.
 reportError ($msg)
 Set HTTP error header and add error message to the ApiResult.

Private Attributes

 $mOptions = array()
 $mIsApiQuery = true


Detailed Description

The SF_AutoEditAPI class.

Definition at line 16 of file SF_AutoeditAPI.php.


Member Function Documentation

static SFAutoeditAPI::handleAutoEdit ( optionsString = null,
prefillFromExisting = 'true' 
) [static]

Handles autoedit Ajax call from autoedit parser function and from save and continue button.

Parameters:
String $optionsString the options/data string
String $prefillFromExisting String set to 'true' to retain existing form values (unset by save and continue)
Returns:
String

Definition at line 29 of file SF_AutoeditAPI.php.

SFAutoeditAPI::isApiQuery (  ) 

Getter/setter for the ApiQuery flag.

If this is set, we are in an API query, else we are in an Ajax query.

Parameters:
bool $isApiQuery Optional. The new value
Returns:
The old value

Definition at line 98 of file SF_AutoeditAPI.php.

Referenced by execute(), reportError(), and storeSemanticData().

SFAutoeditAPI::setOptionsString ( options  ) 

Converts an options string into an options array and stores it.

Parameters:
string $options
Returns:
the options array

Definition at line 115 of file SF_AutoeditAPI.php.

References parseDataFromQueryString().

Referenced by execute().

SFAutoeditAPI::getOptions (  ) 

Returns the options array.

Returns:
array

Definition at line 123 of file SF_AutoeditAPI.php.

SFAutoeditAPI::setOptions ( options  ) 

Sets the options array.

Definition at line 130 of file SF_AutoeditAPI.php.

SFAutoeditAPI::execute (  ) 

Evaluates the parameters, performs the requested API query, and sets up the result.

Definition at line 138 of file SF_AutoeditAPI.php.

References isApiQuery(), setOptionsString(), and storeSemanticData().

SFAutoeditAPI::isWriteMode (  ) 

Indicates whether this module requires write mode.

Returns:
bool

Definition at line 156 of file SF_AutoeditAPI.php.

SFAutoeditAPI::getAllowedParams (  ) 

Returns the array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed.

Returns:
array or false

Definition at line 167 of file SF_AutoeditAPI.php.

SFAutoeditAPI::getParamDescription (  ) 

Returns an array of parameter descriptions.

Don't call this functon directly: use getFinalParamDescription() to allow hooks to modify descriptions as needed.

Returns:
array or false

Definition at line 181 of file SF_AutoeditAPI.php.

SFAutoeditAPI::getDescription (  ) 

Returns the description string for this module.

Returns:
mixed string or array of strings

Definition at line 193 of file SF_AutoeditAPI.php.

References END, and scraper::form.

SFAutoeditAPI::getExamples (  )  [protected]

Returns usage examples for this module.

Returns:
mixed string or array of strings

Definition at line 209 of file SF_AutoeditAPI.php.

SFAutoeditAPI::getVersion (  ) 

Returns a string that identifies the version of the class.

Includes the class name, the svn revision, timestamp, and last author.

Returns:
string

Definition at line 222 of file SF_AutoeditAPI.php.

SFAutoeditAPI::storeSemanticData ( prefillFromExisting = true  ) 

This method will try to store the data in mOptions.

It will return true on success or an error message on failure. The used form and target page will be available in mOptions after execution of the method.

This method also sets HTTP response headers according to the result.

Parameters:
bool $prefillFromExisting If this is set, existing values in the page will be used to prefill the form.
Returns:
true or an error message

Definition at line 238 of file SF_AutoeditAPI.php.

References SFUtils::array_merge_recursive_distinct(), SFFormLinker::getDefaultFormsForPage(), isApiQuery(), parseDataFromHTMLFrag(), and reportError().

Referenced by execute().

SFAutoeditAPI::parseDataFromHTMLFrag ( &$  data,
html,
formID 
) [private]

Definition at line 368 of file SF_AutoeditAPI.php.

Referenced by storeSemanticData().

SFAutoeditAPI::parseDataFromQueryString ( &$  data,
queryString 
) [private]

Parses data from a query string into the $data array.

Parameters:
Array $data
String $queryString
Returns:
Array

Definition at line 468 of file SF_AutoeditAPI.php.

Referenced by setOptionsString().

static SFAutoeditAPI::addToArray ( &$  array,
key,
value,
toplevel = true 
) [static]

Definition at line 493 of file SF_AutoeditAPI.php.

SFAutoeditAPI::reportError ( msg  )  [private]

Set HTTP error header and add error message to the ApiResult.

Parameters:
String $msg

Definition at line 525 of file SF_AutoeditAPI.php.

References isApiQuery().

Referenced by storeSemanticData().


Member Data Documentation

SFAutoeditAPI::$mOptions = array() [private]

Definition at line 18 of file SF_AutoeditAPI.php.

SFAutoeditAPI::$mIsApiQuery = true [private]

Definition at line 19 of file SF_AutoeditAPI.php.


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

Generated on Sun Mar 18 07:15:42 2012 for Semantic MediaWiki by  doxygen 1.5.6