Extension:FormProc
From MediaWiki.org
|
FormProc 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 and version matrix | |||
Contents |
Purpose [edit]
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.
Features [edit]
- 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)
Example [edit]
Form Processing Page 'MyFormProc' [edit]
<!-- 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.
Dependencies [edit]
- Extension:StubManager extension
- Extension:RunPHP Class extension
Installation [edit]
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 );
History [edit]
- added functionality to define a class for handling form processing
- removed dependency on ExtensionClass
- added stubbing capability through StubManager
