X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FOutputPage.php;h=aa282a793f769022df95db4bcd35b093cd11465c;hb=ca3ac3dfb89d2e801a65565dd8186ff250cde3df;hp=5c146e4d25e38bbbc313be1a4bce4190524ab25a;hpb=7a6b7dd01b2b2666ef117d8e3a620f648a43d1bc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 5c146e4d25..aa282a793f 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -196,12 +196,6 @@ class OutputPage extends ContextSource { // Parser related. - /** - * @var int - * @todo Unused? - */ - private $mContainsOldMagic = 0; - /** @var int */ protected $mContainsNewMagic = 0; @@ -1379,7 +1373,8 @@ class OutputPage extends ContextSource { } /** - * 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. * @@ -1404,6 +1399,34 @@ class OutputPage extends ContextSource { 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->addModuleStyles( 'mediawiki.helplink' ); + $text = $this->msg( '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.