r71076 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71075‎ | r71076 | r71077 >
Date:17:21, 14 August 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Work on Special:Extensions interface
Modified paths:
  • /trunk/extensions/Deployment/Deployment.i18n.php (modified) (history)
  • /trunk/extensions/Deployment/specials/SpecialExtensions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Deployment/specials/SpecialExtensions.php
@@ -148,7 +148,7 @@
149149 $name = Html::element(
150150 'a',
151151 array(
152 - 'href' => self::getTitle( $type )->getFullURL()
 152+ 'href' => self::getTitle( $type == 'all' ? null : $type )->getFullURL()
153153 ),
154154 $message
155155 );
@@ -201,7 +201,7 @@
202202 );
203203
204204 $listHtml .= '<tr>' .
205 - Html::element( 'th', array(), wfMsg( 'extensionlist-name' ) ) .
 205+ Html::element( 'th', array(), wfMsg( 'extension' ) ) .
206206 Html::element( 'th', array(), wfMsg( 'extensionlist-description' ) )
207207 . '</tr>';
208208
@@ -231,30 +231,12 @@
232232 $html .= Html::rawElement(
233233 'td',
234234 array(),
235 - Html::element( 'b', array(), $extension['name'] ) .
236 - '<br />' .
237 - Html::element(
238 - 'a',
239 - array(
240 - 'href' => $extension['url'],
241 - 'class' => 'external text'
242 - ),
243 - wfMsg( 'extensionlist-details' )
244 - ) .
245 - ' | ' .
246 - Html::element(
247 - 'a',
248 - array(
249 - 'href' => '',
250 - 'class' => 'external text'
251 - ),
252 - wfMsg( 'extensionlist-download' )
253 - )
 235+ $this->getItemNameTdContents( $extension )
254236 );
255237
256238 $description = self::getExtensionDescription( $extension );
257239 $authors = self::getExtensionAuthors( $extension );
258 - $version = self::getExtensionVersion( $extension );
 240+ $version = wfMsgExt( 'extensionlist-version-number', 'parsemag', self::getExtensionVersion( $extension ) );
259241
260242 $html .= Html::rawElement(
261243 'td',
@@ -266,6 +248,44 @@
267249 }
268250
269251 /**
 252+ * Returns the contents for the first field in an extension row.
 253+ * If the user has the required permissions, controls will be shown.
 254+ *
 255+ * @since 0.1
 256+ *
 257+ * @param $extension Array
 258+ *
 259+ * @return string
 260+ */
 261+ protected function getItemNameTdContents( array $extension ) {
 262+ $name = Html::element( 'b', array(), $extension['name'] );
 263+
 264+ $controls = array();
 265+
 266+ $controls[] = Html::element(
 267+ 'a',
 268+ array(
 269+ 'href' => $extension['url'],
 270+ 'class' => 'external text'
 271+ ),
 272+ wfMsg( 'extensionlist-details' )
 273+ );
 274+
 275+ // TODO: permission check
 276+ if ( true ) {
 277+ $controls[] = Html::element(
 278+ 'a',
 279+ array(
 280+ 'href' => '',
 281+ ),
 282+ wfMsg( 'extensionlist-deactivate' )
 283+ );
 284+ }
 285+
 286+ return $name . '<br />' . implode( ' | ', $controls );
 287+ }
 288+
 289+ /**
270290 * Returns the decription for an extension.
271291 *
272292 * @since 0.1
@@ -327,8 +347,7 @@
328348 * @return string
329349 */
330350 public static function getExtensionVersion( array $extension ) {
331 - // TODO: add "version " i18n stuff and escape
332 - return array_key_exists( 'version', $extension ) ? $extension['version'] : '';
 351+ return array_key_exists( 'version', $extension ) ? $extension['version'] : wfMsg( 'extensionlist-version-unknown' );
333352 }
334353
335354 }
\ No newline at end of file
Index: trunk/extensions/Deployment/Deployment.i18n.php
@@ -31,11 +31,28 @@
3232 'update-title' => 'MediaWiki updates',
3333 'install-title' => 'Install extensions',
3434
 35+ // Special:Extensions and Special:Install extension lists
 36+ 'extensionlist-name' => 'Name',
 37+ 'extensionlist-version' => 'Version',
 38+ 'extensionlist-version-number' => 'Version $1',
 39+ 'extensionlist-version-unknown' => 'unknown',
 40+ 'extensionlist-stability' => 'Stability',
 41+ 'extensionlist-rating' => 'Rating',
 42+ 'extensionlist-description' => 'Description',
 43+ 'extensionlist-details' => 'Details',
 44+ 'extensionlist-download' => 'Download',
 45+ 'extensionlist-installnow' => 'Install now',
 46+ 'extensionlist-createdby' => 'By $1',
 47+ 'extensionlist-deactivate' => 'Deactivate',
 48+ 'extensionlist-activate' => 'Activate',
 49+ 'extensionlist-delete' => 'Delete',
 50+
3551 // Special:Dashboard
3652
3753 // Special:Extensions
3854 'add-new-extensions' => 'Add new',
3955 'extension-type-all' => 'All',
 56+ 'extension-bulk-actions' => 'Bulk Actions',
4057
4158 // Special:Update
4259 'mediawiki-up-to-date' => 'You have the latest version of MediaWiki.',
@@ -53,16 +70,6 @@
5471 'popular-extension-tags' => 'Popular tags',
5572 'popular-extension-tags-long' => 'You may also browse based on the most popular tags in the Extension Repository:',
5673
57 - 'extensionlist-name' => 'Name',
58 - 'extensionlist-version' => 'Version',
59 - 'extensionlist-stability' => 'Stability',
60 - 'extensionlist-rating' => 'Rating',
61 - 'extensionlist-description' => 'Description',
62 - 'extensionlist-details' => 'Details',
63 - 'extensionlist-download' => 'Download',
64 - 'extensionlist-installnow' => 'Install now',
65 - 'extensionlist-createdby' => 'By $1.',
66 -
6774 'stability-alpha' => 'Alpha',
6875 'stability-beta' => 'Beta',
6976 'stability-dev' => 'Experimental',

Follow-up revisions

RevisionCommit summaryAuthorDate
r71077Follow up to r71076jeroendedauw17:38, 14 August 2010

Status & tagging log