74 parent::__construct( $context, $linkRenderer );
77 $this->groupPermissionsLookup = $groupPermissionsLookup;
78 $this->linkBatchFactory = $linkBatchFactory;
96 $tables = [
'image',
'actor' ];
97 $fields = [
'img_name',
'img_timestamp',
'actor_user',
'actor_name' ];
99 $jconds = [
'actor' => [
'JOIN',
'actor_id=img_actor' ] ];
102 if ( $user !==
'' ) {
103 $conds[
'actor_name'] = $user;
107 $groupsWithBotPermission = $this->groupPermissionsLookup->getGroupsWithPermission(
'bot' );
109 if ( count( $groupsWithBotPermission ) ) {
110 $tables[] =
'user_groups';
111 $conds[
'ug_group'] =
null;
112 $jconds[
'user_groups'] = [
115 'ug_group' => $groupsWithBotPermission,
116 'ug_user = actor_user',
117 $dbr->expr(
'ug_expiry',
'=',
null )->or(
'ug_expiry',
'>=', $dbr->timestamp() )
124 $tables[] =
'recentchanges';
125 $conds[
'rc_type'] =
RC_LOG;
126 $conds[
'rc_log_type'] =
'upload';
127 $conds[
'rc_patrolled'] = RecentChange::PRC_UNPATROLLED;
128 $conds[
'rc_namespace'] =
NS_FILE;
130 $jconds[
'recentchanges'] = [
133 'rc_title = img_name',
134 'rc_actor = img_actor',
135 'rc_timestamp = img_timestamp'
148 if ( $user ===
'' ) {
149 $options[] =
'STRAIGHT_JOIN';
155 'join_conds' => $jconds,
157 'options' => $options,
164 return [ [
'img_timestamp',
'img_name' ] ];
168 if ( !$this->gallery ) {
170 $mode = $this->
getRequest()->getVal(
'gallerymode',
null );
172 $this->gallery = ImageGalleryBase::factory( $mode, $this->
getContext() );
175 $this->gallery = ImageGalleryBase::factory(
false, $this->
getContext() );
183 return $this->gallery->toHTML();
187 $this->mResult->seek( 0 );
188 $lb = $this->linkBatchFactory->newLinkBatch();
189 foreach ( $this->mResult as $row ) {
190 if ( $row->actor_user ) {
191 $lb->add(
NS_USER, $row->actor_name );
198 $username = $row->actor_name;
200 if ( ExternalUserNames::isExternal( $username ) ) {
201 $ul = htmlspecialchars( $username );
208 $time = $this->
getLanguage()->userTimeAndDate( $row->img_timestamp, $this->getUser() );
211 Title::makeTitle(
NS_FILE, $row->img_name ),
213 . htmlspecialchars( $time )
218 ImageGalleryBase::LOADING_LAZY
229class_alias( NewFilesPager::class,
'NewFilesPager' );
Class for exceptions thrown by ImageGalleryBase::factory().
getContext()
Get the base IContextSource object.
Utility class for creating and reading rows in the recentchanges table.
Interface for objects which can provide a MediaWiki context on request.