All the chosen targets are translatable public domain help pages
on MediaWiki.org. Mostly special pages and actions for privileged
users for now.
Adapted from the Translate extension, credit to Niklas Laxström
(TranslateUtils::addSpecialHelpLink).
Depends on
6f5b29ff4e6fdf21b5a8cacaf10d6aceaee26a7d, whose commit
message has a typo addIndicator() instead of setIndicator().
Bug: T45591
Change-Id: I2934b1708a0d207dcf3d940264f140613646f203
16 files changed:
- * Add an array of indicators, with their identifiers as array keys and HTML contents as values.
+ * Add an array of indicators, with their identifiers as array
+ * keys and HTML contents as values.
*
* In case of duplicate keys, existing values are overwritten.
*
*
* In case of duplicate keys, existing values are overwritten.
*
return $this->mIndicators;
}
return $this->mIndicators;
}
+ /**
+ * Adds help link with an icon via page indicators.
+ * @param string $to
+ * @param bool $overrideBaseUrl
+ * @since 1.25
+ */
+ public function addHelpLink( $to, $overrideBaseUrl = false ) {
+ $this->addModules( 'mediawiki.helplink' );
+ $text = wfMessage( 'helppage-top-gethelp' )->escaped();
+
+ if ( $overrideBaseUrl ) {
+ $helpUrl = $to;
+ } else {
+ $helpUrl = "//www.mediawiki.org/wiki/Special:MyLanguage/$to";
+ }
+ $link = Html::rawElement(
+ 'a',
+ array(
+ 'href' => $helpUrl,
+ 'target' => '_blank',
+ 'class' => 'mw-helplink',
+ ),
+ $text
+ );
+
+ $this->setIndicators( array( 'mw-helplink' => $link ) );
+ }
+
/**
* Do not allow scripts which can be modified by wiki users to load on this page;
* only allow scripts bundled with, or generated by, the software.
/**
* Do not allow scripts which can be modified by wiki users to load on this page;
* only allow scripts bundled with, or generated by, the software.
}
public function show() {
}
public function show() {
+ $out = $this->getOutput();
if ( $this->getContext()->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
if ( $this->getContext()->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
- $out = $this->getOutput();
$out->addModuleStyles( array(
'mediawiki.ui.input',
'mediawiki.ui.checkbox',
) );
}
$out->addModuleStyles( array(
'mediawiki.ui.input',
'mediawiki.ui.checkbox',
) );
}
+ $out->addHelpLink( 'Help:Sysop deleting and undeleting' );
$this->page->delete();
}
}
$this->page->delete();
}
}
$this->outputHeader( 'allmessagestext' );
$out->addModuleStyles( 'mediawiki.special' );
$this->outputHeader( 'allmessagestext' );
$out->addModuleStyles( 'mediawiki.special' );
+ $out->addHelpLink( 'Help:System message' );
$this->table = new AllmessagesTablePager(
$this,
$this->table = new AllmessagesTablePager(
$this,
$msg = $this->alreadyBlocked ? 'ipb-change-block' : 'ipbsubmit';
$form->setSubmitTextMsg( $msg );
$msg = $this->alreadyBlocked ? 'ipb-change-block' : 'ipbsubmit';
$form->setSubmitTextMsg( $msg );
+ $this->getOutput()->addHelpLink( 'Help:Blocking users' );
+
# Don't need to do anything if the form has been posted
if ( !$this->getRequest()->wasPosted() && $this->preErrors ) {
$s = $form->formatErrors( $this->preErrors );
# Don't need to do anything if the form has been posted
if ( !$this->getRequest()->wasPosted() && $this->preErrors ) {
$s = $form->formatErrors( $this->preErrors );
if ( count( $errors ) ) {
$this->showMergeForm();
if ( count( $errors ) ) {
$this->showMergeForm();
- $this->getOutput()->addHTML( implode( "\n", $errors ) );
+ $out->addHTML( implode( "\n", $errors ) );
} else {
$this->showHistory();
}
}
function showMergeForm() {
} else {
$this->showHistory();
}
}
function showMergeForm() {
- $this->getOutput()->addWikiMsg( 'mergehistory-header' );
+ $out = $this->getOutput();
+ $out->addWikiMsg( 'mergehistory-header' );
- $this->getOutput()->addHTML(
Xml::openElement( 'form', array(
'method' => 'get',
'action' => wfScript() ) ) .
Xml::openElement( 'form', array(
'method' => 'get',
'action' => wfScript() ) ) .
'</fieldset>' .
'</form>'
);
'</fieldset>' .
'</form>'
);
+
+ $out->addHelpLink( 'Help:Merge history' );
}
private function showHistory() {
}
private function showHistory() {
$out = $this->getOutput();
$out->setPageTitle( $this->msg( 'move-page', $this->oldTitle->getPrefixedText() ) );
$out->addModules( 'mediawiki.special.movePage' );
$out = $this->getOutput();
$out->setPageTitle( $this->msg( 'move-page', $this->oldTitle->getPrefixedText() ) );
$out->addModules( 'mediawiki.special.movePage' );
+ $out->addHelpLink( 'Help:Moving a page' );
$newTitle = $this->newTitle;
$newTitle = $this->newTitle;
$this->setHeaders();
$this->outputHeader();
$this->setHeaders();
$this->outputHeader();
+ $out = $this->getOutput();
+ $out->addHelpLink( 'Help:New images' );
+
$pager = new NewFilesPager( $this->getContext(), $par );
if ( !$this->including() ) {
$pager = new NewFilesPager( $this->getContext(), $par );
if ( !$this->including() ) {
$form->displayForm( '' );
}
$form->displayForm( '' );
}
- $this->getOutput()->addHTML( $pager->getBody() );
+ $out->addHTML( $pager->getBody() );
if ( !$this->including() ) {
if ( !$this->including() ) {
- $this->getOutput()->addHTML( $pager->getNavigationBar() );
+ $out->addHTML( $pager->getNavigationBar() );
$this->showNavigation = !$this->including(); // Maybe changed in setup
$this->setup( $par );
$this->showNavigation = !$this->including(); // Maybe changed in setup
$this->setup( $par );
+ $out->addHelpLink( 'Help:New pages' );
+
if ( !$this->including() ) {
// Settings
$this->form();
if ( !$this->including() ) {
// Settings
$this->form();
+ $out->addHelpLink( 'Help:Undelete' );
if ( $this->mAllowed ) {
$out->setPageTitle( $this->msg( 'undeletepage' ) );
} else {
if ( $this->mAllowed ) {
$out->setPageTitle( $this->msg( 'undeletepage' ) );
} else {
throw new ErrorPageError( 'uploaddisabled', 'uploaddisabledtext' );
}
throw new ErrorPageError( 'uploaddisabled', 'uploaddisabledtext' );
}
+ $this->getOutput()->addHelpLink( 'Help:Managing files' );
+
# Check permissions
$user = $this->getUser();
$permissionRequired = UploadBase::isAllowed( $user );
# Check permissions
$user = $this->getUser();
$permissionRequired = UploadBase::isAllowed( $user );
$out = $this->getOutput();
$out->addModuleStyles( 'mediawiki.special' );
$out = $this->getOutput();
$out->addModuleStyles( 'mediawiki.special' );
+ $out->addHelpLink( 'Help:Assigning permissions' );
// show the general form
if ( count( $available['add'] ) || count( $available['remove'] ) ) {
// show the general form
if ( count( $available['add'] ) || count( $available['remove'] ) ) {
"edithelp": "Editing help",
"edithelppage": "https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Editing_pages",
"helppage": "https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents",
"edithelp": "Editing help",
"edithelppage": "https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Editing_pages",
"helppage": "https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents",
+ "helppage-top-gethelp": "Help",
"mainpage": "Main Page",
"mainpage-description": "Main page",
"policy-url": "Project:Policy",
"mainpage": "Main Page",
"mainpage-description": "Main page",
"policy-url": "Project:Policy",
"edithelp": "This is the text that appears on the editing help link that is near the bottom of the editing page",
"edithelppage": "The help page displayed when a user clicks on editing help link which is present on the right of Show changes button.\n{{doc-important|Do not change the \"<tt>Help:</tt>\" part.}}",
"helppage": "{{ignored}}\nThe link destination used by default in the sidebar, and in {{msg-mw|Noarticletext}}.",
"edithelp": "This is the text that appears on the editing help link that is near the bottom of the editing page",
"edithelppage": "The help page displayed when a user clicks on editing help link which is present on the right of Show changes button.\n{{doc-important|Do not change the \"<tt>Help:</tt>\" part.}}",
"helppage": "{{ignored}}\nThe link destination used by default in the sidebar, and in {{msg-mw|Noarticletext}}.",
+ "helppage-top-gethelp": "Link to some MediaWiki.org help page or tutorial.\n{{Identical|Help}}",
"mainpage": "Defines the link and display name of the main page of the wiki. Shown as the top link in the navigation part of the interface. Please do not change it too often, that could break things!\n\nSee also:\n* {{msg-mw|Mainpage}}\n* {{msg-mw|Accesskey-n-mainpage}}\n* {{msg-mw|Tooltip-n-mainpage}}\n{{Identical|Main page}}",
"mainpage-description": "The same as {{msg-mw|mainpage}}, used as link text on [[MediaWiki:Sidebar]].\n\nThis makes it possible to the change the link destination (the message \"mainpage\") without changing the link text or without disabling translations.\n\nSee also:\n* {{msg-mw|Mainpage-description}}\n* {{msg-mw|Accesskey-n-mainpage-description}}\n* {{msg-mw|Tooltip-n-mainpage-description}}\n{{Identical|Main page}}",
"policy-url": "{{doc-important|Do not change the <code>Project:</code> part.}}\nThe URL of the project page describing the policies of the wiki.\n\nThis is shown below every page (the left link).",
"mainpage": "Defines the link and display name of the main page of the wiki. Shown as the top link in the navigation part of the interface. Please do not change it too often, that could break things!\n\nSee also:\n* {{msg-mw|Mainpage}}\n* {{msg-mw|Accesskey-n-mainpage}}\n* {{msg-mw|Tooltip-n-mainpage}}\n{{Identical|Main page}}",
"mainpage-description": "The same as {{msg-mw|mainpage}}, used as link text on [[MediaWiki:Sidebar]].\n\nThis makes it possible to the change the link destination (the message \"mainpage\") without changing the link text or without disabling translations.\n\nSee also:\n* {{msg-mw|Mainpage-description}}\n* {{msg-mw|Accesskey-n-mainpage-description}}\n* {{msg-mw|Tooltip-n-mainpage-description}}\n{{Identical|Main page}}",
"policy-url": "{{doc-important|Do not change the <code>Project:</code> part.}}\nThe URL of the project page describing the policies of the wiki.\n\nThis is shown below every page (the left link).",
+ 'mediawiki.helplink' => array(
+ 'styles' => array(
+ 'resources/src/mediawiki/mediawiki.helplink.css',
+ ),
+ 'targets' => array( 'desktop', 'mobile' ),
+ ),
'mediawiki.hidpi' => array(
'scripts' => 'resources/src/mediawiki/mediawiki.hidpi.js',
'dependencies' => array(
'mediawiki.hidpi' => array(
'scripts' => 'resources/src/mediawiki/mediawiki.hidpi.js',
'dependencies' => array(
--- /dev/null
+#mw-indicator-mw-helplink a {
+ /* @embed */
+ background: url(images/help.png) no-repeat scroll left center transparent;
+ padding-left: 20px;
+}