global $wgLang;
$bits = preg_split( '/\s*,\s*/', trim( $par ) );
foreach ( $bits as $bit ) {
- if ( 'shownav' == $bit )
+ if ( 'shownav' == $bit ) {
$this->showNavigation = true;
- if ( 'hideliu' === $bit )
+ }
+ if ( 'hideliu' === $bit ) {
$this->opts->setValue( 'hideliu', true );
- if ( 'hidepatrolled' == $bit )
+ }
+ if ( 'hidepatrolled' == $bit ) {
$this->opts->setValue( 'hidepatrolled', true );
- if ( 'hidebots' == $bit )
+ }
+ if ( 'hidebots' == $bit ) {
$this->opts->setValue( 'hidebots', true );
- if ( 'showredirs' == $bit )
+ }
+ if ( 'showredirs' == $bit ) {
$this->opts->setValue( 'hideredirs', false );
- if ( is_numeric( $bit ) )
+ }
+ if ( is_numeric( $bit ) ) {
$this->opts->setValue( 'limit', intval( $bit ) );
+ }
$m = array();
- if ( preg_match( '/^limit=(\d+)$/', $bit, $m ) )
- $this->opts->setValue( 'limit', intval($m[1]) );
+ if ( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) {
+ $this->opts->setValue( 'limit', intval( $m[1] ) );
+ }
// PG offsets not just digits!
- if ( preg_match( '/^offset=([^=]+)$/', $bit, $m ) )
- $this->opts->setValue( 'offset', intval($m[1]) );
- if ( preg_match( '/^username=(.*)$/', $bit, $m ) )
+ if ( preg_match( '/^offset=([^=]+)$/', $bit, $m ) ) {
+ $this->opts->setValue( 'offset', intval( $m[1] ) );
+ }
+ if ( preg_match( '/^username=(.*)$/', $bit, $m ) ) {
$this->opts->setValue( 'username', $m[1] );
+ }
if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) ) {
$ns = $wgLang->getNsIndex( $m[1] );
if( $ns !== false ) {
if( $pager->getNumRows() ) {
$navigation = '';
- if ( $this->showNavigation ) $navigation = $pager->getNavigationBar();
+ if ( $this->showNavigation ) {
+ $navigation = $pager->getNavigationBar();
+ }
$wgOut->addHTML( $navigation . $pager->getBody() . $navigation );
} else {
$wgOut->addWikiMsg( 'specialpage-empty' );
);
// Disable some if needed
- # FIXME: throws E_NOTICEs if not set; and doesn't obey hooks etc
- if ( $wgGroupPermissions['*']['createpage'] !== true )
- unset($filters['hideliu']);
+ # FIXME: throws E_NOTICEs if not set; and doesn't obey hooks etc.
+ if ( $wgGroupPermissions['*']['createpage'] !== true ) {
+ unset( $filters['hideliu'] );
+ }
- if ( !$wgUser->useNPPatrol() )
- unset($filters['hidepatrolled']);
+ if ( !$wgUser->useNPPatrol() ) {
+ unset( $filters['hidepatrolled'] );
+ }
$links = array();
$changed = $this->opts->getChangedValues();
- unset($changed['offset']); // Reset offset if query type changes
+ unset( $changed['offset'] ); // Reset offset if query type changes
$self = $this->getTitle();
foreach ( $filters as $key => $msg ) {
- $onoff = 1 - $this->opts->getValue($key);
+ $onoff = 1 - $this->opts->getValue( $key );
$link = $this->skin->link( $self, $showhide[$onoff], array(),
- array( $key => $onoff ) + $changed
+ array( $key => $onoff ) + $changed
);
$links[$key] = wfMsgHtml( $msg, $link );
}
$hidden = implode( "\n", $hidden );
$tagFilter = ChangeTags::buildTagFilterSelector( $tagFilterVal );
- if ($tagFilter)
+ if ( $tagFilter ) {
list( $tagFilterLabel, $tagFilterSelector ) = $tagFilter;
+ }
$form = Xml::openElement( 'form', array( 'action' => $wgScript ) ) .
Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) .
$tagFilterSelector .
"</td>
</tr>" ) : '' ) .
- ($wgEnableNewpagesUserFilter ?
+ ( $wgEnableNewpagesUserFilter ?
"<tr>
<td class='mw-label'>" .
Xml::label( wfMsg( 'newpages-username' ), 'mw-np-username' ) .
<td class='mw-input'>" .
Xml::input( 'username', 30, $userText, array( 'id' => 'mw-np-username' ) ) .
"</td>
- </tr>" : "" ) .
+ </tr>" : '' ) .
"<tr> <td></td>
<td class='mw-submit'>" .
Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
$query = array( 'redirect' => 'no' );
- if( $this->patrollable( $result ) )
+ if( $this->patrollable( $result ) ) {
$query['rcid'] = $result->rc_id;
+ }
$plink = $this->skin->linkKnown(
$title,
$tagDisplay = '';
}
- $css = count($classes) ? ' class="'.implode( " ", $classes).'"' : '';
+ $css = count( $classes ) ? ' class="' . implode( ' ', $classes ) . '"' : '';
return "<li{$css}>{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} {$tagDisplay}</li>\n";
}
$feed = new $wgFeedClasses[$type](
$this->feedTitle(),
wfMsgExt( 'tagline', 'parsemag' ),
- $this->getTitle()->getFullUrl() );
+ $this->getTitle()->getFullUrl()
+ );
$pager = new NewPagesPager( $this, $this->opts );
$limit = $this->opts->getValue( 'limit' );
$title->getFullURL(),
$date,
$this->feedItemAuthor( $row ),
- $comments);
+ $comments
+ );
} else {
return null;
}
function getTitle() {
static $title = null;
- if ( $title === null )
+ if ( $title === null ) {
$title = $this->mForm->getTitle();
+ }
return $title;
}
}
// Allow changes to the New Pages query
- wfRunHooks('SpecialNewpagesConditions', array(&$this, $this->opts, &$conds));
+ wfRunHooks( 'SpecialNewpagesConditions', array( &$this, $this->opts, &$conds ) );
$info = array(
'tables' => array( 'recentchanges', 'page' ),
- 'fields' => array( 'rc_namespace', 'rc_title', 'rc_cur_id', 'rc_user', 'rc_user_text', 'rc_comment',
- 'rc_timestamp', 'rc_patrolled', 'rc_id', 'page_len AS length', 'page_latest AS rev_id', 'ts_tags'),
+ 'fields' => array(
+ 'rc_namespace', 'rc_title', 'rc_cur_id', 'rc_user',
+ 'rc_user_text', 'rc_comment', 'rc_timestamp', 'rc_patrolled',
+ 'rc_id', 'page_len AS length', 'page_latest AS rev_id',
+ 'ts_tags'
+ ),
'conds' => $conds,
- 'options' => array( 'USE INDEX' => array('recentchanges' => $rcIndexes) ),
+ 'options' => array( 'USE INDEX' => array( 'recentchanges' => $rcIndexes ) ),
'join_conds' => array(
- 'page' => array('INNER JOIN', 'page_id=rc_cur_id'),
+ 'page' => array( 'INNER JOIN', 'page_id=rc_cur_id' ),
),
);
- ## Empty array for fields, it'll be set by us anyway.
+ // Empty array for fields, it'll be set by us anyway.
$fields = array();
- ## Modify query for tags
- ChangeTags::modifyDisplayQuery( $info['tables'],
- $fields,
- $info['conds'],
- $info['join_conds'],
- $info['options'],
- $this->opts['tagfilter'] );
+ // Modify query for tags
+ ChangeTags::modifyDisplayQuery(
+ $info['tables'],
+ $fields,
+ $info['conds'],
+ $info['join_conds'],
+ $info['options'],
+ $this->opts['tagfilter']
+ );
return $info;
}
$linkBatch->add( $row->rc_namespace, $row->rc_title );
}
$linkBatch->execute();
- return "<ul>";
+ return '<ul>';
}
function getEndBody() {
- return "</ul>";
+ return '</ul>';
}
}