Use native MediaWiki linking to help pages

There was quite a small link under the main title in Special:Notifications
which pointed to a related help page. Now the OutputPage::addHelpLink()
method is used which moves this link to the upper right corner and allows
configuring this on-wiki (instead of LocalSettings.php or so).

Bug: T101057
Change-Id: Ib4aecee8006b8d71bb3cd86f1d4ebdfee9080870
This commit is contained in:
matejsuchanek 2016-05-27 14:55:43 +02:00
parent 5992e88f6e
commit 38adb78619
4 changed files with 3 additions and 33 deletions

View file

@ -121,9 +121,6 @@ $wgHooks['ResourceLoaderGetConfigVars'][] = 'EchoHooks::onResourceLoaderGetConfi
// Whether to turn on email batch function
$wgEchoEnableEmailBatch = true;
// URL for more information about the Echo notification system
$wgEchoHelpPage = '//www.mediawiki.org/wiki/Special:MyLanguage/Help:Notifications';
// Whether to use job queue to process web and email notifications, bypass the queue for now
// since it's taking more than an hour to run in mediawiki.org, this is not acceptable for the
// purpose of testing notification.

View file

@ -18,6 +18,8 @@ class SpecialNotifications extends SpecialPage {
$out = $this->getOutput();
$out->setPageTitle( $this->msg( 'echo-specialpage' )->text() );
$this->addHelpLink( 'Help:Notifications' );
$user = $this->getUser();
if ( $user->isAnon() ) {
// Redirect to login page and inform user of the need to login
@ -136,21 +138,8 @@ class SpecialNotifications extends SpecialPage {
* @return string HTML for the subtitle
*/
public function buildSubtitle() {
global $wgEchoHelpPage;
$lang = $this->getLanguage();
$subtitleLinks = array();
// More info link
$subtitleLinks[] = Html::element(
'a',
array(
'href' => $wgEchoHelpPage,
'id' => 'mw-echo-moreinfo-link',
'class' => 'mw-echo-special-header-link',
'title' => $this->msg( 'echo-more-info' )->text(),
'target' => '_blank'
),
$this->msg( 'echo-more-info' )->text()
);
// Preferences link
$subtitleLinks[] = Html::element(
'a',
@ -162,7 +151,7 @@ class SpecialNotifications extends SpecialPage {
),
$this->msg( 'preferences' )->text()
);
// using pipeList to make it easier to add some links in the future
return $lang->pipeList( $subtitleLinks );
}

View file

@ -30,22 +30,6 @@
opacity: 1.0;
}
}
#mw-echo-moreinfo-link {
display: inline-block;
margin: 0 3px;
/* @embed */
background-image: url(../icons/Help.png);
background-repeat: no-repeat;
background-position: 0 0;
filter: alpha(opacity=50);
opacity: 0.5;
&:hover {
filter: alpha(opacity=100);
opacity: 1.0;
}
}
}
.mw-echo-date-section {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 B