Extension:CustomEdit/CustomEdit.php

From MediaWiki.org

Jump to: navigation, search
<?php
 
/**
 * Extention to create a custom article editing form.
 *
 * By Barry Brannan (http://www.mediawiki.org/wiki/User:Barrylb)
 * and Florian Straub (http://www.mediawiki.org/wiki/User:Flominator)
 * 
 * This example assumes you have a set of articles named Person/John_Smith, Person/John_Brown ... etc 
 *
 * Whenever you are editing an article named Person/*, a form is shown with fields Sex, Age, Description.
 * When you first create the article, the fields are put together with a template named Person, eg:
 *   {{Person|sex=M|age=60}}My description
 *
 * When you edit an article, this form extracts the fields from a template used in the text and allows 
 * the user to edit them.  
 *
 * You also need to create a template called [[Template:Person]] to display the fields as you would like and
 * to activate the templates  this extension should use on [[MediaWiki:CustomEditTemplates]] before. 
 *
 * To enable this extension place the following in LocalSettings.php:
 *     require_once("extensions/CustomEdit.php");
 */
 
error_reporting(E_ALL ^ E_NOTICE); //deactivate notices but not other messages
 
$wgExtensionCredits['other'][] = array(
	'name' => 'CustomEdit',
	'version' => 1.1,
	'author' => array('Barry Brannan', 'Florian Straub'),
	<sp