32 private int $migrationStage;
44 $this->migrationStage = $context->
getConfig()->get(
48 parent::__construct( $context, $linkRenderer );
50 $this->
setLimit( $opts->getValue(
'limit' ) );
54 if ( $opts->getValue(
'start' ) ) {
55 $startTimestamp = $opts->getValue(
'start' ) .
' 00:00:00';
57 if ( $opts->getValue(
'end' ) ) {
58 $endTimestamp = $opts->getValue(
'end' ) .
' 23:59:59';
69 $tables = [
'image' ];
70 $nameField =
'img_name';
71 $actorField =
'img_actor';
72 $timestampField =
'img_timestamp';
82 $tables = [
'filerevision',
'file' ];
83 $nameField =
'file_name';
84 $actorField =
'fr_actor';
85 $timestampField =
'fr_timestamp';
93 $jconds = [
'file' => [
'JOIN',
'file_latest=fr_id' ] ];
97 $jconds[
'actor'] = [
'JOIN',
'actor_id=' . $actorField ];
99 $user = $opts->getValue(
'user' );
100 if ( $user !==
'' ) {
101 $conds[
'actor_name'] = $user;
104 if ( !$opts->getValue(
'showbots' ) ) {
105 $groupsWithBotPermission = $this->groupPermissionsLookup->getGroupsWithPermission(
'bot' );
107 if ( count( $groupsWithBotPermission ) ) {
108 $tables[] =
'user_groups';
109 $conds[
'ug_group'] =
null;
110 $jconds[
'user_groups'] = [
113 'ug_group' => $groupsWithBotPermission,
114 'ug_user = actor_user',
115 $dbr->expr(
'ug_expiry',
'=',
null )->or(
'ug_expiry',
'>=', $dbr->timestamp() )
121 if ( $opts->getValue(
'hidepatrolled' ) ) {
122 $tables[] =
'recentchanges';
123 $conds[
'rc_source'] = RecentChange::SRC_LOG;
124 $conds[
'rc_log_type'] =
'upload';
125 $conds[
'rc_patrolled'] = RecentChange::PRC_UNPATROLLED;
126 $conds[
'rc_namespace'] =
NS_FILE;
128 $jconds[
'recentchanges'] = [
131 'rc_title = ' . $nameField,
132 'rc_actor = ' . $actorField,
133 'rc_timestamp = ' . $timestampField,
138 if ( $opts->getValue(
'mediatype' ) ) {
140 $conds[
'img_media_type'] = $opts->getValue(
'mediatype' );
142 $tables[] =
'filetypes';
143 $jconds[
'filetypes'] = [
'JOIN',
'file_type = ft_id' ];
144 $conds[
'ft_media_type'] = $opts->getValue(
'mediatype' );
152 if ( $user ===
'' ) {
153 $options[] =
'STRAIGHT_JOIN';
159 'join_conds' => $jconds,
161 'options' => $options,
170 return [ [
'img_timestamp',
'img_name' ] ];
172 return [ [
'fr_timestamp',
'fr_id' ] ];
178 if ( !$this->gallery ) {
180 $mode = $this->
getRequest()->getVal(
'gallerymode',
null );
182 $this->gallery = ImageGalleryBase::factory( $mode, $this->
getContext() );
185 $this->gallery = ImageGalleryBase::factory(
false, $this->
getContext() );
194 return $this->gallery->toHTML();
199 $this->mResult->seek( 0 );
200 $lb = $this->linkBatchFactory->newLinkBatch()->setCaller( __METHOD__ );
201 foreach ( $this->mResult as $row ) {
202 if ( $row->actor_user ) {
203 $lb->add(
NS_USER, $row->actor_name );
211 $username = $row->actor_name;
213 if ( ExternalUserNames::isExternal( $username ) ) {
214 $ul = htmlspecialchars( $username );
229 . htmlspecialchars( $time )
234 ImageGalleryBase::LOADING_LAZY
245class_alias( NewFilesPager::class,
'NewFilesPager' );
248class_alias( NewFilesPager::class,
'MediaWiki\\Pager\\NewFilesPager' );
const SCHEMA_COMPAT_READ_OLD
getContext()
Get the base IContextSource object.
A class containing constants representing the names of configuration variables.
const FileSchemaMigrationStage
Name constant for the FileSchemaMigrationStage setting, for use with Config::get()
Factory for LinkBatch objects to batch query page metadata.
Interface for objects which can provide a MediaWiki context on request.
getConfig()
Get the site configuration.