}
protected function showStandardInputs( &$tabindex = 2 ) {
- global $wgOut, $wgUseMediaWikiUIEverywhere;
+ global $wgOut;
$wgOut->addHTML( "<div class='editOptions'>\n" );
if ( $this->section != 'new' ) {
'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();
* @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
);
}
)
);
- $script = 'mw.loader.using("mediawiki.action.edit", function() {';
+ $script = 'mw.loader.using("mediawiki.toolbar", function () {';
foreach ( $toolarray as $tool ) {
if ( !$tool ) {
continue;
* @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;