Fix numerous class/function casing
[lhc/web/wiklou.git] / includes / specials / SpecialContributions.php
index e7ef168..7b8aa4c 100644 (file)
@@ -85,7 +85,7 @@ class SpecialContributions extends IncludableSpecialPage {
 
                        return;
                }
-               $id = $userObj->getID();
+               $id = $userObj->getId();
 
                if ( $this->opts['contribs'] != 'newbie' ) {
                        $target = $nt->getText();
@@ -1101,13 +1101,16 @@ class ContribsPager extends ReverseChronologicalPager {
                                $userlink = '';
                        }
 
-                       $flags = [];
                        if ( $rev->getParentId() === 0 ) {
-                               $flags[] = ChangesList::flag( 'newpage' );
+                               $nflag = ChangesList::flag( 'newpage' );
+                       } else {
+                               $nflag = '';
                        }
 
                        if ( $rev->isMinor() ) {
-                               $flags[] = ChangesList::flag( 'minor' );
+                               $mflag = ChangesList::flag( 'minor' );
+                       } else {
+                               $mflag = '';
                        }
 
                        $del = Linker::getRevDeleteLink( $user, $rev, $page );
@@ -1118,6 +1121,15 @@ class ContribsPager extends ReverseChronologicalPager {
                        $diffHistLinks = $this->msg( 'parentheses' )
                                ->rawParams( $difftext . $this->messages['pipe-separator'] . $histlink )
                                ->escaped();
+                       $ret = "{$del}{$d} {$diffHistLinks}{$chardiff}{$nflag}{$mflag} ";
+                       $ret .= "{$link}{$userlink} {$comment} {$topmarktext}";
+
+                       # Denote if username is redacted for this edit
+                       if ( $rev->isDeleted( Revision::DELETED_USER ) ) {
+                               $ret .= " <strong>" .
+                                       $this->msg( 'rev-deleted-user-contribs' )->escaped() .
+                                       "</strong>";
+                       }
 
                        # Tags, if any.
                        list( $tagSummary, $newClasses ) = ChangeTags::formatSummaryRow(
@@ -1126,48 +1138,20 @@ class ContribsPager extends ReverseChronologicalPager {
                                $this->getContext()
                        );
                        $classes = array_merge( $classes, $newClasses );
-
-                       $templateParams = [
-                               'articleLink' => $link,
-                               'charDifference' => $chardiff,
-                               'classes' => $classes,
-                               'diffHistLinks' => $diffHistLinks,
-                               'flags' => $flags,
-                               'logText' => $comment,
-                               'revDeleteLink' => $del,
-                               'tagSummary' => $tagSummary,
-                               'timestamp' => $d,
-                               'topmarktext' => $topmarktext,
-                               'userlink' => $userlink,
-                       ];
-
-                       # Denote if username is redacted for this edit
-                       if ( $rev->isDeleted( Revision::DELETED_USER ) ) {
-                               $templateParams['rev-deleted-user-contribs'] =
-                                       $this->msg( 'rev-deleted-user-contribs' )->escaped();
-                       }
-
-                       $templateParser = new TemplateParser();
-                       $ret = $templateParser->processTemplate(
-                               'SpecialContributionsLine',
-                               $templateParams
-                       );
+                       $ret .= " $tagSummary";
                }
 
                // Let extensions add data
-               Hooks::run( 'ContributionsLineEnding', [ $this, &$ret, $row, &$templateParams['classes'] ] );
+               Hooks::run( 'ContributionsLineEnding', [ $this, &$ret, $row, &$classes ] );
 
-               // TODO: Handle exceptions in the catch block above.  Do any extensions rely on
-               // receiving empty rows?
-
-               if ( $templateParams['classes'] === [] && $ret === '' ) {
+               if ( $classes === [] && $ret === '' ) {
                        wfDebug( "Dropping Special:Contribution row that could not be formatted\n" );
-                       return "<!-- Could not format Special:Contribution row. -->\n";
+                       $ret = "<!-- Could not format Special:Contribution row. -->\n";
+               } else {
+                       $ret = Html::rawElement( 'li', [ 'class' => $classes ], $ret ) . "\n";
                }
 
-               // FIXME: The signature of the ContributionsLineEnding hook makes it
-               // very awkward to move this LI wrapper into the template.
-               return Html::rawElement( 'li', [ 'class' => $templateParams['classes'] ], $ret ) . "\n";
+               return $ret;
        }
 
        /**