Extension:GroupPermissionsManager/CustomTabs

What can this plugin do?
This plugin to the GroupPermissionsManager extension allows for content actions (tabs) to be hidden for those who could not view or access it, as well as allowing definition of custom tabs via an interface message.

Usage
This core plugin is dependent on the ExtendedPermissions core plugin to work properly.

If a user is unable to read a page or execute an action, that tab will be automatically hidden. As of right now, the variable $wgGPManagerShowEditTab can be set to true so that the edit tab is always shown even if the user isn't allowed to view page source.

The MediaWiki:Content actions message controls what tabs appear and what order they appear in. The default looks something like this:
 * ARTICLE
 * DISCUSSION
 * EDIT
 * NEWSECTION
 * HISTORY
 * DELETE
 * MOVE
 * PROTECT
 * WATCH

All of the above are "magic words" that automatically create one of the default tabs. If the user normally would not be able to see that tab, it won't be shown. It is recommended that you leave all of the above in the message.

New tabs can be defined in the format. The URL and name are required, and the permission is optional. Any wiki markup besides the opening bullet point is not allowed.
 * tab-url: the URL that the tab will be pointing to, may be one of the following (will be checked in the following order as well):
 * The name of a MediaWiki message
 * An internal page
 * A URL pointing to somewhere offsite
 * tab-name: the name of the tab that will appear (and is also the ID of the tab for CSS stylings). Can be one of the following (again parsed in order):
 * The name of a MediaWiki message
 * Plain text
 * permission: the permission required in order to be able to see the tab. This is optional, and if excluded, the ability to read the wiki will be checked.

An example of a few custom tabs follows. Please note that MediaWiki:Mainpage and MediaWiki:Mainpage-text both exist, and MediaWiki is a page on this wiki. MediaWiki:Google does not exist.
 * mainpage | mainpage-text
 * MediaWiki | The Main Page
 * http://www.google.com | google
 * Special:BlockIP | block someone! | block

This would produce four custom tabs. The first tab links to the main page of this wiki, since the contents of MediaWiki:Mainpage lead there. The contents of MediaWiki:Mainpage-text are displayed on the tab. The second one also links to the main page of this wiki, but is not a system message. The literal text "The Main Page" is shown on the tab. The third tab links to Google and has a literal "google" on the tab. The fourth tab links to Special:BlockIP with the literal text "block someone!", but only shows up for people who have the ability to block (sysops).

Download instructions
This plugin is a core plugin and as such is packaged with the extension. Please follow these directions to download either the full extension or just this plugin.

Installation
To install this plugin, place the .php file inside of the /plugins sub-directory of your GroupPermissionsManager extension. Then, browse to Special:Version of your wiki to confirm that "CustomTabs" appears in there.