Merge "Split mediawiki.toolbar from mediawiki.action.edit"
[lhc/web/wiklou.git] / includes / EditPage.php
index fab5c14..c330231 100644 (file)
@@ -3190,7 +3190,7 @@ HTML
        }
 
        protected function showStandardInputs( &$tabindex = 2 ) {
-               global $wgOut, $wgUseMediaWikiUIEverywhere;
+               global $wgOut;
                $wgOut->addHTML( "<div class='editOptions'>\n" );
 
                if ( $this->section != 'new' ) {
@@ -3222,10 +3222,8 @@ HTML
                        'target' => 'helpwindow',
                        'href' => $edithelpurl,
                );
-               if ( $wgUseMediaWikiUIEverywhere ) {
-                       $attrs['class'] = 'mw-ui-button mw-ui-quiet';
-               }
-               $edithelp = Html::element( 'a', $attrs, wfMessage( 'edithelp' )->text() ) .
+               $edithelp = Html::linkButton( wfMessage( 'edithelp' )->text(),
+                       $attrs, array( 'mw-ui-quiet' ) ) .
                        wfMessage( 'word-separator' )->escaped() .
                        wfMessage( 'newwindow' )->parse();
 
@@ -3268,20 +3266,16 @@ HTML
         * @return string
         */
        public function getCancelLink() {
-               global $wgUseMediaWikiUIEverywhere;
                $cancelParams = array();
                if ( !$this->isConflict && $this->oldid > 0 ) {
                        $cancelParams['oldid'] = $this->oldid;
                }
                $attrs = array( 'id' => 'mw-editform-cancel' );
-               if ( $wgUseMediaWikiUIEverywhere ) {
-                       $attrs['class'] = 'mw-ui-button mw-ui-quiet';
-               }
 
                return Linker::linkKnown(
                        $this->getContextTitle(),
                        wfMessage( 'cancel' )->parse(),
-                       $attrs,
+                       Html::buttonAttributes( $attrs, array( 'mw-ui-quiet' ) ),
                        $cancelParams
                );
        }
@@ -3750,47 +3744,33 @@ HTML
         * @return array
         */
        public function getEditButtons( &$tabindex ) {
-               global $wgUseMediaWikiUIEverywhere;
-
                $buttons = array();
 
                $attribs = array(
                        'id' => 'wpSave',
                        'name' => 'wpSave',
-                       'type' => 'submit',
                        'tabindex' => ++$tabindex,
-                       'value' => wfMessage( 'savearticle' )->text(),
                ) + Linker::tooltipAndAccesskeyAttribs( 'save' );
-               if ( $wgUseMediaWikiUIEverywhere ) {
-                       $attribs['class'] = 'mw-ui-button mw-ui-constructive';
-               }
-               $buttons['save'] = Xml::element( 'input', $attribs, '' );
+               $buttons['save'] = Html::submitButton( wfMessage( 'savearticle' )->text(),
+                       $attribs, array( 'mw-ui-constructive' ) );
 
                ++$tabindex; // use the same for preview and live preview
                $attribs = array(
                        'id' => 'wpPreview',
                        'name' => 'wpPreview',
-                       'type' => 'submit',
                        'tabindex' => $tabindex,
-                       'value' => wfMessage( 'showpreview' )->text(),
                ) + Linker::tooltipAndAccesskeyAttribs( 'preview' );
-               if ( $wgUseMediaWikiUIEverywhere ) {
-                       $attribs['class'] = 'mw-ui-button mw-ui-progressive';
-               }
-               $buttons['preview'] = Xml::element( 'input', $attribs, '' );
+               $buttons['preview'] = Html::submitButton( wfMessage( 'showpreview' )->text(),
+                       $attribs, array( 'mw-ui-progressive' ) );
                $buttons['live'] = '';
 
                $attribs = array(
                        'id' => 'wpDiff',
                        'name' => 'wpDiff',
-                       'type' => 'submit',
                        'tabindex' => ++$tabindex,
-                       'value' => wfMessage( 'showdiff' )->text(),
                ) + Linker::tooltipAndAccesskeyAttribs( 'diff' );
-               if ( $wgUseMediaWikiUIEverywhere ) {
-                       $attribs['class'] = 'mw-ui-button mw-ui-progressive';
-               }
-               $buttons['diff'] = Xml::element( 'input', $attribs, '' );
+               $buttons['diff'] = Html::submitButton( wfMessage( 'showdiff' )->text(),
+                       $attribs, array( 'mw-ui-progressive' ) );
 
                wfRunHooks( 'EditPageBeforeEditButtons', array( &$this, &$buttons, &$tabindex ) );
                return $buttons;