- global $wgOut, $wgEnableUploads, $wgForeignFileRepos;
-
- $imagesAvailable = $wgEnableUploads || count( $wgForeignFileRepos );
- $showSignature = true;
- if ( $title ) {
- $showSignature = MWNamespace::wantSignatures( $title->getNamespace() );
- }
-
- $contLang = MediaWikiServices::getInstance()->getContentLanguage();
-
- /**
- * $toolarray is an array of arrays each of which includes the
- * opening tag, the closing tag, optionally a sample text that is
- * inserted between the two when no selection is highlighted
- * and. The tip text is shown when the user moves the mouse
- * over the button.
- *
- * Images are defined in ResourceLoaderEditToolbarModule.
- */
- $toolarray = [
- [
- 'id' => 'mw-editbutton-bold',
- 'open' => '\'\'\'',
- 'close' => '\'\'\'',
- 'sample' => wfMessage( 'bold_sample' )->text(),
- 'tip' => wfMessage( 'bold_tip' )->text(),
- ],
- [
- 'id' => 'mw-editbutton-italic',
- 'open' => '\'\'',
- 'close' => '\'\'',
- 'sample' => wfMessage( 'italic_sample' )->text(),
- 'tip' => wfMessage( 'italic_tip' )->text(),
- ],
- [
- 'id' => 'mw-editbutton-link',
- 'open' => '[[',
- 'close' => ']]',
- 'sample' => wfMessage( 'link_sample' )->text(),
- 'tip' => wfMessage( 'link_tip' )->text(),
- ],
- [
- 'id' => 'mw-editbutton-extlink',
- 'open' => '[',
- 'close' => ']',
- 'sample' => wfMessage( 'extlink_sample' )->text(),
- 'tip' => wfMessage( 'extlink_tip' )->text(),
- ],
- [
- 'id' => 'mw-editbutton-headline',
- 'open' => "\n== ",
- 'close' => " ==\n",
- 'sample' => wfMessage( 'headline_sample' )->text(),
- 'tip' => wfMessage( 'headline_tip' )->text(),
- ],
- $imagesAvailable ? [
- 'id' => 'mw-editbutton-image',
- 'open' => '[[' . $contLang->getNsText( NS_FILE ) . ':',
- 'close' => ']]',
- 'sample' => wfMessage( 'image_sample' )->text(),
- 'tip' => wfMessage( 'image_tip' )->text(),
- ] : false,
- $imagesAvailable ? [
- 'id' => 'mw-editbutton-media',
- 'open' => '[[' . $contLang->getNsText( NS_MEDIA ) . ':',
- 'close' => ']]',
- 'sample' => wfMessage( 'media_sample' )->text(),
- 'tip' => wfMessage( 'media_tip' )->text(),
- ] : false,
- [
- 'id' => 'mw-editbutton-nowiki',
- 'open' => "<nowiki>",
- 'close' => "</nowiki>",
- 'sample' => wfMessage( 'nowiki_sample' )->text(),
- 'tip' => wfMessage( 'nowiki_tip' )->text(),
- ],
- $showSignature ? [
- 'id' => 'mw-editbutton-signature',
- 'open' => wfMessage( 'sig-text', '~~~~' )->inContentLanguage()->text(),
- 'close' => '',
- 'sample' => '',
- 'tip' => wfMessage( 'sig_tip' )->text(),
- ] : false,
- [
- 'id' => 'mw-editbutton-hr',
- 'open' => "\n----\n",
- 'close' => '',
- 'sample' => '',
- 'tip' => wfMessage( 'hr_tip' )->text(),
- ]
- ];