$cleanSummary = $wgParser->stripSectionName( $this->summary );
return wfMessage( 'newsectionsummary' )
->rawParams( $cleanSummary )->inContentLanguage()->text();
- } else {
- return $this->summary;
}
+ return $this->summary;
}
/**
}
protected function showStandardInputs( &$tabindex = 2 ) {
- global $wgOut;
+ global $wgOut, $wgUseMediaWikiUIEverywhere;
$wgOut->addHTML( "<div class='editOptions'>\n" );
if ( $this->section != 'new' ) {
$message = wfMessage( 'edithelppage' )->inContentLanguage()->text();
$edithelpurl = Skin::makeInternalOrExternalUrl( $message );
- $edithelp = '<a target="helpwindow" href="' . $edithelpurl . '">' .
- wfMessage( 'edithelp' )->escaped() . '</a> ' .
+ $attrs = array(
+ 'target' => 'helpwindow',
+ 'href' => $edithelpurl,
+ );
+ if ( $wgUseMediaWikiUIEverywhere ) {
+ $attrs['class'] = 'mw-ui-button mw-ui-quiet';
+ }
+ $edithelp = Html::element( 'a', $attrs, wfMessage( 'edithelp' )->text() ) .
wfMessage( 'newwindow' )->parse();
$wgOut->addHTML( " <span class='cancelLink'>{$cancel}</span>\n" );
* @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(),
- array( 'id' => 'mw-editform-cancel' ),
+ $attrs,
$cancelParams
);
}
* @return array
*/
public function getCheckboxes( &$tabindex, $checked ) {
- global $wgUser;
+ global $wgUser, $wgUseMediaWikiUIEverywhere;
$checkboxes = array();
'accesskey' => wfMessage( 'accesskey-minoredit' )->text(),
'id' => 'wpMinoredit',
);
- $checkboxes['minor'] =
+ $minorEditHtml =
Xml::check( 'wpMinoredit', $checked['minor'], $attribs ) .
" <label for='wpMinoredit' id='mw-editpage-minoredit'" .
Xml::expandAttributes( array( 'title' => Linker::titleAttrib( 'minoredit', 'withaccess' ) ) ) .
">{$minorLabel}</label>";
+
+ if ( $wgUseMediaWikiUIEverywhere ) {
+ $checkboxes['minor'] = Html::openElement( 'div', array( 'class' => 'mw-ui-checkbox' ) ) .
+ $minorEditHtml .
+ Html::closeElement( 'div' );
+ } else {
+ $checkboxes['minor'] = $minorEditHtml;
+ }
}
}
'accesskey' => wfMessage( 'accesskey-watch' )->text(),
'id' => 'wpWatchthis',
);
- $checkboxes['watch'] =
+ $watchThisHtml =
Xml::check( 'wpWatchthis', $checked['watch'], $attribs ) .
" <label for='wpWatchthis' id='mw-editpage-watch'" .
Xml::expandAttributes( array( 'title' => Linker::titleAttrib( 'watch', 'withaccess' ) ) ) .
">{$watchLabel}</label>";
+ if ( $wgUseMediaWikiUIEverywhere ) {
+ $checkboxes['watch'] = Html::openElement( 'div', array( 'class' => 'mw-ui-checkbox' ) ) .
+ $watchThisHtml .
+ Html::closeElement( 'div' );
+ } else {
+ $checkboxes['watch'] = $watchThisHtml;
+ }
}
wfRunHooks( 'EditPageBeforeEditChecks', array( &$this, &$checkboxes, &$tabindex ) );
return $checkboxes;
* @return array
*/
public function getEditButtons( &$tabindex ) {
+ global $wgUseMediaWikiUIEverywhere;
+
$buttons = array();
$attribs = array(
'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, '' );
++$tabindex; // use the same for preview and live preview
'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['live'] = '';
'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, '' );
wfRunHooks( 'EditPageBeforeEditButtons', array( &$this, &$buttons, &$tabindex ) );