// Parser related.
- /**
- * @var int
- * @todo Unused?
- */
- private $mContainsOldMagic = 0;
-
/** @var int */
protected $mContainsNewMagic = 0;
}
/**
- * 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.
*
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.
public function sectionEditLinksEnabled() {
return $this->mEnableSectionEditLinks;
}
+
+ /**
+ * Add ResourceLoader module styles for OOUI and set up the PHP implementation of it for use with
+ * MediaWiki and this OutputPage instance.
+ *
+ * @since 1.25
+ */
+ public function enableOOUI() {
+ OOUI\Theme::setSingleton( new OOUI\MediaWikiTheme() );
+ OOUI\Element::setDefaultDir( $this->getLanguage()->getDir() );
+ $this->addModuleStyles( 'oojs-ui.styles' );
+ }
}