Extension:FormProc
From MediaWiki.org
|
Release status: stable |
|||
|---|---|---|---|
| Implementation | User interface, Tag | ||
| Description | |||
| Author(s) | Jean-Lou Dupont (jldupontTalk) | ||
| Last Version | See SVN | ||
| MediaWiki | tested on 1.10 but probably works with earlier versions | ||
| License | No license specified | ||
| Download | SVN | ||
|
|||
|
check usage (experimental) |
|||
Contents |
[edit] Purpose
This extension offers the ability to process posted pages/forms through the 'action=formsubmit' action. The processing code resides in the database. The code can be 'syntax highlighted' through a <php> tag.
[edit] Features
- Handles 'action=formsubmit' action
- Follows 'redirects'
- Executes PHP code stored in a standard Mediawiki page
- Supports code extraction when enclosed in 'PHP' tags
- Supports the definition of a class in the processor page ( $page.'Class' )
- If a method 'submit' is present in the said class, it will be called upon formsubmit action (see example)
[edit] Example
[edit] Form Processing Page 'MyFormProc'
<!-- remove pre section -->
<php>
class MyFormProcClass
{
function submit() { implement your handler here }
}
</php>
So in the above case, your form should POST to something like MyFormProc?action=formsubmit.
[edit] Dependencies
- Extension:StubManager extension
- Extension:RunPHP Class extension
[edit] Installation
To install independently from BizzWiki:
- Download 'StubManager' extension
- Apply the following changes to 'LocalSettings.php'
require('extensions/StubManager.php'); require('extensions/RunPHP_class.php'); StubManager::createStub( 'FormProcClass', // recent versions: try 'FormProc' $IP.'/extensions/FormProc/FormProc.php', // recent versions: try FormProc.body.php null, array( 'UnknownAction' ), false, // no need for logging support null, // tags null, // no parser functions null // no magic words );
[edit] History
- added functionality to define a class for handling form processing
- removed dependency on ExtensionClass
- added stubbing capability through StubManager