Author: paolobenve
Description:
It would be useful, and yet very simple to implement to add the option that the sidebar is different for logged in and not logged in users.
According to the idea in http://www.mediawiki.org/wiki/Manual:Interface/Sidebar#Change_sidebar_content_when_logged_in_.28PHP.29 the following changes suffice:
- add two system variables (maybe better names are to be found)
- $wgTwoSidebars with default value false; if set to true shows a different sidebar for users not logged in
- $wgAlternateSidebar for the name of the sidebar for users not logged in, which defaults to Anon_sidebar or other better name
- in includes/Skin.php, function buildSidebar():
- at the beginning, add "global $wgUser, $wgTwoSidebars, $wgAlternateSidebar";
- change the line "$this->addToSidebar( $bar, 'sidebar' );" into:
if ($wgUser->isLoggedIn() && $wgTwoSidebars) $this->addToSidebar( $bar, 'sidebar' );
else $this->addToSidebar( $bar, $wgAlternateSidebar );
I personally tested this solution in my wiki and it works.
Hoping it could be implemented in mediawiki code.
Version: 1.21.x
Severity: enhancement