|
const | ACTION_FORMEDIT = 0 |
|
const | ACTION_SAVE = 1 |
|
const | ACTION_PREVIEW = 2 |
|
const | ACTION_DIFF = 3 |
|
const | ERROR = 0 |
|
const | WARNING = 1 |
|
const | NOTICE = 2 |
|
const | DEBUG = 3 |
|
◆ addOptionsFromString()
PFAutoeditAPI::addOptionsFromString |
( |
|
$options | ) |
|
Converts an options string into an options array and stores it
- Parameters
-
- Returns
- the options array
◆ addToArray()
static PFAutoeditAPI::addToArray |
( |
& |
$array, |
|
|
|
$key, |
|
|
|
$value, |
|
|
|
$toplevel = true |
|
) |
| |
|
static |
This function recursively inserts the value into a tree.
- Parameters
-
array | &$array | is root |
string | $key | identifies path to position in tree. Format: 1stLevelName[2ndLevel][3rdLevel][...], i.e. normal array notation |
mixed | $value | the value to insert |
bool | $toplevel | if this is a toplevel value. |
◆ doAction()
PFAutoeditAPI::doAction |
( |
| ) |
|
Depending on the requested action this method will try to store/preview the data in mOptions or retrieve the edit form.
The form and target page will be available in mOptions after execution of the method.
Errors and warnings are logged in the API result under the 'errors' key. The general request status is maintained in mStatus.
$wgRequest $wgOut PFFormPrinter $wgPageFormsFormPrinter
- Exceptions
-
◆ execute()
PFAutoeditAPI::execute |
( |
| ) |
|
Evaluates the parameters, performs the requested API query, and sets up the result.
The execute() method will be invoked when an API call is processed.
The result data is stored in the ApiResult object available through getResult().
◆ generateTargetName()
PFAutoeditAPI::generateTargetName |
( |
|
$targetNameFormula | ) |
|
|
protected |
Generates a target name from the given target name formula
This parses the formula and replaces <unique number> tags
- Parameters
-
- Exceptions
-
- Returns
- type
◆ getAction()
PFAutoeditAPI::getAction |
( |
| ) |
|
Returns the action performed by the module.
Return value is either null or one of ACTION_SAVE, ACTION_PREVIEW, ACTION_FORMEDIT
- Returns
- null|number
◆ getAllowedParams()
PFAutoeditAPI::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
◆ getDescription()
PFAutoeditAPI::getDescription |
( |
| ) |
|
Returns the description string for this module
- Returns
- string|string[]
◆ getExamples()
PFAutoeditAPI::getExamples |
( |
| ) |
|
|
protected |
Returns usage examples for this module.
- Returns
- string|string[]
◆ getFormTitle()
PFAutoeditAPI::getFormTitle |
( |
| ) |
|
|
protected |
Get the Title object of a form suitable for editing the target page.
- Returns
- Title
- Exceptions
-
◆ getOptions()
PFAutoeditAPI::getOptions |
( |
| ) |
|
◆ getParamDescription()
PFAutoeditAPI::getParamDescription |
( |
| ) |
|
Returns an array of parameter descriptions. Don't call this function directly: use getFinalParamDescription() to allow hooks to modify descriptions as needed.
- Returns
- array or false
◆ getStatus()
PFAutoeditAPI::getStatus |
( |
| ) |
|
Returns the HTTP status
200 - ok 400 - error
- Returns
- number
◆ getTextForPage()
PFAutoeditAPI::getTextForPage |
( |
|
$title | ) |
|
Helper function..
- Parameters
-
- Returns
- string
◆ getVersion()
PFAutoeditAPI::getVersion |
( |
| ) |
|
Returns a string that identifies the version of the class. Includes the class name, the svn revision, timestamp, and last author.
- Returns
- string
◆ isWriteMode()
PFAutoeditAPI::isWriteMode |
( |
| ) |
|
Indicates whether this module requires write mode
- Returns
- bool
◆ makeRandomNumber()
static PFAutoeditAPI::makeRandomNumber |
( |
|
$numDigits = 1 , |
|
|
|
$hasPadding = false |
|
) |
| |
|
static |
Returns a formatted (pseudo) random number
- Parameters
-
number | $numDigits | the min width of the random number |
bool | $hasPadding | should the number should be padded with zeros instead of spaces? |
- Returns
- number
◆ setHeaders()
PFAutoeditAPI::setHeaders |
( |
| ) |
|
|
protected |
Set custom headers to attach to the answer
◆ setOption()
PFAutoeditAPI::setOption |
( |
|
$option, |
|
|
|
$value |
|
) |
| |
- Parameters
-
string | $option | |
mixed | $value | |
◆ setOptions()
PFAutoeditAPI::setOptions |
( |
|
$options | ) |
|
◆ setResultFromOutput()
PFAutoeditAPI::setResultFromOutput |
( |
| ) |
|
|
protected |
Sets the output HTML of wgOut as the module's result
◆ DEBUG
const PFAutoeditAPI::DEBUG = 3 |
Error level used for debug messages.
◆ ERROR
const PFAutoeditAPI::ERROR = 0 |
Error level used when a non-recoverable error occurred.
◆ NOTICE
const PFAutoeditAPI::NOTICE = 2 |
Error level used to give information that might be of interest to the user.
◆ WARNING
const PFAutoeditAPI::WARNING = 1 |
Error level used when a recoverable error occurred.
The documentation for this class was generated from the following file: