r97703 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97702‎ | r97703 | r97704 >
Date:07:41, 21 September 2011
Author:ialex
Status:ok
Tags:
Comment:
Per Nikerabbit, follow-up r97658: change getAuthor() into getPerformer() for consistency
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialLog.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogEventsList.php
@@ -779,7 +779,7 @@
780780 * @ingroup Pager
781781 */
782782 class LogPager extends ReverseChronologicalPager {
783 - private $types = array(), $author = '', $title = '', $pattern = '';
 783+ private $types = array(), $performer = '', $title = '', $pattern = '';
784784 private $typeCGI = '';
785785 public $mLogEventsList;
786786
@@ -788,7 +788,7 @@
789789 *
790790 * @param $list LogEventsList
791791 * @param $types String or Array: log types to show
792 - * @param $author String: the user who made the log entries
 792+ * @param $performer String: the user who made the log entries
793793 * @param $title String: the page title the log entries are for
794794 * @param $pattern String: do a prefix search rather than an exact title match
795795 * @param $conds Array: extra conditions for the query
@@ -796,7 +796,7 @@
797797 * @param $month Integer: the month to start from
798798 * @param $tagFilter String: tag
799799 */
800 - public function __construct( $list, $types = array(), $author = '', $title = '', $pattern = '',
 800+ public function __construct( $list, $types = array(), $performer = '', $title = '', $pattern = '',
801801 $conds = array(), $year = false, $month = false, $tagFilter = '' ) {
802802 parent::__construct( $list->getContext() );
803803 $this->mConds = $conds;
@@ -804,7 +804,7 @@
805805 $this->mLogEventsList = $list;
806806
807807 $this->limitType( $types ); // also excludes hidden types
808 - $this->limitAuthor( $author );
 808+ $this->limitPerformer( $performer );
809809 $this->limitTitle( $title, $pattern );
810810 $this->getDateCond( $year, $month );
811811 $this->mTagFilter = $tagFilter;
@@ -813,7 +813,7 @@
814814 public function getDefaultQuery() {
815815 $query = parent::getDefaultQuery();
816816 $query['type'] = $this->typeCGI; // arrays won't work here
817 - $query['user'] = $this->author;
 817+ $query['user'] = $this->performer;
818818 $query['month'] = $this->mMonth;
819819 $query['year'] = $this->mYear;
820820 return $query;
@@ -877,7 +877,7 @@
878878 *
879879 * @param $name String: (In)valid user name
880880 */
881 - private function limitAuthor( $name ) {
 881+ private function limitPerformer( $name ) {
882882 if( $name == '' ) {
883883 return false;
884884 }
@@ -901,7 +901,7 @@
902902 $this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::SUPPRESSED_USER) .
903903 ' != ' . LogPage::SUPPRESSED_USER;
904904 }
905 - $this->author = $usertitle->getText();
 905+ $this->performer = $usertitle->getText();
906906 }
907907 }
908908
@@ -985,7 +985,7 @@
986986 # Avoid usage of the wrong index by limiting
987987 # the choices of available indexes. This mainly
988988 # avoids site-breaking filesorts.
989 - } elseif( $this->title || $this->pattern || $this->author ) {
 989+ } elseif( $this->title || $this->pattern || $this->performer ) {
990990 $index['logging'] = array( 'page_time', 'user_time' );
991991 if( count($this->types) == 1 ) {
992992 $index['logging'][] = 'log_user_type_time';
@@ -1056,8 +1056,8 @@
10571057 /**
10581058 * @return string
10591059 */
1060 - public function getAuthor() {
1061 - return $this->author;
 1060+ public function getPerformer() {
 1061+ return $this->performer;
10621062 }
10631063
10641064 /**
Index: trunk/phase3/includes/specials/SpecialLog.php
@@ -106,12 +106,12 @@
107107 $this->addHeader( $opts->getValue( 'type' ) );
108108
109109 # Set relevant user
110 - if ( $pager->getAuthor() ) {
111 - $this->getSkin()->setRelevantUser( User::newFromName( $pager->getAuthor() ) );
 110+ if ( $pager->getPerformer() ) {
 111+ $this->getSkin()->setRelevantUser( User::newFromName( $pager->getPerformer() ) );
112112 }
113113
114114 # Show form options
115 - $loglist->showOptions( $pager->getType(), $pager->getAuthor(), $pager->getPage(), $pager->getPattern(),
 115+ $loglist->showOptions( $pager->getType(), $pager->getPerformer(), $pager->getPage(), $pager->getPattern(),
116116 $pager->getYear(), $pager->getMonth(), $pager->getFilterParams(), $opts->getValue( 'tagfilter' ) );
117117
118118 # Insert list

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97658* Made IndexPager extend ContextSource...ialex20:00, 20 September 2011

Status & tagging log