mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-27 15:40:15 +00:00
Update personal tools for temp users, add icon for temp users
Bug: T335546 Change-Id: I56315440016cde3aad051b37895f713fbb5dd239
This commit is contained in:
parent
33b2b037a7
commit
d977c8d940
|
@ -20,6 +20,7 @@
|
|||
|
||||
namespace MediaWiki\Minerva\Menu\Main;
|
||||
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Minerva\Menu\Definitions;
|
||||
use MediaWiki\Minerva\Menu\Entries\SingleMenuEntry;
|
||||
use MediaWiki\Minerva\Menu\Group;
|
||||
|
@ -101,7 +102,10 @@ final class DefaultMainMenuBuilder implements IMainMenuBuilder {
|
|||
*/
|
||||
public function getSettingsGroup(): Group {
|
||||
$group = new Group( 'pt-preferences' );
|
||||
if ( $this->showMobileOptions && !$this->user->isRegistered() ) {
|
||||
// Show settings group for anon and temp users
|
||||
$userNameUtils = MediaWikiServices::getInstance()->getUserNameUtils();
|
||||
$isTemp = $userNameUtils->isTemp( $this->user->getName() );
|
||||
if ( $this->showMobileOptions && ( !$this->user->isRegistered() || $isTemp ) ) {
|
||||
$this->definitions->insertMobileOptionsItem( $group );
|
||||
}
|
||||
return $group;
|
||||
|
@ -125,6 +129,11 @@ final class DefaultMainMenuBuilder implements IMainMenuBuilder {
|
|||
[ 'login' ]
|
||||
);
|
||||
}
|
||||
$userNameUtils = MediaWikiServices::getInstance()->getUserNameUtils();
|
||||
$isTemp = $userNameUtils->isTemp( $this->user->getName() );
|
||||
if ( $isTemp ) {
|
||||
$excludeKeyList[] = 'mycontris';
|
||||
}
|
||||
foreach ( $personalTools as $key => $item ) {
|
||||
$href = $item['href'] ?? null;
|
||||
if ( $href && !in_array( $key, $excludeKeyList ) ) {
|
||||
|
|
Loading…
Reference in a new issue