- if( $revision ) {
- return '<p>' . htmlspecialchars( $revision->getUserText() ) . wfMsgForContent( 'colon-separator' ) .
- htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
- "</p>\n<hr />\n<div>" .
- nl2br( htmlspecialchars( $revision->getText() ) ) . "</div>";
- }
- return '';
- }
-}
-
-/**
- * @ingroup SpecialPage Pager
- */
-class NewPagesPager extends ReverseChronologicalPager {
- // Stored opts
- protected $opts, $mForm;
-
- function __construct( $form, FormOptions $opts ) {
- parent::__construct();
- $this->mForm = $form;
- $this->opts = $opts;
- }
-
- function getTitle() {
- static $title = null;
- if ( $title === null )
- $title = $this->mForm->getTitle();
- return $title;
- }
-
- function getQueryInfo() {
- global $wgEnableNewpagesUserFilter, $wgGroupPermissions, $wgUser;
- $conds = array();
- $conds['rc_new'] = 1;
-
- $namespace = $this->opts->getValue( 'namespace' );
- $namespace = ( $namespace === 'all' ) ? false : intval( $namespace );
-
- $username = $this->opts->getValue( 'username' );
- $user = Title::makeTitleSafe( NS_USER, $username );
-
- if( $namespace !== false ) {
- $conds['rc_namespace'] = $namespace;
- $rcIndexes = array( 'new_name_timestamp' );
- } else {
- $rcIndexes = array( 'rc_timestamp' );
- }
-
- # $wgEnableNewpagesUserFilter - temp WMF hack
- if( $wgEnableNewpagesUserFilter && $user ) {
- $conds['rc_user_text'] = $user->getText();
- $rcIndexes = 'rc_user_text';
- # If anons cannot make new pages, don't "exclude logged in users"!
- } elseif( $wgGroupPermissions['*']['createpage'] && $this->opts->getValue( 'hideliu' ) ) {
- $conds['rc_user'] = 0;
- }
- # If this user cannot see patrolled edits or they are off, don't do dumb queries!
- if( $this->opts->getValue( 'hidepatrolled' ) && $wgUser->useNPPatrol() ) {
- $conds['rc_patrolled'] = 0;
- }
- if( $this->opts->getValue( 'hidebots' ) ) {
- $conds['rc_bot'] = 0;