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
This commit is contained in:
Stephan Gambke 2016-02-24 21:54:48 +01:00 committed by Jdlrobson
parent a59fc835be
commit 26f3f8c732
1 changed files with 22 additions and 0 deletions

View File

@ -499,10 +499,32 @@ class VectorTemplate extends BaseTemplate {
<h3 id="p-personal-label"><?php $this->msg( 'personaltools' ) ?></h3>
<ul<?php $this->html( 'userlangattributes' ) ?>>
<?php
$notLoggedIn = '';
if ( !$this->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;
}
?>
</ul>
</div>