Extension:DynamicTabs

Note
This extension only works with Mediawiki 1.15.0 or later. If you have an older version of MediaWiki installed, you can use version 0.1 of the extension, which does not feature the web interface. Instead you have to use a file on the server for configuration.

What can this extension do?
DynamicTabs extension makes it possible to remove and/or add custom tabs (tabs are eg. the edit button, history button and so on). This can be done by either adding dynamic links to articles with the same name in a different namespace and/or by adding arbitrary static internal and external links. Any and all default tabs can be removed by specifying it's name in the correct section on the configuration page, either for ordinary users and/or from sysops (read on below).

Usage
You can use this extension if you would like to hide tabs from users in a better way than CSS can do. You can also use it to add new tabs either based on namespaces, internal links or external links. Read more about configuration here.

Download instructions
Download the code tar.gzzip, unpack the archive and place the folder named  in. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation
To install this extension, add the following to LocalSettings.php:

Configuration
All configuration is done on wiki at the page. If this page doesn't exist the extension will do nothing. On this page you can create six different configuration sections:
 * hideAnonymous
 * hideUsers
 * hideSysop
 * nsTabs
 * intLinks
 * extLinks

Section headers are denoted by a star ( * ) in the configuration page, and tabs are denoted by a hash sign ( # ) followed by the name of the tab. Tabs are specified as a hash sign (#) followed by the name of the tab. These are the sections and possible options:
 * hideAnonymous - this section holds tabs that should be hidden from anonymous users. Possible options are
 * 1) nstab-main -tab for main namespace
 * 2) nstab-mediawiki -tab for mediawiki namespace
 * 3) nstab-project -tab for project namespace
 * 4) nstab-user -tab for user namespace
 * 5) nstab-image -tab for file namespace
 * 6) nstab-template -tab for template namespace
 * 7) nstab-category -tab for category namespace
 * 8) nstab-custom_namespace_here -tab for any custom namespace you have created
 * 9) talk -tab for talkpages
 * 10) viewsource -edit tab for anonumous users
 * 11) edit - edit tab for registered users
 * 12) history - hostory tabs
 * hideUsers - this section holds tabs that should be hidden from ordinary users. Possible options are:
 * 1) nstab-main -tab for main namespace
 * 2) nstab-mediawiki -tab for mediawiki namespace
 * 3) nstab-project -tab for project namespace
 * 4) nstab-user -tab for user namespace
 * 5) nstab-image -tab for file namespace
 * 6) nstab-template -tab for template namespace
 * 7) nstab-category -tab for category namespace
 * 8) nstab-custom_namespace_here -tab for any custom namespace you have created
 * 9) talk -tab for talkpages
 * 10) viewsource -edit tab for anonymous users
 * 11) edit - edit tab for registered users
 * 12) history - history tabs
 * 13) move - move tab
 * 14) watch - watch tab
 * 15) addsection - new section/+
 * hideSysop - this section hold tabs that should be hidden from sysops. Possible options are:
 * 1) nstab-main -tab for main namespace
 * 2) nstab-mediawiki -tab for mediawiki namespace
 * 3) nstab-project -tab for project namespace
 * 4) nstab-user -tab for user namespace
 * 5) nstab-image -tab for file namespace
 * 6) nstab-template -tab for template namespace
 * 7) nstab-category -tab for category namespace
 * 8) nstab-custom_namespace_here -tab for any custom namespace you have created
 * 9) talk -tab for talkpages
 * 10) edit - edit tab
 * 11) history - history tabs
 * 12) move - move tab
 * 13) protect - protection tab
 * 14) delete - delete tab
 * 15) watch - watch tab
 * 16) addsection - new section/+

If you have a custom namespace called e.g. "Help" where users can ask questions related to the topic of an article, rather than discuss how to write the article it self (which is what the talkpage is for) you can do this:
 * nsTabs - this section allows you to add links to the same page in a specified namespace, similar to how the talk tab works.
 * 1) Help - adds a link to the corresponding page in help-namespace to every page. Note: The name of the namespace must be specified with uppercase on the first letter.


 * intLinks - this sections hold internal static links to pages on the wiki, for example:
 * 1) Main
 * 2) A page
 * 3) Main_page|Main
 * 4) A page


 * extLinks - this section holds external static links to pages off wiki, for example:
 * 1) - will display http://mediawiki.org as link text
 * 2) wikipedia - will display wikipedia as link text
 * 3) http://google.com - will display http://google.com as link text
 * 4) http://xkcd.com xkcd - will display xkcd as link text

For example your Mediawiki:DynamicTabs could look like this: Note: There is a li element among the tabs called "empty" (not listed above) without any link or text, which is only there since the ul element that hold the tabs need a li child in order to validate as xhtml transitional if you hide all other tabs. This should not be hidden (and can't be hidden from the web interface afaict).
 * hideUser
 * 1) viewsource
 * 2) edit
 * 3) talk
 * 4) history
 * 5) watch
 * 6) nstab-main
 * hideSysop
 * 1) talk
 * 2) nstab-main
 * nsTabs
 * 1) help
 * intLinks
 * 1) main
 * extLinks
 * 1) google

Register bugs
An issue tracker for this extension is located at Google code