I want to add the Login link to the sidebar and used the **Special:UserLogin previousely and had some Java Script to return to the current page.
In MediaWiki 1.27 this stopped working and I have been searching for a solution to get this working again. I found this -
==========
$wgHooks['SkinBuildSidebar'][] = 'lfHideSidebar'; function lfHideSidebar( $skin, &$bar ) { global $wgUser; // Hide sidebar for anonymous users if ( !$wgUser->isLoggedIn() ) { $bar = array( 'navigation' => array( array( 'text' => wfMessage( 'login' ) -> text(), 'href' => SpecialPage::getTitleFor( 'Login' )->getLocalURL(), 'id' => 'n-login', 'active' => '' ) ) ); } return true; }
=========
Does anyone know how to use addReturnTo() with the getLocalURL(), or someother way to return to the current page after login?
SpecialPage::getTitleFor( 'UserLogin' )->getLocalURL( [ 'returnto' => $skin->getTitle()->getPrefixedText(), ] );
Thank you
Thats perfect
________________________________ From: MediaWiki-l mediawiki-l-bounces@lists.wikimedia.org on behalf of Bartosz Dziewonski matma.rex@gmail.com Sent: Wednesday, November 2, 2016 11:10 AM To: MediaWiki announcements and site admin list Subject: Re: [MediaWiki-l] Special:UserLogin return to current page
SpecialPage::getTitleFor( 'UserLogin' )->getLocalURL( [ 'returnto' => $skin->getTitle()->getPrefixedText(), ] );
-- Bartosz Dziewonski
_______________________________________________ MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l Mailing List - Wikimediahttps://lists.wikimedia.org/mailman/listinfo/mediawiki-l lists.wikimedia.org MediaWiki-l MediaWiki announcements and site admin list. This is a multilingual list for help/support with running/configuring MediaWiki. It is intended for people ...
mediawiki-l@lists.wikimedia.org