Index: trunk/extensions/Drafts/Drafts.hooks.php |
— | — | @@ -129,9 +129,7 @@ |
130 | 130 | if ( $wgUser->isAllowed( 'edit' ) && $wgUser->isLoggedIn() ) { |
131 | 131 | // Internationalization |
132 | 132 | wfLoadExtensionMessages( 'Drafts' ); |
133 | | - $accessKey = Linker::accesskey( 'drafts-save' ); |
134 | | - $titleAttrib = Linker::titleAttrib( 'drafts-save', 'withaccess' ); |
135 | | - |
| 133 | + |
136 | 134 | // Build XML |
137 | 135 | $buttons['savedraft'] = Xml::openElement( 'script', |
138 | 136 | array( |
— | — | @@ -139,32 +137,37 @@ |
140 | 138 | 'language' => 'javascript' |
141 | 139 | ) |
142 | 140 | ); |
| 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 | + |
143 | 158 | $ajaxButton = Xml::escapeJsString( |
144 | 159 | 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 | + ) |
154 | 165 | ) |
155 | 166 | ); |
156 | 167 | $buttons['savedraft'] .= "document.write( '{$ajaxButton}' );"; |
157 | 168 | $buttons['savedraft'] .= Xml::closeElement( 'script' ); |
158 | 169 | $buttons['savedraft'] .= Xml::openElement( 'noscript' ); |
159 | 170 | $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 |
169 | 172 | ); |
170 | 173 | $buttons['savedraft'] .= Xml::closeElement( 'noscript' ); |
171 | 174 | $buttons['savedraft'] .= Xml::element( 'input', |
Property changes on: trunk/extensions/Drafts/Drafts.hooks.php |
___________________________________________________________________ |
Deleted: svn:mergeinfo |