X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FChangesList.php;h=451f2da5949e473a285155c1064beeedb7d58f8d;hb=797e52dd0534ee102240cb78eb71fcce95a3153e;hp=e98fcac4526f3200043833c254b1d19f0115fbdc;hpb=db3e3bcb4825b663fb4075d94645633fe03b218e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ChangesList.php b/includes/ChangesList.php index e98fcac452..451f2da594 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -30,7 +30,7 @@ */ class RCCacheEntry extends RecentChange { var $secureName, $link; - var $curlink , $difflink, $lastlink, $usertalklink, $versionlink; + var $curlink, $difflink, $lastlink, $usertalklink, $versionlink; var $userlink, $timestamp, $watched; /** @@ -80,7 +80,7 @@ class ChangesList extends ContextSource { * This first argument used to be an User object. * * @deprecated in 1.18; use newFromContext() instead - * @param $unused string|User Unused + * @param string|User $unused Unused * @return ChangesList|EnhancedChangesList|OldChangesList derivative */ public static function newFromUser( $unused ) { @@ -130,13 +130,13 @@ class ChangesList extends ContextSource { /** * Returns the appropriate flags for new page, minor change and patrolling - * @param $flags Array Associative array of 'flag' => Bool - * @param $nothing String to use for empty space + * @param array $flags Associative array of 'flag' => Bool + * @param string $nothing to use for empty space * @return String */ protected function recentChangesFlags( $flags, $nothing = ' ' ) { $f = ''; - foreach( array( 'newpage', 'minor', 'bot', 'unpatrolled' ) as $flag ){ + foreach( array( 'newpage', 'minor', 'bot', 'unpatrolled' ) as $flag ) { $f .= isset( $flags[$flag] ) && $flags[$flag] ? self::flag( $flag ) : $nothing; @@ -150,7 +150,7 @@ class ChangesList extends ContextSource { * unpatrolled edit. By default in English it will contain "N", "m", "b", * "!" respectively, plus it will have an appropriate title and class. * - * @param $flag String: 'newpage', 'unpatrolled', 'minor', or 'bot' + * @param string $flag 'newpage', 'unpatrolled', 'minor', or 'bot' * @return String: Raw HTML */ public static function flag( $flag ) { @@ -217,7 +217,7 @@ class ChangesList extends ContextSource { $lang = $context->getLanguage(); $code = $lang->getCode(); static $fastCharDiff = array(); - if ( !isset($fastCharDiff[$code]) ) { + if ( !isset( $fastCharDiff[$code] ) ) { $fastCharDiff[$code] = $wgMiserMode || $context->msg( 'rc-change-size' )->plain() === '$1'; } @@ -287,7 +287,7 @@ class ChangesList extends ContextSource { } /** - * @param $s string HTML to update + * @param string $s HTML to update * @param $rc_timestamp mixed */ public function insertDateHeader( &$s, $rc_timestamp ) { @@ -304,7 +304,7 @@ class ChangesList extends ContextSource { } /** - * @param $s string HTML to update + * @param string $s HTML to update * @param $title Title * @param $logtype string */ @@ -315,7 +315,7 @@ class ChangesList extends ContextSource { } /** - * @param $s string HTML to update + * @param string $s HTML to update * @param $rc RecentChange * @param $unpatrolled */ @@ -328,7 +328,7 @@ class ChangesList extends ContextSource { } else { $query = array( 'curid' => $rc->mAttribs['rc_cur_id'], - 'diff' => $rc->mAttribs['rc_this_oldid'], + 'diff' => $rc->mAttribs['rc_this_oldid'], 'oldid' => $rc->mAttribs['rc_last_oldid'] ); @@ -358,7 +358,7 @@ class ChangesList extends ContextSource { } /** - * @param $s string HTML to update + * @param string $s HTML to update * @param $rc RecentChange * @param $unpatrolled * @param $watched @@ -378,7 +378,7 @@ class ChangesList extends ContextSource { array( 'class' => 'mw-changeslist-title' ), $params ); - if( $this->isDeleted($rc,Revision::DELETED_TEXT) ) { + if( $this->isDeleted( $rc, Revision::DELETED_TEXT ) ) { $articlelink = '' . $articlelink . ''; } # To allow for boldening pages watched by this user @@ -387,7 +387,7 @@ class ChangesList extends ContextSource { $articlelink .= $this->getLanguage()->getDirMark(); wfRunHooks( 'ChangesListInsertArticleLink', - array(&$this, &$articlelink, &$s, &$rc, $unpatrolled, $watched) ); + array( &$this, &$articlelink, &$s, &$rc, $unpatrolled, $watched ) ); $s .= " $articlelink"; } @@ -407,7 +407,7 @@ class ChangesList extends ContextSource { /** * Insert time timestamp string from $rc into $s * - * @param $s string HTML to update + * @param string $s HTML to update * @param $rc RecentChange */ public function insertTimestamp( &$s, $rc ) { @@ -534,14 +534,14 @@ class ChangesList extends ContextSource { $page = $rc->getTitle(); /** Check for rollback and edit permissions, disallow special pages, and only * show a link on the top-most revision */ - if ( $this->getUser()->isAllowed('rollback') && $rc->mAttribs['page_latest'] == $rc->mAttribs['rc_this_oldid'] ) + if ( $this->getUser()->isAllowed( 'rollback' ) && $rc->mAttribs['page_latest'] == $rc->mAttribs['rc_this_oldid'] ) { $rev = new Revision( array( - 'title' => $page, - 'id' => $rc->mAttribs['rc_this_oldid'], - 'user' => $rc->mAttribs['rc_user'], + 'title' => $page, + 'id' => $rc->mAttribs['rc_this_oldid'], + 'user' => $rc->mAttribs['rc_user'], 'user_text' => $rc->mAttribs['rc_user_text'], - 'deleted' => $rc->mAttribs['rc_deleted'] + 'deleted' => $rc->mAttribs['rc_deleted'] ) ); $s .= ' '.Linker::generateRollback( $rev, $this->getContext() ); } @@ -554,10 +554,10 @@ class ChangesList extends ContextSource { * @param $classes */ public function insertTags( &$s, &$rc, &$classes ) { - if ( empty($rc->mAttribs['ts_tags']) ) + if ( empty( $rc->mAttribs['ts_tags'] ) ) return; - list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow( $rc->mAttribs['ts_tags'], 'changeslist' ); + list( $tagSummary, $newClasses ) = ChangeTags::formatSummaryRow( $rc->mAttribs['ts_tags'], 'changeslist' ); $classes = array_merge( $classes, $newClasses ); $s .= ' ' . $tagSummary; } @@ -579,7 +579,6 @@ class ChangesList extends ContextSource { } } - /** * Generate a list of changes using the good old system (no javascript) */ @@ -588,8 +587,8 @@ class OldChangesList extends ChangesList { * Format a line using the old system (aka without any javascript). * * @param $rc RecentChange, passed by reference - * @param $watched Bool (default false) - * @param $linenumber Int (default null) + * @param bool $watched (default false) + * @param int $linenumber (default null) * * @return string|bool */ @@ -679,7 +678,7 @@ class OldChangesList extends ChangesList { } if( $this->watchlist ) { - $classes[] = Sanitizer::escapeClass( 'watchlist-'.$rc->mAttribs['rc_namespace'].'-'.$rc->mAttribs['rc_title'] ); + $classes[] = Sanitizer::escapeClass( 'watchlist-' . $rc->mAttribs['rc_namespace'] . '-' . $rc->mAttribs['rc_title'] ); } if ( !wfRunHooks( 'OldChangesListRecentChangesLine', array( &$this, &$s, $rc, &$classes ) ) ) { @@ -688,11 +687,10 @@ class OldChangesList extends ChangesList { } wfProfileOut( __METHOD__ ); - return "$dateheader