r81549 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81548‎ | r81549 | r81550 >
Date:00:58, 5 February 2011
Author:brion
Status:ok (Comments)
Tags:
Comment:
* (bug 27083) Extension info for Special:Version can include '...' as a special value which is turned into the localized 'others' used for Special:Version author lists.
Modified paths:
  • /trunk/extensions/ConfirmEdit/ConfirmEdit.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/ConfirmEdit.php
@@ -40,9 +40,7 @@
4141 $wgExtensionCredits['other'][] = array(
4242 'path' => __FILE__,
4343 'name' => 'ConfirmEdit',
44 - 'author' => 'Brion Vibber', /* Add "and others" here when you find
45 - * a way to do it properly with
46 - * i18n */
 44+ 'author' => array( 'Brion Vibber', '...' ),
4745 'url' => 'http://www.mediawiki.org/wiki/Extension:ConfirmEdit',
4846 'version' => '1.0',
4947 'descriptionmsg' => 'captcha-desc',
Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -445,7 +445,7 @@
446446
447447 $author = isset ( $extension['author'] ) ? $extension['author'] : array();
448448 $extDescAuthor = "<td>$description</td>
449 - <td>" . $this->listToText( (array)$author, false ) . "</td>
 449+ <td>" . $this->listAuthors( $author, false ) . "</td>
450450 </tr>\n";
451451
452452 return $extNameVer . $extDescAuthor;
@@ -513,6 +513,24 @@
514514 }
515515
516516 /**
 517+ * Return a formatted unsorted list of authors
 518+ *
 519+ * @param $authors mixed: string or array of strings
 520+ * @return String: HTML fragment
 521+ */
 522+ function listAuthors( $authors ) {
 523+ $list = array();
 524+ foreach( (array)$authors as $item ) {
 525+ if( $item == '...' ) {
 526+ $list[] = wfMsg( 'version-poweredby-others' );
 527+ } else {
 528+ $list[] = $item;
 529+ }
 530+ }
 531+ return $this->listToText( $list, false );
 532+ }
 533+
 534+ /**
517535 * Convert an array of items into a list for display.
518536 *
519537 * @param $list Array of elements to display

Sign-offs

UserFlagDate
Hasharinspected19:48, 14 February 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r81579Follow up r81549 to use ... for getting the localized 'others' on extensions ...platonides23:12, 5 February 2011

Comments

#Comment by Platonides (talk | contribs)   23:05, 5 February 2011

Need docs.

#Comment by Hashar (talk | contribs)   19:48, 14 February 2011

Can it be an explicit option such as : 'other_authors' => true

It would be self explanatory and probably less hackish than '...'

#Comment by Brion VIBBER (talk | contribs)   20:07, 14 February 2011

Hmmm... that actually would be a good way to provide a URL for the further authors (eg, supplementary to just the extension page link). Dunno if that's really needed though.

#Comment by Platonides (talk | contribs)   23:30, 15 February 2011

Yes. Some extensions already do that for other_authors, which means the ... can't be applied there.

#Comment by Hashar (talk | contribs)   16:34, 6 June 2011

I do not really like the hack, but it seems good enough anyway.

I have documented the change on the wiki: http://www.mediawiki.org/w/index.php?title=Manual:$wgExtensionCredits&diff=408056&oldid=399238

Status & tagging log