Extension:HideSidebar
From MediaWiki.org
|
|
The author of this extension is no longer maintaining it! Meaning any reports for additional features and/or bugfixes will more than likely be ignored. Volunteers are encouraged to take on the task of developing and maintaining it. As a courtesy, you may want to contact the author. You should also remove this template and list yourself as maintaining the extension in the page's {{extensions}} infobox. |
This extension suppresses display of the sidebar from anonymous users. Cribbed from Manual:Interface/Sidebar#Change sidebar content when logged in .28PHP.29.
|
HideSidebar Release status: beta |
|||
|---|---|---|---|
| Implementation | Skin | ||
| Description | Hide sidebar from anonymous users | ||
| Author(s) | JlernerTalk | ||
| Last version | 1.0.1 (2011-09-07) | ||
| MediaWiki | 1.14+ | ||
| License | GPL 2 or later | ||
| Download | below | ||
|
|||
|
Check usage (experimental) |
|||
Contents |
[edit] Download instructions
Please cut and paste the code found below and place it in $IP/extensions/HideSidebar/HideSidebar.php. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.
[edit] Installation
To install this extension, add the following to LocalSettings.php:
require_once("$IP/extensions/HideSidebar/HideSidebar.php");
[edit] Configuration parameters
[edit] User rights
[edit] Code
<?php if ( !defined( 'MEDIAWIKI' ) ) { echo "Not a valid entry point"; exit( 1 ); } $wgExtensionCredits['other'][] = array( 'path' => __FILE__, 'name' => 'HideSidebar', 'version' => '1.0.1', 'author' => 'Jlerner', 'url' => 'http://www.mediawiki.org/wiki/Extension:HideSidebar', 'description' => 'Allows to hide the sidebar from anonymos users', ); $wgHooks['SkinBuildSidebar'][] = 'efHideSidebar'; function efHideSidebar($skin, &$bar) { global $wgUser; // Hide sidebar for anonymous users if (!$wgUser->isLoggedIn()) { $url = Title::makeTitle(NS_SPECIAL, wfMsg('login'))->getLocalUrl(); $bar = array( 'navigation' => array( array('text' => 'Login', 'href' => $url, 'id' => 'n-login', 'active' => '') ) ); } return true; }