From 26f3f8c7329eec51cdf86869dbbc05cbe754741a Mon Sep 17 00:00:00 2001 From: Stephan Gambke Date: Wed, 24 Feb 2016 21:54:48 +0100 Subject: [PATCH] Show "Not logged in" message Show "Not logged in" message left or right (depending on language) of an anon user's personal tools in case general edit permission is given. The display of the message was previously done in MW core (SkinTemplate::buildPersonalUrls, introduced by I6f44e3e5d), which needs to be reverted first (done in I5cfa9b4e). Bug: T127758 Depends-on: I5cfa9b4e Change-Id: Ic560d3fd4e9f6ad194e6ff928c8749084af311b5 --- VectorTemplate.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/VectorTemplate.php b/VectorTemplate.php index 5203926..7a02b36 100644 --- a/VectorTemplate.php +++ b/VectorTemplate.php @@ -499,10 +499,32 @@ class VectorTemplate extends BaseTemplate {

msg( 'personaltools' ) ?>

html( 'userlangattributes' ) ?>> getSkin()->getUser()->isLoggedIn() && + User::groupHasPermission( '*', 'edit' ) ){ + + $notLoggedIn = + Html::rawElement( 'li', + [ 'id' => 'pt-anonuserpage' ], + $this->getMsg( 'notloggedin' )->escaped() + ); + + } + + if ( !$this->data[ 'rtl' ] ) { + echo $notLoggedIn; + } + $personalTools = $this->getPersonalTools(); foreach ( $personalTools as $key => $item ) { echo $this->makeListItem( $key, $item ); } + + if ( $this->data[ 'rtl' ] ) { + echo $notLoggedIn; + } ?>