Extension:Purgetab

From MediaWiki.org

Jump to: navigation, search
Crystal Clear app error.png

This extension is obsolete!
It has been replaced by Purge.

             

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
Purgetab

Release status: stable

Implementation  User interface
Description An extension to add the purge tab to all article pages without the use of JavaScript.
Author(s)  Jonathan Tse and Joe Beaudoin Jr.
Last Version  1.0 (January 18, 2008)
MediaWiki  1.11, 1.12, 1.13 and (likely) lower
License No license specified
Download purgetab.php, SVN
Example  BattlestarPegasus.com
Battlestar Wiki (English)

check usage (experimental)

Contents

[edit] What can this extension do?

This allows the addition of a purge tab, which is meant to be used if the page needs to be updated at the server level.

For obvious reasons, this tab will not show up on any Special page.

[edit] Installation

[edit] Download

Just download purgetab.php and move it to the /extensions/purgetab/ directory.

[edit] SVN

If you use Subversion, you can change to $IP/extensions/ directory and run following command:

svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/purgetab/

[edit] Changes to LocalSettings.php

require_once("$IP/extensions/purgetab/purgetab.php");

[edit] Code

[edit] purgetab.php

<?php
/**
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * @author Joe Beaudoin Jr. <joe@frakmedia.net>
 * @copyright Copyright © 2008 Joe Beaudoin Jr.
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
 *
 * An extension that shows the purge tabs above article and talk pages
 * Original code by Jonathan Tse from www.jontse.com
 * Modified by Joe Beaudoin Jr. (joe(AT)frakmedia(DOT)net)
 * For information how to install and use this extension, see: http://www.mediawiki.org/wiki/Extension:Purgetab
 *
 */
 
$wgExtensionCredits['other'][] = array(
       'name' => 'Purge Tab',
       'version' => '1.0',
       'author' => array('Jonathan Tse', 'Joe Beaudoin Jr.'),
       'url' => 'http://www.mediawiki.org/wiki/Extension:Purgetab',
       'description' => 'An extension to add the purge tab to all pages without the use of JavaScript.'
       );
 
$wgHooks['SkinTemplateContentActions'][] = 'purgetab_ReplaceTabs';
 
function purgetab_ReplaceTabs ($content_actions) {
	global $wgTitle;
 
	if ($wgTitle->getNamespace() != NS_SPECIAL) {
		$purge_action['purge'] = array(
			'class' => false, 
			'text' => 'Purge',
			'href' => $wgTitle->getFullURL('action=purge')
		);
		$content_actions = array_merge($content_actions, $purge_action);
	}
	return true;  
}