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