mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-24 14:23:53 +00:00
Merge "Hygiene: Various cleanup in Minerva PHP code"
This commit is contained in:
commit
efcc4792a4
|
@ -71,7 +71,7 @@ final class Definitions {
|
|||
$group->insert( 'contribs' )
|
||||
->addComponent(
|
||||
$this->context->msg( 'mobile-frontend-main-menu-contributions' )->escaped(),
|
||||
SpecialPage::getTitleFor( 'Contributions', $this->user->getName() )->getLocalUrl(),
|
||||
SpecialPage::getTitleFor( 'Contributions', $this->user->getName() )->getLocalURL(),
|
||||
MinervaUI::iconClass( 'contributions', 'before' ),
|
||||
[ 'data-event-name' => 'contributions' ]
|
||||
);
|
||||
|
@ -142,7 +142,7 @@ final class Definitions {
|
|||
$group->insert( 'auth', false )
|
||||
->addComponent(
|
||||
$username,
|
||||
Title::newFromText( $username, NS_USER )->getLocalUrl(),
|
||||
Title::newFromText( $username, NS_USER )->getLocalURL(),
|
||||
MinervaUI::iconClass( 'profile', 'before', 'truncated-text primary-action' ),
|
||||
[ 'data-event-name' => 'profile' ]
|
||||
)
|
||||
|
@ -177,7 +177,7 @@ final class Definitions {
|
|||
$group->insert( 'home' )
|
||||
->addComponent(
|
||||
$this->context->msg( 'mobile-frontend-home-button' )->escaped(),
|
||||
Title::newMainPage()->getLocalUrl(),
|
||||
Title::newMainPage()->getLocalURL(),
|
||||
MinervaUI::iconClass( 'home', 'before' ),
|
||||
[ 'data-event-name' => 'home' ]
|
||||
);
|
||||
|
@ -192,7 +192,7 @@ final class Definitions {
|
|||
// Random link
|
||||
$group->insert( 'random' )
|
||||
->addComponent( $this->context->msg( 'mobile-frontend-random-button' )->escaped(),
|
||||
SpecialPage::getTitleFor( 'Randompage' )->getLocalUrl() . '#/random',
|
||||
SpecialPage::getTitleFor( 'Randompage' )->getLocalURL() . '#/random',
|
||||
MinervaUI::iconClass( 'random', 'before' ), [
|
||||
'id' => 'randomButton',
|
||||
'data-event-name' => 'random',
|
||||
|
@ -259,7 +259,7 @@ final class Definitions {
|
|||
$msg = $this->context->msg( 'aboutsite' );
|
||||
if ( $title && !$msg->isDisabled() ) {
|
||||
$group->insert( 'about' )
|
||||
->addComponent( $msg->text(), $title->getLocalUrl() );
|
||||
->addComponent( $msg->text(), $title->getLocalURL() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -273,7 +273,7 @@ final class Definitions {
|
|||
$msg = $this->context->msg( 'disclaimers' );
|
||||
if ( $title && !$msg->isDisabled() ) {
|
||||
$group->insert( 'disclaimers' )
|
||||
->addComponent( $msg->text(), $title->getLocalUrl() );
|
||||
->addComponent( $msg->text(), $title->getLocalURL() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -262,7 +262,7 @@ class MinervaTemplate extends BaseTemplate {
|
|||
'headinghtml' => isset( $data['headinghtml'] ) ? $data['headinghtml'] : '',
|
||||
'postheadinghtml' => isset( $data['postheadinghtml'] ) ? $data['postheadinghtml'] : '',
|
||||
'haspageactions' => $hasPageActions,
|
||||
'pageactionshtml' => $hasPageActions ? $this->getPageActionsHtml( $data ) : '',
|
||||
'pageactionshtml' => $hasPageActions ? $this->getPageActionsHtml() : '',
|
||||
'subtitle' => $data['subtitle'],
|
||||
'contenthtml' => $this->getContentHtml( $data ),
|
||||
'secondaryactionshtml' => $this->getSecondaryActionsHtml(),
|
||||
|
|
|
@ -1125,20 +1125,15 @@ class SkinMinerva extends SkinTemplate {
|
|||
public function getContextSpecificModules() {
|
||||
$modules = [];
|
||||
$user = $this->getUser();
|
||||
$req = $this->getRequest();
|
||||
$title = $this->getTitle();
|
||||
|
||||
if ( !$title->isSpecialPage() ) {
|
||||
if ( $this->isAllowedPageAction( 'watch' ) ) {
|
||||
// Explicitly add the mobile watchstar code.
|
||||
$modules[] = 'skins.minerva.watchstar';
|
||||
}
|
||||
if ( !$title->isSpecialPage() && $this->isAllowedPageAction( 'watch' ) ) {
|
||||
// Explicitly add the mobile watchstar code.
|
||||
$modules[] = 'skins.minerva.watchstar';
|
||||
}
|
||||
|
||||
if ( $user->isLoggedIn() ) {
|
||||
if ( $this->useEcho() ) {
|
||||
$modules[] = 'skins.minerva.notifications';
|
||||
}
|
||||
if ( $user->isLoggedIn() && $this->useEcho() ) {
|
||||
$modules[] = 'skins.minerva.notifications';
|
||||
}
|
||||
|
||||
// TalkOverlay feature
|
||||
|
|
Loading…
Reference in a new issue