Extension:Tab0
From MediaWiki.org
|
Release status: stable |
|||
|---|---|---|---|
| Implementation | User interface | ||
| Description | Adds "0" tab, linking to the edit page of the first section of the page | ||
| Author(s) | Agbad | ||
| MediaWiki | 1.11, 1.12 and (likely) lower | ||
| License | GPL-2+ | ||
| Download | Download | ||
|
|||
|
check usage (experimental) |
|||
This extension adds new tab, and the tab's name is "0". If you click on the "0" tab, then it open the edit page of the first part in the page.
[edit] Download
- Download the directory
- Add that line to LocalSettings.php to load that extension:
-
require_once( '$IP/extensions/Tab0/Tab0.php' );
[edit] Code
The code is of Tab0.php:
<?php /** * @addtogroup Extensions */ $wgExtensionCredits['other'][] = array( 'name' => 'Tab0', 'author' => 'Agbad', 'description' => 'Adds "0" tab, linking to the edit page of the first section of the page', 'descriptionmsg' => 'tab0-desc', 'svn-date' => '$LastChangedDate$', 'svn-revision' => '$LastChangedRevision$', 'url' => 'http://www.mediawiki.org/wiki/Extension:Tab0', ); $wgExtensionMessagesFiles['Tab0'] = dirname( __FILE__ ) . '/Tab0.i18n.php'; $wgHooks['SkinTemplateContentActions'][] = 'showTab0'; function showTab0( $content_actions ) { global $wgTitle; if( $wgTitle->quickUserCan( 'edit' ) && $wgTitle->exists() ) { $content_actions['0'] = array( 'class' => false, 'text' => '0', 'href' => $wgTitle->getFullURL( 'action=edit§ion=0' ), ); } return true; }