Extension:ProtectionIndicator


MediaWiki extensions manual
OOjs UI icon advanced.svg
ProtectionIndicator
Release status: beta
Screenshot of ProtectionIndicator extension.png
Implementation Parser extension , User interface
Description Adds a protection icon to the top of the page when a page is protected
Author(s) Sohom Datta (Sohom datatalk)
Latest version 0.1
License GNU General Public License 2.0 or later
Download
  • $wgShowIconsOnMainPage
  • $wgShowReasonInPopup
Translate the ProtectionIndicator extension if it is available at translatewiki.net
Check usage and version matrix.
Issues Open tasks · Report a bug

The ProtectionIndicator extension adds lock icons to the top left corner of the page based on the protection level of the page.

InstallationEdit

  • Download and place the file(s) in a directory called ProtectionIndicator in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'ProtectionIndicator' );
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension(). If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'ProtectionIndicator' );, you need to use:

require_once "$IP/extensions/ProtectionIndicator/ProtectionIndicator.php";

Configuration parametersEdit

$wgShowIconsOnMainPage
Adds the icons to the top of the Main Page of the Wiki if it is protected. False by default.
$wgShowLogInPopup
Adds the last log entry to the popup. True by default.

CSS configurationEdit

A particular file, MediaWiki:ProtectionIndicatorCustom.css is loaded by the extension while adding the icons. This file can be used to customize the icons. The css class names for the icons follow the format protectionindicator-extension-<level>-<action> and protectionindicator-extension-cascading-<level>-<action> for cascading protection. If you have flaggedrevs installed you can customise the flaggedrevs icons with the protectionindicator-extension-flaggedrevs-edit-flaggedrevs-<level> code. This feature can also be used to completely hide an icon from view.

Other stuffEdit

A parser tag, <suppressprotectionindicator/> can be used to prevent icons from appearing on a particular page.

Testing/Development/Bug fixingEdit

  • Clone the github repository into the extensions/ folder of a test MediaWiki installation (worked on mediawiki-docker-dev).
  • Add wfLoadExtension( 'ProtectionIndicator' ); to your LocalSettings.php file.
  • Test installation by navigating to a page which is protected.