Change
9ca9c7ee931ec7fde5518d91593a69b16d98b13d introduced the
localisation messages for this, but they were never used.
If $wgEditSubmitButtonLabelPublish is true, the button will now use
'tooltip-publish' for title and 'accesskey-publish' for accesskey.
Bug: T185071
Change-Id: I7dd4edf99c97b2b12d8b18603bb29786c72283a5
public function getEditButtons( &$tabindex ) {
$buttons = [];
public function getEditButtons( &$tabindex ) {
$buttons = [];
+ $labelAsPublish =
+ $this->context->getConfig()->get( 'EditSubmitButtonLabelPublish' );
+
$buttonLabel = $this->context->msg( $this->getSubmitButtonLabel() )->text();
$buttonLabel = $this->context->msg( $this->getSubmitButtonLabel() )->text();
+ $buttonTooltip = $labelAsPublish ? 'publish' : 'save';
$buttons['save'] = new OOUI\ButtonInputWidget( [
'name' => 'wpSave',
$buttons['save'] = new OOUI\ButtonInputWidget( [
'name' => 'wpSave',
'label' => $buttonLabel,
'infusable' => true,
'type' => 'submit',
'label' => $buttonLabel,
'infusable' => true,
'type' => 'submit',
- 'title' => Linker::titleAttrib( 'save' ),
- 'accessKey' => Linker::accesskey( 'save' ),
+ // Messages used: tooltip-save, tooltip-publish
+ 'title' => Linker::titleAttrib( $buttonTooltip ),
+ // Messages used: accesskey-save, accesskey-publish
+ 'accessKey' => Linker::accesskey( $buttonTooltip ),
] );
$buttons['preview'] = new OOUI\ButtonInputWidget( [
] );
$buttons['preview'] = new OOUI\ButtonInputWidget( [
'label' => $this->context->msg( 'showpreview' )->text(),
'infusable' => true,
'type' => 'submit',
'label' => $this->context->msg( 'showpreview' )->text(),
'infusable' => true,
'type' => 'submit',
+ // Message used: tooltip-preview
'title' => Linker::titleAttrib( 'preview' ),
'title' => Linker::titleAttrib( 'preview' ),
+ // Message used: accesskey-preview
'accessKey' => Linker::accesskey( 'preview' ),
] );
'accessKey' => Linker::accesskey( 'preview' ),
] );
'label' => $this->context->msg( 'showdiff' )->text(),
'infusable' => true,
'type' => 'submit',
'label' => $this->context->msg( 'showdiff' )->text(),
'infusable' => true,
'type' => 'submit',
+ // Message used: tooltip-diff
'title' => Linker::titleAttrib( 'diff' ),
'title' => Linker::titleAttrib( 'diff' ),
+ // Message used: accesskey-diff
'accessKey' => Linker::accesskey( 'diff' ),
] );
'accessKey' => Linker::accesskey( 'diff' ),
] );