Revision: 45980
Author: werdna
Date: 2009-01-21 21:38:02 +0000 (Wed, 21 Jan 2009)
Log Message:
-----------
Code style: use arrays, instead of by-ref parameters for out-parameters.
Modified Paths:
--------------
branches/change-tagging/phase3/includes/ChangeTags.php
branches/change-tagging/phase3/includes/ChangesList.php
branches/change-tagging/phase3/includes/LogEventsList.php
branches/change-tagging/phase3/includes/PageHistory.php
branches/change-tagging/phase3/includes/specials/SpecialContributions.php
branches/change-tagging/phase3/includes/specials/SpecialNewpages.php
Modified: branches/change-tagging/phase3/includes/ChangeTags.php
===================================================================
--- branches/change-tagging/phase3/includes/ChangeTags.php 2009-01-21
21:33:03 UTC (rev 45979)
+++ branches/change-tagging/phase3/includes/ChangeTags.php 2009-01-21
21:38:02 UTC (rev 45980)
@@ -4,9 +4,11 @@
die;
class ChangeTags {
- static function formatSummaryRow( $tags, $page, &$classes ) {
+ static function formatSummaryRow( $tags, $page ) {
if (!$tags)
- return '';
+ return array('',array());
+
+ $classes = array();
$tags = explode( ',', $tags );
$displayTags = array();
@@ -19,7 +21,7 @@
$classes[] = "mw-tag-$tag";
}
- return '(' . implode( ', ', $displayTags ) . ')';
+ return array( '(' . implode( ', ', $displayTags ) . ')',
$classes );
}
## Basic utility method to add tags to a particular change, given its
rc_id, rev_id and/or log_id.
Modified: branches/change-tagging/phase3/includes/ChangesList.php
===================================================================
--- branches/change-tagging/phase3/includes/ChangesList.php 2009-01-21
21:33:03 UTC (rev 45979)
+++ branches/change-tagging/phase3/includes/ChangesList.php 2009-01-21
21:38:02 UTC (rev 45980)
@@ -386,7 +386,9 @@
}
# Tags, if any.
- $s .= ' ' . ChangeTags::formatSummaryRow(
$rc->mAttribs['ts_tags'], 'changeslist', &$classes);
+ list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow(
$rc->mAttribs['ts_tags'], 'changeslist' );
+ $classes = array_merge( $classes, $newClasses );
+ $s .= ' ' . $tagSummary;
## Classes
$classes = implode( ' ', $classes );
Modified: branches/change-tagging/phase3/includes/LogEventsList.php
===================================================================
--- branches/change-tagging/phase3/includes/LogEventsList.php 2009-01-21
21:33:03 UTC (rev 45979)
+++ branches/change-tagging/phase3/includes/LogEventsList.php 2009-01-21
21:38:02 UTC (rev 45980)
@@ -360,7 +360,8 @@
}
// Any tags...
- $tagDisplay = ChangeTags::formatSummaryRow( $row->ts_tags,
'logevent', &$classes );
+ list($tagDisplay, $newClasses) = ChangeTags::formatSummaryRow(
$row->ts_tags, 'logevent' );
+ $classes = array_merge( $classes, $newClasses );
if( $revert != '' ) {
$revert = '<span class="mw-logevent-actionlink">' .
$revert . '</span>';
Modified: branches/change-tagging/phase3/includes/PageHistory.php
===================================================================
--- branches/change-tagging/phase3/includes/PageHistory.php 2009-01-21
21:33:03 UTC (rev 45979)
+++ branches/change-tagging/phase3/includes/PageHistory.php 2009-01-21
21:38:02 UTC (rev 45980)
@@ -363,7 +363,9 @@
}
# Tags
- $s .= ' ' . ChangeTags::formatSummaryRow( $row->ts_tags,
'history', &$classes );
+ list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow(
$row->ts_tags, 'history' );
+ $classes = array_merge( $classes, $newClasses );
+ $s .= " $tagSummary";
wfRunHooks( 'PageHistoryLineEnding', array( $this, &$row , &$s
) );
Modified:
branches/change-tagging/phase3/includes/specials/SpecialContributions.php
===================================================================
--- branches/change-tagging/phase3/includes/specials/SpecialContributions.php
2009-01-21 21:33:03 UTC (rev 45979)
+++ branches/change-tagging/phase3/includes/specials/SpecialContributions.php
2009-01-21 21:38:02 UTC (rev 45980)
@@ -530,7 +530,9 @@
}
# Tags, if any.
- $ret .= ' ' . ChangeTags::formatSummaryRow( $row->ts_tags,
'contributions', &$classes );
+ list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow(
$row->ts_tags, 'contributions' );
+ $classes = array_merge( $classes, $newClasses );
+ $ret .= " $tagSummary";
// Let extensions add data
wfRunHooks( 'ContributionsLineEnding', array( &$this, &$ret,
$row ) );
Modified: branches/change-tagging/phase3/includes/specials/SpecialNewpages.php
===================================================================
--- branches/change-tagging/phase3/includes/specials/SpecialNewpages.php
2009-01-21 21:33:03 UTC (rev 45979)
+++ branches/change-tagging/phase3/includes/specials/SpecialNewpages.php
2009-01-21 21:38:02 UTC (rev 45980)
@@ -266,7 +266,8 @@
$classes[] = 'not-patrolled';
# Tags, if any.
- $tagDisplay = ChangeTags::formatSummaryRow( $result->ts_tags,
'newpages', &$classes );
+ list( $tagDisplay, $newClasses ) =
ChangeTags::formatSummaryRow( $result->ts_tags, 'newpages' );
+ $classes = array_merge( $classes, $newClasses );
$css = count($classes) ? ' class="'.implode( " ", $classes).'"'
: '';
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs