From a232f2c105b6b466949fe0b347efa1635fba782e Mon Sep 17 00:00:00 2001
From: Siebrand Mazeland '
- . $this->msg( 'javascripttest-pagetext-unknownframework', $par )->escaped()
- . ' ' .
+ $this->msg( 'javascripttest-pagetext-unknownframework', $par )->escaped() .
+ ' {$errMsg[0]}';
@@ -89,13 +95,16 @@ class SpecialJavaScriptTest extends SpecialPage {
$list .= Html::rawElement(
'li',
array(),
- Linker::link( $this->getTitle( $framework ), $this->msg( "javascripttest-$framework-name" )->escaped() )
+ Linker::link(
+ $this->getTitle( $framework ),
+ $this->msg( "javascripttest-$framework-name" )->escaped()
+ )
);
}
$list .= '
';
- $msg = $this->msg( 'javascripttest-pagetext-frameworks' )->rawParams( $list )->parseAsBlock();
- return $msg;
+ return $this->msg( 'javascripttest-pagetext-frameworks' )->rawParams( $list )
+ ->parseAsBlock();
}
/**
@@ -109,12 +118,14 @@ class SpecialJavaScriptTest extends SpecialPage {
*/
private function wrapSummaryHtml( $html, $state ) {
$validStates = array( 'noframework', 'unknownframework', 'frameworkfound' );
+
if ( !in_array( $state, $validStates ) ) {
throw new MWException( __METHOD__
. ' given an invalid state. Must be one of "'
. join( '", "', $validStates ) . '".'
);
}
+
return "' .
- Xml::element( 'th', null, $this->msg( 'listgrouprights-group' )->text() ) .
- Xml::element( 'th', null, $this->msg( 'listgrouprights-rights' )->text() ) .
+ Xml::element( 'th', null, $this->msg( 'listgrouprights-group' )->text() ) .
+ Xml::element( 'th', null, $this->msg( 'listgrouprights-rights' )->text() ) .
' '
);
@@ -124,8 +123,8 @@ class SpecialListGroupRights extends SpecialPage {
"
$grouppage$grouplink
" .
- $this->formatPermissions( $permissions, $revoke, $addgroups, $removegroups,
- $addgroupsSelf, $removegroupsSelf ) .
+ $this->formatPermissions( $permissions, $revoke, $addgroups, $removegroups,
+ $addgroupsSelf, $removegroupsSelf ) .
'
'
) );
@@ -168,8 +167,11 @@ class SpecialListGroupRights extends SpecialPage {
$r[] = $description;
}
}
+
sort( $r );
+
$lang = $this->getLanguage();
+
if ( $add === true ) {
$r[] = $this->msg( 'listgrouprights-addgroup-all' )->escaped();
} elseif ( is_array( $add ) && count( $add ) ) {
@@ -179,6 +181,7 @@ class SpecialListGroupRights extends SpecialPage {
count( $add )
)->parse();
}
+
if ( $remove === true ) {
$r[] = $this->msg( 'listgrouprights-removegroup-all' )->escaped();
} elseif ( is_array( $remove ) && count( $remove ) ) {
@@ -188,6 +191,7 @@ class SpecialListGroupRights extends SpecialPage {
count( $remove )
)->parse();
}
+
if ( $addSelf === true ) {
$r[] = $this->msg( 'listgrouprights-addgroup-self-all' )->escaped();
} elseif ( is_array( $addSelf ) && count( $addSelf ) ) {
@@ -197,6 +201,7 @@ class SpecialListGroupRights extends SpecialPage {
count( $addSelf )
)->parse();
}
+
if ( $removeSelf === true ) {
$r[] = $this->msg( 'listgrouprights-removegroup-self-all' )->parse();
} elseif ( is_array( $removeSelf ) && count( $removeSelf ) ) {
@@ -206,6 +211,7 @@ class SpecialListGroupRights extends SpecialPage {
count( $removeSelf )
)->parse();
}
+
if ( empty( $r ) ) {
return '';
} else {
diff --git a/includes/specials/SpecialListredirects.php b/includes/specials/SpecialListredirects.php
index 4401499d6e..2c8792ff6f 100644
--- a/includes/specials/SpecialListredirects.php
+++ b/includes/specials/SpecialListredirects.php
@@ -29,7 +29,6 @@
* @ingroup SpecialPage
*/
class ListredirectsPage extends QueryPage {
-
function __construct( $name = 'Listredirects' ) {
parent::__construct( $name );
}
@@ -50,16 +49,16 @@ class ListredirectsPage extends QueryPage {
return array(
'tables' => array( 'p1' => 'page', 'redirect', 'p2' => 'page' ),
'fields' => array( 'namespace' => 'p1.page_namespace',
- 'title' => 'p1.page_title',
- 'value' => 'p1.page_title',
- 'rd_namespace',
- 'rd_title',
- 'rd_fragment',
- 'rd_interwiki',
- 'redirid' => 'p2.page_id' ),
+ 'title' => 'p1.page_title',
+ 'value' => 'p1.page_title',
+ 'rd_namespace',
+ 'rd_title',
+ 'rd_fragment',
+ 'rd_interwiki',
+ 'redirid' => 'p2.page_id' ),
'conds' => array( 'p1.page_is_redirect' => 1 ),
'join_conds' => array( 'redirect' => array(
- 'LEFT JOIN', 'rd_from=p1.page_id' ),
+ 'LEFT JOIN', 'rd_from=p1.page_id' ),
'p2' => array( 'LEFT JOIN', array(
'p2.page_namespace=rd_namespace',
'p2.page_title=rd_title' ) ) )
@@ -78,10 +77,12 @@ class ListredirectsPage extends QueryPage {
*/
function preprocessResults( $db, $res ) {
$batch = new LinkBatch;
+
foreach ( $res as $row ) {
$batch->add( $row->namespace, $row->title );
$batch->addObj( $this->getRedirectTarget( $row ) );
}
+
$batch->execute();
// Back to start for display
@@ -100,6 +101,7 @@ class ListredirectsPage extends QueryPage {
} else {
$title = Title::makeTitle( $row->namespace, $row->title );
$article = WikiPage::factory( $title );
+
return $article->getRedirectTarget();
}
}
@@ -126,6 +128,7 @@ class ListredirectsPage extends QueryPage {
$lang = $this->getLanguage();
$arr = $lang->getArrow() . $lang->getDirMark();
$targetLink = Linker::link( $target );
+
return "$rd_link $arr $targetLink";
} else {
return "$rd_link";
diff --git a/includes/specials/SpecialListusers.php b/includes/specials/SpecialListusers.php
index d674b05493..75b8490594 100644
--- a/includes/specials/SpecialListusers.php
+++ b/includes/specials/SpecialListusers.php
@@ -49,7 +49,10 @@ class UsersPager extends AlphabeticPager {
$par = ( $par !== null ) ? $par : '';
$parms = explode( '/', $par );
$symsForAll = array( '*', 'user' );
- if ( $parms[0] != '' && ( in_array( $par, User::getAllGroups() ) || in_array( $par, $symsForAll ) ) ) {
+
+ if ( $parms[0] != '' &&
+ ( in_array( $par, User::getAllGroups() ) || in_array( $par, $symsForAll ) )
+ ) {
$this->requestedGroup = $par;
$un = $request->getText( 'username' );
} elseif ( count( $parms ) == 2 ) {
@@ -59,6 +62,7 @@ class UsersPager extends AlphabeticPager {
$this->requestedGroup = $request->getVal( 'group' );
$un = ( $par != '' ) ? $par : $request->getText( 'username' );
}
+
if ( in_array( $this->requestedGroup, $symsForAll ) ) {
$this->requestedGroup = '';
}
@@ -67,12 +71,15 @@ class UsersPager extends AlphabeticPager {
$this->including = $including;
$this->requestedUser = '';
+
if ( $un != '' ) {
$username = Title::makeTitleSafe( NS_USER, $un );
- if ( ! is_null( $username ) ) {
+
+ if ( !is_null( $username ) ) {
$this->requestedUser = $username->getText();
}
}
+
parent::__construct();
}
@@ -89,6 +96,7 @@ class UsersPager extends AlphabeticPager {
function getQueryInfo() {
$dbr = wfGetDB( DB_SLAVE );
$conds = array();
+
// Don't show hidden names
if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {
$conds[] = 'ipb_deleted IS NULL OR ipb_deleted = 0';
@@ -98,9 +106,8 @@ class UsersPager extends AlphabeticPager {
if ( $this->requestedGroup != '' ) {
$conds['ug_group'] = $this->requestedGroup;
- } else {
- //$options['USE INDEX'] = $this->creationSort ? 'PRIMARY' : 'user_name';
}
+
if ( $this->requestedUser != '' ) {
# Sorted either by account creation or name
if ( $this->creationSort ) {
@@ -109,6 +116,7 @@ class UsersPager extends AlphabeticPager {
$conds[] = 'user_name >= ' . $dbr->addQuotes( $this->requestedUser );
}
}
+
if ( $this->editsOnly ) {
$conds[] = 'user_editcount > 0';
}
@@ -129,15 +137,18 @@ class UsersPager extends AlphabeticPager {
'options' => $options,
'join_conds' => array(
'user_groups' => array( 'LEFT JOIN', 'user_id=ug_user' ),
- 'ipblocks' => array( 'LEFT JOIN', array(
- 'user_id=ipb_user',
- 'ipb_auto' => 0
- )),
+ 'ipblocks' => array(
+ 'LEFT JOIN', array(
+ 'user_id=ipb_user',
+ 'ipb_auto' => 0
+ )
+ ),
),
'conds' => $conds
);
wfRunHooks( 'SpecialListusersQueryInfo', array( $this, &$query ) );
+
return $query;
}
@@ -153,12 +164,17 @@ class UsersPager extends AlphabeticPager {
$userName = $row->user_name;
$ulinks = Linker::userLink( $row->user_id, $userName );
- $ulinks .= Linker::userToolLinksRedContribs( $row->user_id, $userName, intval( $row->edits ) );
+ $ulinks .= Linker::userToolLinksRedContribs(
+ $row->user_id,
+ $userName,
+ (int)$row->edits
+ );
$lang = $this->getLanguage();
$groups = '';
$groups_list = self::getGroups( $row->user_id );
+
if ( !$this->including && count( $groups_list ) > 0 ) {
$list = array();
foreach ( $groups_list as $group ) {
@@ -168,6 +184,7 @@ class UsersPager extends AlphabeticPager {
}
$item = $lang->specialList( $ulinks, $groups );
+
if ( $row->ipb_deleted ) {
$item = "$item";
}
@@ -175,11 +192,14 @@ class UsersPager extends AlphabeticPager {
$edits = '';
global $wgEdititis;
if ( !$this->including && $wgEdititis ) {
- $edits = ' [' . $this->msg( 'usereditcount' )->numParams( $row->edits )->escaped() . ']';
+ // @fixme i18n issue: Hardcoded square brackets.
+ $edits = ' [' .
+ $this->msg( 'usereditcount' )->numParams( $row->edits )->escaped() .
+ ']';
}
$created = '';
- # Some rows may be NULL
+ # Some rows may be null
if ( !$this->including && $row->creation ) {
$user = $this->getUser();
$d = $lang->userDate( $row->creation, $user );
@@ -187,9 +207,12 @@ class UsersPager extends AlphabeticPager {
$created = $this->msg( 'usercreated', $d, $t, $row->user_name )->escaped();
$created = ' ' . $this->msg( 'parentheses' )->rawParams( $created )->escaped();
}
- $blocked = !is_null( $row->ipb_deleted ) ? ' ' . $this->msg( 'listusers-blocked', $userName )->escaped() : '';
+ $blocked = !is_null( $row->ipb_deleted ) ?
+ ' ' . $this->msg( 'listusers-blocked', $userName )->escaped() :
+ '';
wfRunHooks( 'SpecialListusersFormatRow', array( &$item, $row ) );
+
return Html::rawElement( 'li', array(), "{$item}{$edits}{$created}{$blocked}" );
}
@@ -213,7 +236,10 @@ class UsersPager extends AlphabeticPager {
list( $self ) = explode( '/', $this->getTitle()->getPrefixedDBkey() );
# Form tag
- $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listusers-form' ) ) .
+ $out = Xml::openElement(
+ 'form',
+ array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listusers-form' )
+ ) .
Xml::fieldset( $this->msg( 'listusers' )->text() ) .
Html::hidden( 'title', $self );
@@ -238,9 +264,19 @@ class UsersPager extends AlphabeticPager {
$out .= Xml::option( $groupText, $group, $group == $this->requestedGroup );
}
$out .= Xml::closeElement( 'select' ) . '
';
- $out .= Xml::checkLabel( $this->msg( 'listusers-editsonly' )->text(), 'editsOnly', 'editsOnly', $this->editsOnly );
+ $out .= Xml::checkLabel(
+ $this->msg( 'listusers-editsonly' )->text(),
+ 'editsOnly',
+ 'editsOnly',
+ $this->editsOnly
+ );
$out .= ' ';
- $out .= Xml::checkLabel( $this->msg( 'listusers-creationsort' )->text(), 'creationSort', 'creationSort', $this->creationSort );
+ $out .= Xml::checkLabel(
+ $this->msg( 'listusers-creationsort' )->text(),
+ 'creationSort',
+ 'creationSort',
+ $this->creationSort
+ );
$out .= '
';
wfRunHooks( 'SpecialListusersHeaderForm', array( $this, &$out ) );
@@ -265,6 +301,7 @@ class UsersPager extends AlphabeticPager {
$result[$group] = User::getGroupName( $group );
}
asort( $result );
+
return $result;
}
@@ -281,6 +318,7 @@ class UsersPager extends AlphabeticPager {
$query['username'] = $this->requestedUser;
}
wfRunHooks( 'SpecialListusersDefaultQuery', array( $this, &$query ) );
+
return $query;
}
@@ -293,6 +331,7 @@ class UsersPager extends AlphabeticPager {
protected static function getGroups( $uid ) {
$user = User::newFromId( $uid );
$groups = array_diff( $user->getEffectiveGroups(), User::getImplicitGroups() );
+
return $groups;
}
@@ -304,7 +343,10 @@ class UsersPager extends AlphabeticPager {
* @return string
*/
protected static function buildGroupLink( $group, $username ) {
- return User::makeGroupLinkHtml( $group, htmlspecialchars( User::getGroupMember( $group, $username ) ) );
+ return User::makeGroupLinkHtml(
+ $group,
+ htmlspecialchars( User::getGroupMember( $group, $username ) )
+ );
}
}
@@ -312,7 +354,6 @@ class UsersPager extends AlphabeticPager {
* @ingroup SpecialPage
*/
class SpecialListUsers extends IncludableSpecialPage {
-
/**
* Constructor
*/
diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php
index cf690f6f3a..5d55a2803c 100644
--- a/includes/specials/SpecialLog.php
+++ b/includes/specials/SpecialLog.php
@@ -29,7 +29,6 @@
* @ingroup SpecialPage
*/
class SpecialLog extends SpecialPage {
-
/**
* List log type for which the target is a user
* Thus if the given target is in NS_MAIN we can alter it to be an NS_USER
@@ -119,7 +118,9 @@ class SpecialLog extends SpecialPage {
# Get parameters
$parms = explode( '/', ( $par = ( $par !== null ) ? $par : '' ) );
$symsForAll = array( '*', 'all' );
- if ( $parms[0] != '' && ( in_array( $par, $wgLogTypes ) || in_array( $par, $symsForAll ) ) ) {
+ if ( $parms[0] != '' &&
+ ( in_array( $par, $wgLogTypes ) || in_array( $par, $symsForAll ) )
+ ) {
$opts->setValue( 'type', $par );
} elseif ( count( $parms ) == 2 ) {
$opts->setValue( 'type', $parms[0] );
@@ -131,10 +132,22 @@ class SpecialLog extends SpecialPage {
private function show( FormOptions $opts, array $extraConds ) {
# Create a LogPager item to get the results and a LogEventsList item to format them...
- $loglist = new LogEventsList( $this->getContext(), null, LogEventsList::USE_REVDEL_CHECKBOXES );
- $pager = new LogPager( $loglist, $opts->getValue( 'type' ), $opts->getValue( 'user' ),
- $opts->getValue( 'page' ), $opts->getValue( 'pattern' ), $extraConds, $opts->getValue( 'year' ),
- $opts->getValue( 'month' ), $opts->getValue( 'tagfilter' ) );
+ $loglist = new LogEventsList(
+ $this->getContext(),
+ null,
+ LogEventsList::USE_REVDEL_CHECKBOXES
+ );
+ $pager = new LogPager(
+ $loglist,
+ $opts->getValue( 'type' ),
+ $opts->getValue( 'user' ),
+ $opts->getValue( 'page' ),
+ $opts->getValue( 'pattern' ),
+ $extraConds,
+ $opts->getValue( 'year' ),
+ $opts->getValue( 'month' ),
+ $opts->getValue( 'tagfilter' )
+ );
$this->addHeader( $opts->getValue( 'type' ) );
@@ -144,16 +157,28 @@ class SpecialLog extends SpecialPage {
}
# Show form options
- $loglist->showOptions( $pager->getType(), $opts->getValue( 'user' ), $pager->getPage(), $pager->getPattern(),
- $pager->getYear(), $pager->getMonth(), $pager->getFilterParams(), $opts->getValue( 'tagfilter' ) );
+ $loglist->showOptions(
+ $pager->getType(),
+ $opts->getValue( 'user' ),
+ $pager->getPage(),
+ $pager->getPattern(),
+ $pager->getYear(),
+ $pager->getMonth(),
+ $pager->getFilterParams(),
+ $opts->getValue( 'tagfilter' )
+ );
# Insert list
$logBody = $pager->getBody();
if ( $logBody ) {
$this->getOutput()->addHTML(
$pager->getNavigationBar() .
- $this->getRevisionButton( $loglist->beginLogEventsList() . $logBody . $loglist->endLogEventsList() ) .
- $pager->getNavigationBar()
+ $this->getRevisionButton(
+ $loglist->beginLogEventsList() .
+ $logBody .
+ $loglist->endLogEventsList()
+ ) .
+ $pager->getNavigationBar()
);
} else {
$this->getOutput()->addWikiMsg( 'logempty' );
@@ -161,19 +186,27 @@ class SpecialLog extends SpecialPage {
}
private function getRevisionButton( $formcontents ) {
- # If the user doesn't have the ability to delete log entries, don't bother showing him/her the button.
+ # If the user doesn't have the ability to delete log entries,
+ # don't bother showing them the button.
if ( !$this->getUser()->isAllowedAll( 'deletedhistory', 'deletelogentry' ) ) {
return $formcontents;
}
# Show button to hide log entries
global $wgScript;
- $s = Html::openElement( 'form', array( 'action' => $wgScript, 'id' => 'mw-log-deleterevision-submit' ) ) . "\n";
+ $s = Html::openElement(
+ 'form',
+ array( 'action' => $wgScript, 'id' => 'mw-log-deleterevision-submit' )
+ ) . "\n";
$s .= Html::hidden( 'title', SpecialPage::getTitleFor( 'Revisiondelete' ) ) . "\n";
$s .= Html::hidden( 'target', SpecialPage::getTitleFor( 'Log' ) ) . "\n";
$s .= Html::hidden( 'type', 'logging' ) . "\n";
- $button = Html::element( 'button',
- array( 'type' => 'submit', 'class' => "deleterevision-log-submit mw-log-deleterevision-button" ),
+ $button = Html::element(
+ 'button',
+ array(
+ 'type' => 'submit',
+ 'class' => "deleterevision-log-submit mw-log-deleterevision-button"
+ ),
$this->msg( 'showhideselectedlogentries' )->text()
) . "\n";
$s .= $button . $formcontents . $button;
diff --git a/includes/specials/SpecialLonelypages.php b/includes/specials/SpecialLonelypages.php
index 6bccdc79df..7c7771d723 100644
--- a/includes/specials/SpecialLonelypages.php
+++ b/includes/specials/SpecialLonelypages.php
@@ -28,7 +28,6 @@
* @ingroup SpecialPage
*/
class LonelyPagesPage extends PageQueryPage {
-
function __construct( $name = 'Lonelypages' ) {
parent::__construct( $name );
}
@@ -51,24 +50,35 @@ class LonelyPagesPage extends PageQueryPage {
function getQueryInfo() {
return array(
- 'tables' => array( 'page', 'pagelinks',
- 'templatelinks' ),
- 'fields' => array( 'namespace' => 'page_namespace',
- 'title' => 'page_title',
- 'value' => 'page_title' ),
- 'conds' => array( 'pl_namespace IS NULL',
- 'page_namespace' => MWNamespace::getContentNamespaces(),
- 'page_is_redirect' => 0,
- 'tl_namespace IS NULL' ),
+ 'tables' => array(
+ 'page', 'pagelinks',
+ 'templatelinks'
+ ),
+ 'fields' => array(
+ 'namespace' => 'page_namespace',
+ 'title' => 'page_title',
+ 'value' => 'page_title'
+ ),
+ 'conds' => array(
+ 'pl_namespace IS NULL',
+ 'page_namespace' => MWNamespace::getContentNamespaces(),
+ 'page_is_redirect' => 0,
+ 'tl_namespace IS NULL'
+ ),
'join_conds' => array(
- 'pagelinks' => array(
- 'LEFT JOIN', array(
+ 'pagelinks' => array(
+ 'LEFT JOIN', array(
'pl_namespace = page_namespace',
- 'pl_title = page_title' ) ),
- 'templatelinks' => array(
- 'LEFT JOIN', array(
+ 'pl_title = page_title'
+ )
+ ),
+ 'templatelinks' => array(
+ 'LEFT JOIN', array(
'tl_namespace = page_namespace',
- 'tl_title = page_title' ) ) )
+ 'tl_title = page_title'
+ )
+ )
+ )
);
}
diff --git a/includes/specials/SpecialLongpages.php b/includes/specials/SpecialLongpages.php
index c045f9e98b..d90d2718a6 100644
--- a/includes/specials/SpecialLongpages.php
+++ b/includes/specials/SpecialLongpages.php
@@ -26,7 +26,6 @@
* @ingroup SpecialPage
*/
class LongPagesPage extends ShortPagesPage {
-
function __construct( $name = 'Longpages' ) {
parent::__construct( $name );
}
diff --git a/includes/specials/SpecialMIMEsearch.php b/includes/specials/SpecialMIMEsearch.php
index c11016d243..7ff5d7b550 100644
--- a/includes/specials/SpecialMIMEsearch.php
+++ b/includes/specials/SpecialMIMEsearch.php
@@ -53,16 +53,20 @@ class MIMEsearchPage extends QueryPage {
public function getQueryInfo() {
return array(
'tables' => array( 'image' ),
- 'fields' => array( 'namespace' => NS_FILE,
- 'title' => 'img_name',
- 'value' => 'img_major_mime',
- 'img_size',
- 'img_width',
- 'img_height',
- 'img_user_text',
- 'img_timestamp' ),
- 'conds' => array( 'img_major_mime' => $this->major,
- 'img_minor_mime' => $this->minor )
+ 'fields' => array(
+ 'namespace' => NS_FILE,
+ 'title' => 'img_name',
+ 'value' => 'img_major_mime',
+ 'img_size',
+ 'img_width',
+ 'img_height',
+ 'img_user_text',
+ 'img_timestamp'
+ ),
+ 'conds' => array(
+ 'img_major_mime' => $this->major,
+ 'img_minor_mime' => $this->minor
+ )
);
}
@@ -74,21 +78,28 @@ class MIMEsearchPage extends QueryPage {
$this->setHeaders();
$this->outputHeader();
$this->getOutput()->addHTML(
- Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgScript ) ) .
- Xml::openElement( 'fieldset' ) .
- Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
- Xml::element( 'legend', null, $this->msg( 'mimesearch' )->text() ) .
- Xml::inputLabel( $this->msg( 'mimetype' )->text(), 'mime', 'mime', 20, $mime ) . ' ' .
- Xml::submitButton( $this->msg( 'ilsubmit' )->text() ) .
- Xml::closeElement( 'fieldset' ) .
- Xml::closeElement( 'form' )
+ Xml::openElement(
+ 'form',
+ array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgScript )
+ ) .
+ Xml::openElement( 'fieldset' ) .
+ Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
+ Xml::element( 'legend', null, $this->msg( 'mimesearch' )->text() ) .
+ Xml::inputLabel( $this->msg( 'mimetype' )->text(), 'mime', 'mime', 20, $mime ) .
+ ' ' .
+ Xml::submitButton( $this->msg( 'ilsubmit' )->text() ) .
+ Xml::closeElement( 'fieldset' ) .
+ Xml::closeElement( 'form' )
);
list( $this->major, $this->minor ) = File::splitMime( $mime );
+
if ( $this->major == '' || $this->minor == '' || $this->minor == 'unknown' ||
- !self::isValidType( $this->major ) ) {
+ !self::isValidType( $this->major )
+ ) {
return;
}
+
parent::execute( $par );
}
@@ -113,8 +124,13 @@ class MIMEsearchPage extends QueryPage {
$bytes = htmlspecialchars( $lang->formatSize( $result->img_size ) );
$dimensions = $this->msg( 'widthheight' )->numParams( $result->img_width,
$result->img_height )->escaped();
- $user = Linker::link( Title::makeTitle( NS_USER, $result->img_user_text ), htmlspecialchars( $result->img_user_text ) );
- $time = htmlspecialchars( $lang->userTimeAndDate( $result->img_timestamp, $this->getUser() ) );
+ $user = Linker::link(
+ Title::makeTitle( NS_USER, $result->img_user_text ),
+ htmlspecialchars( $result->img_user_text )
+ );
+
+ $time = $lang->userTimeAndDate( $result->img_timestamp, $this->getUser() );
+ $time = htmlspecialchars( $time );
return "$download $plink . . $dimensions . . $bytes . . $user . . $time";
}
@@ -136,6 +152,7 @@ class MIMEsearchPage extends QueryPage {
'model',
'multipart'
);
+
return in_array( $type, $types );
}
diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php
index 2e7f672b5a..2a86fca3f1 100644
--- a/includes/specials/SpecialMergeHistory.php
+++ b/includes/specials/SpecialMergeHistory.php
@@ -91,11 +91,13 @@ class SpecialMergeHistory extends SpecialPage {
if ( $this->mTargetID && $this->mDestID && $this->mAction == 'submit' && $this->mMerge ) {
$this->merge();
+
return;
}
if ( !$this->mSubmitted ) {
$this->showMergeForm();
+
return;
}
@@ -126,7 +128,6 @@ class SpecialMergeHistory extends SpecialPage {
} else {
$this->showHistory();
}
-
}
function showMergeForm() {
@@ -138,25 +139,25 @@ class SpecialMergeHistory extends SpecialPage {
Xml::openElement( 'form', array(
'method' => 'get',
'action' => $wgScript ) ) .
- '' .
+ ''
);
}
@@ -188,32 +189,32 @@ class SpecialMergeHistory extends SpecialPage {
# in a nice little table
$table =
Xml::openElement( 'fieldset' ) .
- $this->msg( 'mergehistory-merge', $this->mTargetObj->getPrefixedText(),
- $this->mDestObj->getPrefixedText() )->parse() .
- Xml::openElement( 'table', array( 'id' => 'mw-mergehistory-table' ) ) .
+ $this->msg( 'mergehistory-merge', $this->mTargetObj->getPrefixedText(),
+ $this->mDestObj->getPrefixedText() )->parse() .
+ Xml::openElement( 'table', array( 'id' => 'mw-mergehistory-table' ) ) .
'
' .
- Xml::label( $this->msg( 'mergehistory-reason' )->text(), 'wpComment' ) .
- '
- ' .
- Xml::input( 'wpComment', 50, $this->mComment, array( 'id' => 'wpComment' ) ) .
- '
+ Xml::label( $this->msg( 'mergehistory-reason' )->text(), 'wpComment' ) .
+ '
+ ' .
+ Xml::input( 'wpComment', 50, $this->mComment, array( 'id' => 'wpComment' ) ) .
+ '
' .
- Xml::closeElement( 'table' ) .
- Xml::closeElement( 'fieldset' );
+ Xml::closeElement( 'table' ) .
+ Xml::closeElement( 'fieldset' );
$out->addHTML( $table );
}
$out->addHTML(
'
' .
- Xml::submitButton( $this->msg( 'mergehistory-submit' )->text(), array( 'name' => 'merge', 'id' => 'mw-merge-submit' ) ) .
- '
+ Xml::submitButton( $this->msg( 'mergehistory-submit' )->text(), array( 'name' => 'merge', 'id' => 'mw-merge-submit' ) ) .
+ '
' .
- $this->msg( 'mergehistory-list' )->escaped() . "
\n"
+ $this->msg( 'mergehistory-list' )->escaped() . "\n"
);
if ( $haveRevisions ) {
@@ -319,6 +320,7 @@ class SpecialMergeHistory extends SpecialPage {
# Destination page must exist with revisions
if ( !$maxtimestamp ) {
$this->getOutput()->addWikiMsg( 'mergehistory-fail' );
+
return false;
}
# Get the latest timestamp of the source
@@ -331,6 +333,7 @@ class SpecialMergeHistory extends SpecialPage {
# $this->mTimestamp must be older than $maxtimestamp
if ( $this->mTimestamp >= $maxtimestamp ) {
$this->getOutput()->addWikiMsg( 'mergehistory-fail' );
+
return false;
}
# Update the revisions
@@ -407,6 +410,7 @@ class SpecialMergeHistory extends SpecialPage {
# Check if this did anything
if ( !$count ) {
$this->getOutput()->addWikiMsg( 'mergehistory-fail' );
+
return false;
}
# Update our logs
@@ -475,6 +479,7 @@ class MergeHistoryPager extends ReverseChronologicalPager {
$this->mResult->seek( 0 );
wfProfileOut( __METHOD__ );
+
return '';
}
@@ -486,6 +491,7 @@ class MergeHistoryPager extends ReverseChronologicalPager {
$conds = $this->mConds;
$conds['rev_page'] = $this->articleID;
$conds[] = "rev_timestamp < {$this->maxTimestamp}";
+
return array(
'tables' => array( 'revision', 'page', 'user' ),
'fields' => array_merge( Revision::selectFields(), Revision::selectUserFields() ),
diff --git a/includes/specials/SpecialMostcategories.php b/includes/specials/SpecialMostcategories.php
index a0dbcf0fce..9b67f34339 100644
--- a/includes/specials/SpecialMostcategories.php
+++ b/includes/specials/SpecialMostcategories.php
@@ -45,14 +45,22 @@ class MostcategoriesPage extends QueryPage {
function getQueryInfo() {
return array(
'tables' => array( 'categorylinks', 'page' ),
- 'fields' => array( 'namespace' => 'page_namespace',
- 'title' => 'page_title',
- 'value' => 'COUNT(*)' ),
+ 'fields' => array(
+ 'namespace' => 'page_namespace',
+ 'title' => 'page_title',
+ 'value' => 'COUNT(*)'
+ ),
'conds' => array( 'page_namespace' => MWNamespace::getContentNamespaces() ),
- 'options' => array( 'HAVING' => 'COUNT(*) > 1',
- 'GROUP BY' => array( 'page_namespace', 'page_title' ) ),
- 'join_conds' => array( 'page' => array( 'LEFT JOIN',
- 'page_id = cl_from' ) )
+ 'options' => array(
+ 'HAVING' => 'COUNT(*) > 1',
+ 'GROUP BY' => array( 'page_namespace', 'page_title' )
+ ),
+ 'join_conds' => array(
+ 'page' => array(
+ 'LEFT JOIN',
+ 'page_id = cl_from'
+ )
+ )
);
}
@@ -84,8 +92,15 @@ class MostcategoriesPage extends QueryPage {
function formatResult( $skin, $result ) {
$title = Title::makeTitleSafe( $result->namespace, $result->title );
if ( !$title ) {
- return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
- Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+ return Html::element(
+ 'span',
+ array( 'class' => 'mw-invalidtitle' ),
+ Linker::getInvalidTitleDescription(
+ $this->getContext(),
+ $result->namespace,
+ $result->title
+ )
+ );
}
if ( $this->isCached() ) {
diff --git a/includes/specials/SpecialMostimages.php b/includes/specials/SpecialMostimages.php
index a961efd541..98d8da3af9 100644
--- a/includes/specials/SpecialMostimages.php
+++ b/includes/specials/SpecialMostimages.php
@@ -30,7 +30,6 @@
* @ingroup SpecialPage
*/
class MostimagesPage extends ImageQueryPage {
-
function __construct( $name = 'Mostimages' ) {
parent::__construct( $name );
}
@@ -46,11 +45,15 @@ class MostimagesPage extends ImageQueryPage {
function getQueryInfo() {
return array(
'tables' => array( 'imagelinks' ),
- 'fields' => array( 'namespace' => NS_FILE,
- 'title' => 'il_to',
- 'value' => 'COUNT(*)' ),
- 'options' => array( 'GROUP BY' => 'il_to',
- 'HAVING' => 'COUNT(*) > 1' )
+ 'fields' => array(
+ 'namespace' => NS_FILE,
+ 'title' => 'il_to',
+ 'value' => 'COUNT(*)'
+ ),
+ 'options' => array(
+ 'GROUP BY' => 'il_to',
+ 'HAVING' => 'COUNT(*) > 1'
+ )
);
}
diff --git a/includes/specials/SpecialMostinterwikis.php b/includes/specials/SpecialMostinterwikis.php
index 0321fb6034..98dd68e9d2 100644
--- a/includes/specials/SpecialMostinterwikis.php
+++ b/includes/specials/SpecialMostinterwikis.php
@@ -30,7 +30,6 @@
* @ingroup SpecialPage
*/
class MostinterwikisPage extends QueryPage {
-
function __construct( $name = 'Mostinterwikis' ) {
parent::__construct( $name );
}
@@ -100,8 +99,15 @@ class MostinterwikisPage extends QueryPage {
function formatResult( $skin, $result ) {
$title = Title::makeTitleSafe( $result->namespace, $result->title );
if ( !$title ) {
- return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
- Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+ return Html::element(
+ 'span',
+ array( 'class' => 'mw-invalidtitle' ),
+ Linker::getInvalidTitleDescription(
+ $this->getContext(),
+ $result->namespace,
+ $result->title
+ )
+ );
}
if ( $this->isCached() ) {
diff --git a/includes/specials/SpecialMostlinked.php b/includes/specials/SpecialMostlinked.php
index be28b99d9d..37593bf908 100644
--- a/includes/specials/SpecialMostlinked.php
+++ b/includes/specials/SpecialMostlinked.php
@@ -31,7 +31,6 @@
* @ingroup SpecialPage
*/
class MostlinkedPage extends QueryPage {
-
function __construct( $name = 'Mostlinked' ) {
parent::__construct( $name );
}
@@ -47,16 +46,28 @@ class MostlinkedPage extends QueryPage {
function getQueryInfo() {
return array(
'tables' => array( 'pagelinks', 'page' ),
- 'fields' => array( 'namespace' => 'pl_namespace',
- 'title' => 'pl_title',
- 'value' => 'COUNT(*)',
- 'page_namespace' ),
- 'options' => array( 'HAVING' => 'COUNT(*) > 1',
- 'GROUP BY' => array( 'pl_namespace', 'pl_title',
- 'page_namespace' ) ),
- 'join_conds' => array( 'page' => array( 'LEFT JOIN',
- array( 'page_namespace = pl_namespace',
- 'page_title = pl_title' ) ) )
+ 'fields' => array(
+ 'namespace' => 'pl_namespace',
+ 'title' => 'pl_title',
+ 'value' => 'COUNT(*)',
+ 'page_namespace'
+ ),
+ 'options' => array(
+ 'HAVING' => 'COUNT(*) > 1',
+ 'GROUP BY' => array(
+ 'pl_namespace', 'pl_title',
+ 'page_namespace'
+ )
+ ),
+ 'join_conds' => array(
+ 'page' => array(
+ 'LEFT JOIN',
+ array(
+ 'page_namespace = pl_namespace',
+ 'page_title = pl_title'
+ )
+ )
+ )
);
}
@@ -69,9 +80,11 @@ class MostlinkedPage extends QueryPage {
function preprocessResults( $db, $res ) {
if ( $res->numRows() > 0 ) {
$linkBatch = new LinkBatch();
+
foreach ( $res as $row ) {
$linkBatch->add( $row->namespace, $row->title );
}
+
$res->seek( 0 );
$linkBatch->execute();
}
@@ -86,11 +99,13 @@ class MostlinkedPage extends QueryPage {
*/
function makeWlhLink( $title, $caption ) {
$wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedDBkey() );
+
return Linker::linkKnown( $wlh, $caption );
}
/**
- * Make links to the page corresponding to the item, and the "what links here" page for it
+ * Make links to the page corresponding to the item,
+ * and the "what links here" page for it
*
* @param Skin $skin Skin to be used
* @param object $result Result row
@@ -99,12 +114,22 @@ class MostlinkedPage extends QueryPage {
function formatResult( $skin, $result ) {
$title = Title::makeTitleSafe( $result->namespace, $result->title );
if ( !$title ) {
- return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
- Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+ return Html::element(
+ 'span',
+ array( 'class' => 'mw-invalidtitle' ),
+ Linker::getInvalidTitleDescription(
+ $this->getContext(),
+ $result->namespace,
+ $result->title )
+ );
}
+
$link = Linker::link( $title );
- $wlh = $this->makeWlhLink( $title,
- $this->msg( 'nlinks' )->numParams( $result->value )->escaped() );
+ $wlh = $this->makeWlhLink(
+ $title,
+ $this->msg( 'nlinks' )->numParams( $result->value )->escaped()
+ );
+
return $this->getLanguage()->specialList( $link, $wlh );
}
diff --git a/includes/specials/SpecialMostlinkedcategories.php b/includes/specials/SpecialMostlinkedcategories.php
index f0ec664f88..0d4641b189 100644
--- a/includes/specials/SpecialMostlinkedcategories.php
+++ b/includes/specials/SpecialMostlinkedcategories.php
@@ -30,7 +30,6 @@
* @ingroup SpecialPage
*/
class MostlinkedCategoriesPage extends QueryPage {
-
function __construct( $name = 'Mostlinkedcategories' ) {
parent::__construct( $name );
}
@@ -43,8 +42,8 @@ class MostlinkedCategoriesPage extends QueryPage {
return array(
'tables' => array( 'category' ),
'fields' => array( 'title' => 'cat_title',
- 'namespace' => NS_CATEGORY,
- 'value' => 'cat_pages' ),
+ 'namespace' => NS_CATEGORY,
+ 'value' => 'cat_pages' ),
);
}
@@ -83,15 +82,20 @@ class MostlinkedCategoriesPage extends QueryPage {
$nt = Title::makeTitleSafe( NS_CATEGORY, $result->title );
if ( !$nt ) {
- return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
- Linker::getInvalidTitleDescription( $this->getContext(), NS_CATEGORY, $result->title ) );
+ return Html::element(
+ 'span',
+ array( 'class' => 'mw-invalidtitle' ),
+ Linker::getInvalidTitleDescription(
+ $this->getContext(),
+ NS_CATEGORY,
+ $result->title )
+ );
}
$text = $wgContLang->convert( $nt->getText() );
-
$plink = Linker::link( $nt, htmlspecialchars( $text ) );
-
$nlinks = $this->msg( 'nmembers' )->numParams( $result->value )->escaped();
+
return $this->getLanguage()->specialList( $plink, $nlinks );
}
diff --git a/includes/specials/SpecialMostlinkedtemplates.php b/includes/specials/SpecialMostlinkedtemplates.php
index 2590cf883b..c90acb1f9a 100644
--- a/includes/specials/SpecialMostlinkedtemplates.php
+++ b/includes/specials/SpecialMostlinkedtemplates.php
@@ -29,7 +29,6 @@
* @ingroup SpecialPage
*/
class MostlinkedTemplatesPage extends QueryPage {
-
function __construct( $name = 'Mostlinkedtemplates' ) {
parent::__construct( $name );
}
@@ -64,9 +63,11 @@ class MostlinkedTemplatesPage extends QueryPage {
public function getQueryInfo() {
return array(
'tables' => array( 'templatelinks' ),
- 'fields' => array( 'namespace' => 'tl_namespace',
- 'title' => 'tl_title',
- 'value' => 'COUNT(*)' ),
+ 'fields' => array(
+ 'namespace' => 'tl_namespace',
+ 'title' => 'tl_title',
+ 'value' => 'COUNT(*)'
+ ),
'conds' => array( 'tl_namespace' => NS_TEMPLATE ),
'options' => array( 'GROUP BY' => array( 'tl_namespace', 'tl_title' ) )
);
@@ -102,8 +103,15 @@ class MostlinkedTemplatesPage extends QueryPage {
public function formatResult( $skin, $result ) {
$title = Title::makeTitleSafe( $result->namespace, $result->title );
if ( !$title ) {
- return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
- Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+ return Html::element(
+ 'span',
+ array( 'class' => 'mw-invalidtitle' ),
+ Linker::getInvalidTitleDescription(
+ $this->getContext(),
+ $result->namespace,
+ $result->title
+ )
+ );
}
return $this->getLanguage()->specialList(
@@ -122,6 +130,7 @@ class MostlinkedTemplatesPage extends QueryPage {
private function makeWlhLink( $title, $result ) {
$wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedText() );
$label = $this->msg( 'ntransclusions' )->numParams( $result->value )->escaped();
+
return Linker::link( $wlh, $label );
}
diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php
index e4bce1c8f6..2ba3c0660f 100644
--- a/includes/specials/SpecialMovepage.php
+++ b/includes/specials/SpecialMovepage.php
@@ -27,13 +27,15 @@
* @ingroup SpecialPage
*/
class MovePageForm extends UnlistedSpecialPage {
-
/**
+ * Objects
* @var Title
*/
- var $oldTitle, $newTitle; # Objects
- var $reason; # Text input
- var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects, $leaveRedirect, $moveOverShared; # Checks
+ var $oldTitle, $newTitle;
+ // Text input
+ var $reason;
+ // Checks
+ var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects, $leaveRedirect, $moveOverShared;
private $watch = false;
@@ -93,7 +95,8 @@ class MovePageForm extends UnlistedSpecialPage {
$this->watch = $request->getCheck( 'wpWatch' ) && $user->isLoggedIn();
if ( 'submit' == $request->getVal( 'action' ) && $request->wasPosted()
- && $user->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) {
+ && $user->matchEditToken( $request->getVal( 'wpEditToken' ) )
+ ) {
$this->doSubmit();
} else {
$this->showForm( array() );
@@ -146,16 +149,26 @@ class MovePageForm extends UnlistedSpecialPage {
";
$err = array();
} else {
if ( $this->oldTitle->getNamespace() == NS_USER && !$this->oldTitle->isSubpage() ) {
- $out->wrapWikiMsg( "
" .
- Xml::checkLabel( $this->msg( 'delete_and_move_confirm' )->text(), 'wpConfirm', 'wpConfirm' ) .
- "
+ Xml::checkLabel(
+ $this->msg( 'delete_and_move_confirm' )->text(),
+ 'wpConfirm',
+ 'wpConfirm'
+ ) .
+ "
+ Xml::openElement(
+ 'form',
+ array(
+ 'method' => 'post',
+ 'action' => $this->getTitle()->getLocalURL( 'action=submit' ),
+ 'id' => 'movepage'
+ )
+ ) .
+ Xml::openElement( 'fieldset' ) .
+ Xml::element( 'legend', null, $this->msg( 'move-page-legend' )->text() ) .
+ Xml::openElement( 'table', array( 'id' => 'mw-movepage-table' ) ) .
+ "
" .
- $this->msg( 'movearticle' )->escaped() .
+ $this->msg( 'movearticle' )->escaped() .
"
{$oldTitleLink}
@@ -270,27 +298,32 @@ class MovePageForm extends UnlistedSpecialPage {
" .
- Xml::label( $this->msg( 'newtitle' )->text(), 'wpNewTitleMain' ) .
+ Xml::label( $this->msg( 'newtitle' )->text(), 'wpNewTitleMain' ) .
"
" .
- Html::namespaceSelector(
- array(
- 'selected' => $newTitle->getNamespace(),
- 'exclude' => $immovableNamespaces
- ),
- array( 'name' => 'wpNewTitleNs', 'id' => 'wpNewTitleNs' )
- ) .
- Xml::input( 'wpNewTitleMain', 60, $wgContLang->recodeForEdit( $newTitle->getText() ), array(
+ Html::namespaceSelector(
+ array(
+ 'selected' => $newTitle->getNamespace(),
+ 'exclude' => $immovableNamespaces
+ ),
+ array( 'name' => 'wpNewTitleNs', 'id' => 'wpNewTitleNs' )
+ ) .
+ Xml::input(
+ 'wpNewTitleMain',
+ 60,
+ $wgContLang->recodeForEdit( $newTitle->getText() ),
+ array(
'type' => 'text',
'id' => 'wpNewTitleMain',
- 'maxlength' => 255,
- ) ) .
- Html::hidden( 'wpOldTitle', $this->oldTitle->getPrefixedText() ) .
+ 'maxlength' => 255
+ )
+ ) .
+ Html::hidden( 'wpOldTitle', $this->oldTitle->getPrefixedText() ) .
"
" .
- Xml::label( $this->msg( 'movereason' )->text(), 'wpReason' ) .
+ Xml::label( $this->msg( 'movereason' )->text(), 'wpReason' ) .
"
" .
Xml::input( 'wpReason', 60, $this->reason, array(
@@ -307,7 +340,12 @@ class MovePageForm extends UnlistedSpecialPage {
"
);
@@ -318,8 +356,12 @@ class MovePageForm extends UnlistedSpecialPage {
" .
- Xml::checkLabel( $this->msg( 'movetalk' )->text(), 'wpMovetalk', 'wpMovetalk', $this->moveTalk ) .
+ Xml::checkLabel(
+ $this->msg( 'movetalk' )->text(),
+ 'wpMovetalk',
+ 'wpMovetalk',
+ $this->moveTalk
+ ) .
"
"
);
@@ -330,8 +372,12 @@ class MovePageForm extends UnlistedSpecialPage {
" .
- Xml::checkLabel( $this->msg( 'move-leave-redirect' )->text(), 'wpLeaveRedirect',
- 'wpLeaveRedirect', $this->leaveRedirect ) .
+ Xml::checkLabel(
+ $this->msg( 'move-leave-redirect' )->text(),
+ 'wpLeaveRedirect',
+ 'wpLeaveRedirect',
+ $this->leaveRedirect
+ ) .
"
"
);
@@ -342,20 +388,20 @@ class MovePageForm extends UnlistedSpecialPage {
" .
- Xml::checkLabel( $this->msg( 'fix-double-redirects' )->text(), 'wpFixRedirects',
- 'wpFixRedirects', $this->fixRedirects ) .
+ Xml::checkLabel(
+ $this->msg( 'fix-double-redirects' )->text(),
+ 'wpFixRedirects',
+ 'wpFixRedirects',
+ $this->fixRedirects
+ ) .
"
"
);
@@ -369,7 +415,12 @@ class MovePageForm extends UnlistedSpecialPage {
" .
- Xml::check(
- 'wpMovesubpages',
- # Don't check the box if we only have talk subpages to
- # move and we aren't moving the talk page.
- $this->moveSubpages && ( $this->oldTitle->hasSubpages() || $this->moveTalk ),
- array( 'id' => 'wpMovesubpages' )
- ) . ' ' .
- Xml::tags( 'label', array( 'for' => 'wpMovesubpages' ),
- $this->msg(
- ( $this->oldTitle->hasSubpages()
- ? 'move-subpages'
- : 'move-talk-subpages' )
+ Xml::check(
+ 'wpMovesubpages',
+ # Don't check the box if we only have talk subpages to
+ # move and we aren't moving the talk page.
+ $this->moveSubpages && ( $this->oldTitle->hasSubpages() || $this->moveTalk ),
+ array( 'id' => 'wpMovesubpages' )
+ ) . ' ' .
+ Xml::tags( 'label', array( 'for' => 'wpMovesubpages' ),
+ $this->msg(
+ ( $this->oldTitle->hasSubpages()
+ ? 'move-subpages'
+ : 'move-talk-subpages' )
)->numParams( $wgMaximumMovedPages )->params( $wgMaximumMovedPages )->parse()
- ) .
+ ) .
"
" );
}
@@ -379,19 +430,18 @@ class MovePageForm extends UnlistedSpecialPage {
" .
- Xml::checkLabel( $this->msg( 'move-watch' )->text(), 'wpWatch', 'watch', $watchChecked ) .
+ Xml::checkLabel(
+ $this->msg( 'move-watch' )->text(),
+ 'wpWatch',
+ 'watch',
+ $watchChecked
+ ) .
"
" .
- Xml::closeElement( 'table' ) .
- Html::hidden( 'wpEditToken', $user->getEditToken() ) .
- Xml::closeElement( 'fieldset' ) .
- Xml::closeElement( 'form' ) .
- "\n"
+ Xml::closeElement( 'table' ) .
+ Html::hidden( 'wpEditToken', $user->getEditToken() ) .
+ Xml::closeElement( 'fieldset' ) .
+ Xml::closeElement( 'form' ) .
+ "\n"
);
$this->showLogFragment( $this->oldTitle );
$this->showSubpages( $this->oldTitle );
-
}
function doSubmit() {
@@ -409,6 +459,7 @@ class MovePageForm extends UnlistedSpecialPage {
# don't allow moving to pages with # in
if ( !$nt || $nt->getFragment() != '' ) {
$this->showForm( array( array( 'badtitletext' ) ) );
+
return;
}
@@ -416,11 +467,11 @@ class MovePageForm extends UnlistedSpecialPage {
if ( $nt->getNamespace() == NS_FILE
&& !( $this->moveOverShared && $user->isAllowed( 'reupload-shared' ) )
&& !RepoGroup::singleton()->getLocalRepo()->findFile( $nt )
- && wfFindFile( $nt ) )
- {
+ && wfFindFile( $nt )
+ ) {
$this->showForm( array( array( 'file-exists-sharedrepo' ) ) );
- return;
+ return;
}
# Delete to make way if requested
@@ -429,6 +480,7 @@ class MovePageForm extends UnlistedSpecialPage {
if ( count( $permErrors ) ) {
# Only show the first error
$this->showForm( $permErrors );
+
return;
}
@@ -447,6 +499,7 @@ class MovePageForm extends UnlistedSpecialPage {
$deleteStatus = $page->doDeleteArticleReal( $reason, false, 0, true, $error, $user );
if ( !$deleteStatus->isGood() ) {
$this->showForm( $deleteStatus->getErrorsArray() );
+
return;
}
}
@@ -465,6 +518,7 @@ class MovePageForm extends UnlistedSpecialPage {
$error = $ot->moveTo( $nt, true, $this->reason, $createRedirect );
if ( $error !== true ) {
$this->showForm( $error );
+
return;
}
@@ -530,7 +584,7 @@ class MovePageForm extends UnlistedSpecialPage {
if ( $this->moveSubpages && (
MWNamespace::hasSubpages( $nt->getNamespace() ) || (
$this->moveTalk &&
- MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
+ MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
)
) ) {
$conds = array(
@@ -541,7 +595,9 @@ class MovePageForm extends UnlistedSpecialPage {
if ( MWNamespace::hasSubpages( $nt->getNamespace() ) ) {
$conds['page_namespace'][] = $ot->getNamespace();
}
- if ( $this->moveTalk && MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() ) ) {
+ if ( $this->moveTalk &&
+ MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
+ ) {
$conds['page_namespace'][] = $ot->getTalkPage()->getNamespace();
}
} elseif ( $this->moveTalk ) {
@@ -578,18 +634,20 @@ class MovePageForm extends UnlistedSpecialPage {
StringUtils::escapeRegexReplacement( $nt->getDBkey() ), # bug 21234
$oldSubpage->getDBkey()
);
+
if ( $oldSubpage->isTalkPage() ) {
$newNs = $nt->getTalkPage()->getNamespace();
} else {
$newNs = $nt->getSubjectPage()->getNamespace();
}
+
# Bug 14385: we need makeTitleSafe because the new page names may
# be longer than 255 characters.
$newSubpage = Title::makeTitleSafe( $newNs, $newPageName );
if ( !$newSubpage ) {
$oldLink = Linker::linkKnown( $oldSubpage );
- $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink
- )->params( Title::makeName( $newNs, $newPageName ) )->escaped();
+ $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink )
+ ->params( Title::makeName( $newNs, $newPageName ) )->escaped();
continue;
}
@@ -599,6 +657,7 @@ class MovePageForm extends UnlistedSpecialPage {
$extraOutput[] = $this->msg( 'movepage-page-exists' )->rawParams( $link )->escaped();
} else {
$success = $oldSubpage->moveTo( $newSubpage, true, $this->reason, $createRedirect );
+
if ( $success === true ) {
if ( $this->fixRedirects ) {
DoubleRedirectJob::fixRedirects( 'move', $oldSubpage, $newSubpage );
@@ -609,9 +668,11 @@ class MovePageForm extends UnlistedSpecialPage {
array(),
array( 'redirect' => 'no' )
);
+
$newLink = Linker::linkKnown( $newSubpage );
$extraOutput[] = $this->msg( 'movepage-page-moved' )->rawParams( $oldLink, $newLink )->escaped();
++$count;
+
if ( $count >= $wgMaximumMovedPages ) {
$extraOutput[] = $this->msg( 'movepage-max-pages' )->numParams( $wgMaximumMovedPages )->escaped();
break;
@@ -622,7 +683,6 @@ class MovePageForm extends UnlistedSpecialPage {
$extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink, $newLink )->escaped();
}
}
-
}
if ( $extraOutput !== array() ) {
@@ -667,6 +727,7 @@ class MovePageForm extends UnlistedSpecialPage {
# No subpages.
if ( $count == 0 ) {
$out->addWikiMsg( 'movenosubpage' );
+
return;
}
diff --git a/includes/specials/SpecialNewimages.php b/includes/specials/SpecialNewimages.php
index b865f40e5d..8e92e4ae10 100644
--- a/includes/specials/SpecialNewimages.php
+++ b/includes/specials/SpecialNewimages.php
@@ -21,7 +21,6 @@
* @ingroup SpecialPage
*/
class SpecialNewFiles extends IncludableSpecialPage {
-
public function __construct() {
parent::__construct( 'Newimages' );
}
@@ -37,6 +36,7 @@ class SpecialNewFiles extends IncludableSpecialPage {
$form->prepareForm();
$form->displayForm( '' );
}
+
$this->getOutput()->addHTML( $pager->getBody() );
if ( !$this->including() ) {
$this->getOutput()->addHTML( $pager->getNavigationBar() );
@@ -52,7 +52,6 @@ class SpecialNewFiles extends IncludableSpecialPage {
* @ingroup SpecialPage Pager
*/
class NewFilesPager extends ReverseChronologicalPager {
-
/**
* @var ImageGallery
*/
@@ -75,6 +74,7 @@ class NewFilesPager extends ReverseChronologicalPager {
if ( !$this->showbots ) {
$groupsWithBotPermission = User::getGroupsWithPermission( 'bot' );
+
if ( count( $groupsWithBotPermission ) ) {
$tables[] = 'user_groups';
$conds[] = 'ug_group IS NULL';
@@ -92,7 +92,11 @@ class NewFilesPager extends ReverseChronologicalPager {
$dbr = wfGetDB( DB_SLAVE );
$likeObj = Title::newFromURL( $this->like );
if ( $likeObj instanceof Title ) {
- $like = $dbr->buildLike( $dbr->anyString(), strtolower( $likeObj->getDBkey() ), $dbr->anyString() );
+ $like = $dbr->buildLike(
+ $dbr->anyString(),
+ strtolower( $likeObj->getDBkey() ),
+ $dbr->anyString()
+ );
$conds[] = "LOWER(img_name) $like";
}
}
@@ -115,6 +119,7 @@ class NewFilesPager extends ReverseChronologicalPager {
if ( !$this->gallery ) {
$this->gallery = new ImageGallery();
}
+
return '';
}
@@ -128,11 +133,12 @@ class NewFilesPager extends ReverseChronologicalPager {
$title = Title::makeTitle( NS_FILE, $name );
$ul = Linker::link( $user->getUserpage(), $user->getName() );
+ $time = $this->getLanguage()->userTimeAndDate( $row->img_timestamp, $this->getUser() );
$this->gallery->add(
$title,
"$ul
" .
- Xml::submitButton( $movepagebtn, array( 'name' => $submitVar ) ) .
+ Xml::submitButton( $movepagebtn, array( 'name' => $submitVar ) ) .
"
\n"
- . htmlspecialchars( $this->getLanguage()->userTimeAndDate( $row->img_timestamp, $this->getUser() ) )
+ . htmlspecialchars( $time )
. "
\n"
);
}
@@ -150,7 +156,6 @@ class NewFilesPager extends ReverseChronologicalPager {
'type' => 'check',
'label' => $this->msg( 'showhidebots', $this->msg( 'show' )->plain() )->escaped(),
'name' => 'showbots',
- # 'default' => $this->getRequest()->getBool( 'showbots', 0 ),
),
'limit' => array(
'type' => 'hidden',
diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php
index 46bf81aafe..fc6151f4cf 100644
--- a/includes/specials/SpecialNewpages.php
+++ b/includes/specials/SpecialNewpages.php
@@ -27,7 +27,6 @@
* @ingroup SpecialPage
*/
class SpecialNewpages extends IncludableSpecialPage {
-
// Stored objects
/**
@@ -144,6 +143,7 @@ class SpecialNewpages extends IncludableSpecialPage {
$feedType = $this->opts->getValue( 'feed' );
if ( $feedType ) {
$this->feed( $feedType );
+
return;
}
@@ -198,7 +198,7 @@ class SpecialNewpages extends IncludableSpecialPage {
foreach ( $filters as $key => $msg ) {
$onoff = 1 - $this->opts->getValue( $key );
$link = Linker::link( $self, $showhide[$onoff], array(),
- array( $key => $onoff ) + $changed
+ array( $key => $onoff ) + $changed
);
$links[$key] = $this->msg( $msg )->rawParams( $link )->escaped();
}
@@ -238,55 +238,55 @@ class SpecialNewpages extends IncludableSpecialPage {
Xml::openElement( 'table', array( 'id' => 'mw-newpages-table' ) ) .
'
' . ( $tagFilter ? (
'' .
- Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) .
- '
- ' .
- Html::namespaceSelector(
- array(
- 'selected' => $namespace,
- 'all' => 'all',
- ), array(
- 'name' => 'namespace',
- 'id' => 'namespace',
- 'class' => 'namespaceselector',
- )
- ) . ' ' .
- Xml::checkLabel(
- $this->msg( 'invert' )->text(),
- 'invert',
- 'nsinvert',
- $nsinvert,
- array( 'title' => $this->msg( 'tooltip-invert' )->text() )
- ) .
- '
+ Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) .
+ '
+ ' .
+ Html::namespaceSelector(
+ array(
+ 'selected' => $namespace,
+ 'all' => 'all',
+ ), array(
+ 'name' => 'namespace',
+ 'id' => 'namespace',
+ 'class' => 'namespaceselector',
+ )
+ ) . ' ' .
+ Xml::checkLabel(
+ $this->msg( 'invert' )->text(),
+ 'invert',
+ 'nsinvert',
+ $nsinvert,
+ array( 'title' => $this->msg( 'tooltip-invert' )->text() )
+ ) .
+ '
' ) : '' ) .
( $wgEnableNewpagesUserFilter ?
- '' .
- $tagFilterLabel .
+ $tagFilterLabel .
'
' .
- $tagFilterSelector .
+ $tagFilterSelector .
'
+ '
' : '' ) .
'' .
Xml::label( $this->msg( 'newpages-username' )->text(), 'mw-np-username' ) .
- '
+ '
' .
Xml::input( 'username', 30, $userText, array( 'id' => 'mw-np-username' ) ) .
- '
+ '
' .
+ Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) .
+ '
+ ' .
'
' .
- Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) .
- '
-
' .
Xml::closeElement( 'table' ) .
Xml::closeElement( 'fieldset' ) .
@@ -297,9 +297,10 @@ class SpecialNewpages extends IncludableSpecialPage {
}
/**
- * Format a row, providing the timestamp, links to the page/history, size, user links, and a comment
+ * Format a row, providing the timestamp, links to the page/history,
+ * size, user links, and a comment
*
- * @param $result Result row
+ * @param object $result Result row
* @return String
*/
public function formatRow( $result ) {
@@ -337,7 +338,8 @@ class SpecialNewpages extends IncludableSpecialPage {
$query['rcid'] = $result->rc_id;
}
- // Linker::linkKnown() uses 'known' and 'noclasses' options. This breaks the colouration for stubs.
+ // Linker::linkKnown() uses 'known' and 'noclasses' options.
+ // This breaks the colouration for stubs.
$plink = Linker::link(
$title,
null,
@@ -354,8 +356,12 @@ class SpecialNewpages extends IncludableSpecialPage {
$hist = Html::rawElement( 'span', array( 'class' => 'mw-newpages-history' ),
$this->msg( 'parentheses' )->rawParams( $histLink )->escaped() );
- $length = Html::element( 'span', array( 'class' => 'mw-newpages-length' ),
- $this->msg( 'brackets' )->params( $this->msg( 'nbytes' )->numParams( $result->length )->text() )
+ $length = Html::element(
+ 'span',
+ array( 'class' => 'mw-newpages-length' ),
+ $this->msg( 'brackets' )->params( $this->msg( 'nbytes' )
+ ->numParams( $result->length )->text()
+ )
);
$ulink = Linker::revUserTools( $rev );
@@ -372,7 +378,10 @@ class SpecialNewpages extends IncludableSpecialPage {
# Tags, if any.
if ( isset( $result->ts_tags ) ) {
- list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow( $result->ts_tags, 'newpages' );
+ list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow(
+ $result->ts_tags,
+ 'newpages'
+ );
$classes = array_merge( $classes, $newClasses );
} else {
$tagDisplay = '';
@@ -383,8 +392,10 @@ class SpecialNewpages extends IncludableSpecialPage {
# Display the old title if the namespace/title has been changed
$oldTitleText = '';
$oldTitle = Title::makeTitle( $result->rc_namespace, $result->rc_title );
+
if ( !$title->equals( $oldTitle ) ) {
- $oldTitleText = $this->msg( 'rc-old-title' )->params( $oldTitle->getPrefixedText() )->escaped();
+ $oldTitleText = $oldTitle->getPrefixedText();
+ $oldTitleText = $this->msg( 'rc-old-title' )->params( $oldTitleText )->escaped();
}
return "
' .
- $this->filterLinks() .
- '
+ $this->filterLinks() .
+ '