+ private function canAnonymousUsersCreatePages() {
+ $pm = MediaWikiServices::getInstance()->getPermissionManager();
+ return ( $pm->groupHasPermission( '*', 'createpage' ) ||
+ $pm->groupHasPermission( '*', 'createtalk' )
+ );
+ }
+
+ // Based on ContribsPager.php
+ function getNamespaceCond() {
+ $namespace = $this->opts->getValue( 'namespace' );
+ if ( $namespace === 'all' || $namespace === '' ) {
+ return [];
+ }
+
+ $namespace = intval( $namespace );
+ $invert = $this->opts->getValue( 'invert' );
+ $associated = $this->opts->getValue( 'associated' );
+
+ $eq_op = $invert ? '!=' : '=';
+ $bool_op = $invert ? 'AND' : 'OR';
+
+ $selectedNS = $this->mDb->addQuotes( $namespace );
+ if ( !$associated ) {
+ return [ "rc_namespace $eq_op $selectedNS" ];
+ }
+
+ $associatedNS = $this->mDb->addQuotes(
+ MediaWikiServices::getInstance()->getNamespaceInfo()->getAssociated( $namespace )
+ );
+ return [
+ "rc_namespace $eq_op $selectedNS " .
+ $bool_op .
+ " rc_namespace $eq_op $associatedNS"
+ ];
+ }
+