From OrganicDesign Wiki
| Legacy: This article describes a concept that has been superseded in the course of ongoing development on the Organic Design wiki. Please do not develop this any further or base work on this concept, this is only useful for a historic record of work done. You may find a link to the currently used concept or function in this article, if not you can contact the author to find out what has taken the place of this legacy item.
|
|
<?php
# Extension:PublicRevision
# - Licenced under LGPL (http://www.gnu.org/copyleft/lesser.html)
# - Author: [http://www.organicdesign.co.nz/nad User:Nad]
if (!defined('MEDIAWIKI')) die('Not an entry point.');
define('PUBLICREVISION_VERSION','0.0.1, 2007-09-27');
$wgExtensionFunctions[] = 'wfSetupPublicRevision';
$wgExtensionCredits['other'][] = array(
'name' => 'PublicRevision',
'author' => '[http://www.organicdesign.co.nz/nad User:Nad]',
'description' => 'Allow articles to be held at a particular revision until subsequent edits are authorised by a user with sufficient permissions.',
'url' => 'http://www.mediawiki.org/wiki/Extension:PublicRevision',
'version' => PUBLICREVISION_VERSION
);
# Called from $wgExtensionFunctions array when initialising extensions
function wfSetupPublicRevision() {
global $wgExtraNamespaces;
# If a held-back revision id article exists for the requested title, put its value into oldid
$title = Title::newFromText($wgExtraNamespaces[NS_PUBLICREVISION].':'.$_REQUEST['title']);
if (is_object($title) && $title->exists()) {
$article = new Article($title);
if (ereg('^\\s*([0-9]+)',$article->fetchContent(0,false,false),$m)) $_REQUEST['oldid'] = $m[1];
}
}