r42932 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42931‎ | r42932 | r42933 >
Date:18:59, 31 October 2008
Author:raymond
Status:old
Tags:
Comment:
Fix for r42891 per patch of Simetrical in bug 16153.
Modified paths:
  • /trunk/extensions/Drafts/Drafts.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Drafts/Drafts.hooks.php
@@ -129,9 +129,7 @@
130130 if ( $wgUser->isAllowed( 'edit' ) && $wgUser->isLoggedIn() ) {
131131 // Internationalization
132132 wfLoadExtensionMessages( 'Drafts' );
133 - $accessKey = Linker::accesskey( 'drafts-save' );
134 - $titleAttrib = Linker::titleAttrib( 'drafts-save', 'withaccess' );
135 -
 133+
136134 // Build XML
137135 $buttons['savedraft'] = Xml::openElement( 'script',
138136 array(
@@ -139,32 +137,37 @@
140138 'language' => 'javascript'
141139 )
142140 );
 141+
 142+ $buttonAttribs = array(
 143+ 'id' => 'wpDraftSave',
 144+ 'name' => 'wpDraftSave',
 145+ 'tabindex' => 8,
 146+ 'value' => wfMsg( 'drafts-save-save' ),
 147+ );
 148+
 149+ $accesskey = $wgUser->getSkin()->accesskey( 'drafts-save' );
 150+ if ( $accesskey !== false ) {
 151+ $buttonAttribs['accesskey'] = $accesskey;
 152+ }
 153+ $tooltip = $wgUser->getSkin()->titleAttrib( 'drafts-save', 'withaccess' );
 154+ if ( $tooltip !== false ) {
 155+ $buttonAttribs['title'] = $tooltip;
 156+ }
 157+
143158 $ajaxButton = Xml::escapeJsString(
144159 Xml::element( 'input',
145 - array(
146 - 'type' => 'button',
147 - 'id' => 'wpDraftSave',
148 - 'name' => 'wpDraftSave',
149 - 'tabindex' => 8,
150 - 'accesskey' => $accessKey,
151 - 'value' => wfMsg( 'drafts-save-save' ),
152 - 'title' => $titleAttrib,
153 - ) + ( $wgRequest->getText( 'action' ) !== 'submit' ? array ( 'disabled' => 'disabled' ) : array() )
 160+ array( 'type' => 'button' ) + $buttonAttribs
 161+ + ( $wgRequest->getText( 'action' ) !== 'submit' ?
 162+ array ( 'disabled' => 'disabled' )
 163+ : array()
 164+ )
154165 )
155166 );
156167 $buttons['savedraft'] .= "document.write( '{$ajaxButton}' );";
157168 $buttons['savedraft'] .= Xml::closeElement( 'script' );
158169 $buttons['savedraft'] .= Xml::openElement( 'noscript' );
159170 $buttons['savedraft'] .= Xml::element( 'input',
160 - array(
161 - 'type' => 'submit',
162 - 'id' => 'wpDraftSave',
163 - 'name' => 'wpDraftSave',
164 - 'tabindex' => 8,
165 - 'accesskey' => $accessKey,
166 - 'value' => wfMsg( 'drafts-save-save' ),
167 - 'title' => $titleAttrib,
168 - )
 171+ array( 'type' => 'submit' ) + $buttonAttribs
169172 );
170173 $buttons['savedraft'] .= Xml::closeElement( 'noscript' );
171174 $buttons['savedraft'] .= Xml::element( 'input',
Property changes on: trunk/extensions/Drafts/Drafts.hooks.php
___________________________________________________________________
Deleted: svn:mergeinfo

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r42891Make accesskey configurable by a MediaWiki message using linker functions...raymond11:06, 31 October 2008

Status & tagging log