Merge "Revert buggy MediaWiki UI change and dependent changes"
[lhc/web/wiklou.git] / includes / EditPage.php
index c96e1a5..a9925ff 100644 (file)
@@ -1892,8 +1892,14 @@ class EditPage {
                        ( ( $this->minoredit && !$this->isNew ) ? EDIT_MINOR : 0 ) |
                        ( $bot ? EDIT_FORCE_BOT : 0 );
 
-               $doEditStatus = $this->mArticle->doEditContent( $content, $this->summary, $flags,
-                                                                                                               false, null, $this->contentFormat );
+               $doEditStatus = $this->mArticle->doEditContent(
+                       $content,
+                       $this->summary,
+                       $flags,
+                       false,
+                       null,
+                       $content->getDefaultFormat()
+               );
 
                if ( !$doEditStatus->isOK() ) {
                        // Failure from doEdit()
@@ -1938,9 +1944,7 @@ class EditPage {
                        // Do this in its own transaction to reduce contention...
                        $dbw = wfGetDB( DB_MASTER );
                        $dbw->onTransactionIdle( function () use ( $dbw, $title, $watch, $wgUser, $fname ) {
-                               $dbw->begin( $fname );
                                WatchAction::doWatchOrUnwatch( $watch, $title, $wgUser );
-                               $dbw->commit( $fname );
                        } );
                }
        }
@@ -3549,22 +3553,22 @@ HTML
         * @return string
         */
        static function getEditToolbar() {
-               global $wgStylePath, $wgContLang, $wgLang, $wgOut;
+               global $wgContLang, $wgOut;
                global $wgEnableUploads, $wgForeignFileRepos;
 
                $imagesAvailable = $wgEnableUploads || count( $wgForeignFileRepos );
 
                /**
                 * $toolarray is an array of arrays each of which includes the
-                * filename of the button image (without path), the opening
-                * tag, the closing tag, optionally a sample text that is
+                * 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 = array(
                        array(
-                               'image'  => $wgLang->getImageFile( 'button-bold' ),
                                'id'     => 'mw-editbutton-bold',
                                'open'   => '\'\'\'',
                                'close'  => '\'\'\'',
@@ -3572,7 +3576,6 @@ HTML
                                'tip'    => wfMessage( 'bold_tip' )->text(),
                        ),
                        array(
-                               'image'  => $wgLang->getImageFile( 'button-italic' ),
                                'id'     => 'mw-editbutton-italic',
                                'open'   => '\'\'',
                                'close'  => '\'\'',
@@ -3580,7 +3583,6 @@ HTML
                                'tip'    => wfMessage( 'italic_tip' )->text(),
                        ),
                        array(
-                               'image'  => $wgLang->getImageFile( 'button-link' ),
                                'id'     => 'mw-editbutton-link',
                                'open'   => '[[',
                                'close'  => ']]',
@@ -3588,7 +3590,6 @@ HTML
                                'tip'    => wfMessage( 'link_tip' )->text(),
                        ),
                        array(
-                               'image'  => $wgLang->getImageFile( 'button-extlink' ),
                                'id'     => 'mw-editbutton-extlink',
                                'open'   => '[',
                                'close'  => ']',
@@ -3596,7 +3597,6 @@ HTML
                                'tip'    => wfMessage( 'extlink_tip' )->text(),
                        ),
                        array(
-                               'image'  => $wgLang->getImageFile( 'button-headline' ),
                                'id'     => 'mw-editbutton-headline',
                                'open'   => "\n== ",
                                'close'  => " ==\n",
@@ -3604,7 +3604,6 @@ HTML
                                'tip'    => wfMessage( 'headline_tip' )->text(),
                        ),
                        $imagesAvailable ? array(
-                               'image'  => $wgLang->getImageFile( 'button-image' ),
                                'id'     => 'mw-editbutton-image',
                                'open'   => '[[' . $wgContLang->getNsText( NS_FILE ) . ':',
                                'close'  => ']]',
@@ -3612,7 +3611,6 @@ HTML
                                'tip'    => wfMessage( 'image_tip' )->text(),
                        ) : false,
                        $imagesAvailable ? array(
-                               'image'  => $wgLang->getImageFile( 'button-media' ),
                                'id'     => 'mw-editbutton-media',
                                'open'   => '[[' . $wgContLang->getNsText( NS_MEDIA ) . ':',
                                'close'  => ']]',
@@ -3620,7 +3618,6 @@ HTML
                                'tip'    => wfMessage( 'media_tip' )->text(),
                        ) : false,
                        array(
-                               'image'  => $wgLang->getImageFile( 'button-nowiki' ),
                                'id'     => 'mw-editbutton-nowiki',
                                'open'   => "<nowiki>",
                                'close'  => "</nowiki>",
@@ -3628,7 +3625,6 @@ HTML
                                'tip'    => wfMessage( 'nowiki_tip' )->text(),
                        ),
                        array(
-                               'image'  => $wgLang->getImageFile( 'button-sig' ),
                                'id'     => 'mw-editbutton-signature',
                                'open'   => '--~~~~',
                                'close'  => '',
@@ -3636,7 +3632,6 @@ HTML
                                'tip'    => wfMessage( 'sig_tip' )->text(),
                        ),
                        array(
-                               'image'  => $wgLang->getImageFile( 'button-hr' ),
                                'id'     => 'mw-editbutton-hr',
                                'open'   => "\n----\n",
                                'close'  => '',
@@ -3652,7 +3647,8 @@ HTML
                        }
 
                        $params = array(
-                               $wgStylePath . '/common/images/' . $tool['image'],
+                               // Images are defined in ResourceLoaderEditToolbarModule
+                               false,
                                // Note that we use the tip both for the ALT tag and the TITLE tag of the image.
                                // Older browsers show a "speedtip" type message only for ALT.
                                // Ideally these should be different, realistically they