Extension:MakeArticle/ReadMe

Introduction
MakeArticle is an extension that, given a template, presents the user with a form in which they can fill in: When they then click the 'create' button, it builds an article with that name based on the template parameterised by those values.
 * An article name
 * Values for the template's parameters

Essentially, it takes the idea from extensions like CreateArticle and extends it by allowing the text pre-loaded into the new page to be configurable on the fly, so one can specify any template in the markup and create a parameterised article. So it provides a handy tool for creating new pages by filling in a form.

Functionality
The extension takes a two-pass approach:
 * 1) Building a web-form based on the structure of the specified extension. This uses the hook  ParserFirstCallInit.
 * This includes using a style-sheet to format the form, that the wiki manager can customise)


 * 1) In response to the button-click, using the provided parameter values to build a new article and take the user there. This uses the hook UnknownAction.

Pass One : Hook ParserFirstCallInit
This pass registers a loader function with the hook, the loader function associating the tag  with the function   (line 40). This creates an instance of the class  (line 46) and then invokes the member function   of that instance.

The function :
 * 1) Uses the stylesheet pointed to by the global variable  (defaults to  ) to insert formatting information into a page header.
 * 2) Attempts to read in the contents of the template file named in the text between the tags.
 * 3) Extracts the names of the parameters from the template.
 * 4) Builds an HTML form styled by the stylesheet which:
 * Asks the user for a name for the new article to be created.
 * Asks for values for the template's parameters.
 * Provides a 'create' button.

When the user hits 'create' the form sends this information back to MediaWiki, together with additional parameters:
 * The name of the template.
 * An identifier tag  to allow the second pass to identify which UnknownActions belong to this extension.

Pass Two: Hook UnknownAction
This pass registers the function  (line 127) with UnknownAction. The function filters out those events that are relevant by looking for the  tag. It then:
 * 1) Attempts to create a new article with the specified name.
 * 2) Inserts into the article the text:
 * 3) Redirects MediaWiki to the new page.
 * 1) Redirects MediaWiki to the new page.

The Stylesheet
The stylesheet is used to format the web form generated in pass 1. Here is a quick run down of what it does:

Acknowledgements
I would like to acknowledge the following extensions:
 * CreateArticle by Lisa Ridley, from which I took the basic two-pass approach.
 * PageCSS by Ævar Arnfjörð Bjarmason, from which I took the code to inject a CSS into the generated page containing the form.