80 parent::__construct( $form->getContext() );
84 $this->hookRunner =
new HookRunner( $hookContainer );
96 $username = $this->opts->getValue(
'username' );
99 $size = abs( intval( $this->opts->getValue(
'size' ) ) );
101 if ( $this->opts->getValue(
'size-mode' ) ===
'max' ) {
102 $conds[] =
'page_len <= ' . $size;
104 $conds[] =
'page_len >= ' . $size;
109 $conds[] = $this->actorMigration->getWhere(
113 # If anons cannot make new pages, don't "exclude logged in users"!
114 $conds[] = $this->actorMigration->isAnon( $rcQuery[
'fields'][
'rc_user'] );
119 # If this user cannot see patrolled edits or they are off, don't do dumb queries!
120 if ( $this->opts->getValue(
'hidepatrolled' ) && $this->getUser()->useNPPatrol() ) {
124 if ( $this->opts->getValue(
'hidebots' ) ) {
125 $conds[
'rc_bot'] = 0;
128 if ( $this->opts->getValue(
'hideredirs' ) ) {
129 $conds[
'page_is_redirect'] = 0;
133 $tables = array_merge( $rcQuery[
'tables'], [
'page' ] );
134 $fields = array_merge( $rcQuery[
'fields'], [
135 'length' =>
'page_len',
'rev_id' =>
'page_latest',
'page_namespace',
'page_title',
136 'page_content_model',
138 $join_conds = [
'page' => [
'JOIN',
'page_id=rc_cur_id' ] ] + $rcQuery[
'joins'];
140 $this->hookRunner->onSpecialNewpagesConditions(
141 $this, $this->opts, $conds, $tables, $fields, $join_conds );
148 'join_conds' => $join_conds
158 $this->opts[
'tagfilter']
165 return $this->permissionManager->groupHasPermission(
'*',
'createpage' ) ||
166 $this->permissionManager->groupHasPermission(
'*',
'createtalk' );
171 $namespace = $this->opts->getValue(
'namespace' );
172 if ( $namespace ===
'all' || $namespace ===
'' ) {
176 $namespace = intval( $namespace );
182 $invert = $this->opts->getValue(
'invert' );
183 $associated = $this->opts->getValue(
'associated' );
185 $eq_op = $invert ?
'!=' :
'=';
186 $bool_op = $invert ?
'AND' :
'OR';
189 $selectedNS =
$dbr->addQuotes( $namespace );
190 if ( !$associated ) {
191 return [
"rc_namespace $eq_op $selectedNS" ];
194 $associatedNS =
$dbr->addQuotes(
195 $this->namespaceInfo->getAssociated( $namespace )
198 "rc_namespace $eq_op $selectedNS " .
200 " rc_namespace $eq_op $associatedNS"
205 return 'rc_timestamp';
209 return $this->mForm->formatRow( $row );
213 # Do a batch existence check on pages
214 $linkBatch = $this->linkBatchFactory->newLinkBatch();
215 foreach ( $this->mResult as $row ) {
216 $linkBatch->add(
NS_USER, $row->rc_user_text );
218 $linkBatch->add( $row->page_namespace, $row->page_title );
220 $linkBatch->execute();