global $wgUseDatabaseMessages;
if ( !$wgUseDatabaseMessages ) {
$out->addWikiMsg( 'allmessagesnotsupportedDB' );
+
return;
} else {
$this->outputHeader( 'allmessagestext' );
$this->table->getNavigationBar() .
$this->table->getBody() .
$this->table->getNavigationBar() );
-
}
protected function getGroupName() {
$this->getHiddenFields( array( 'title', 'prefix', 'filter', 'lang', 'limit' ) ) .
Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' );
+
return $out;
}
$messageNames = array_map( array( $this->lang, 'ucfirst' ), $messageNames );
wfProfileOut( __METHOD__ );
+
return $messageNames;
}
break;
}
}
+
return $result;
}
array( 'broken' )
);
}
+
return $title . ' ' . $this->msg( 'parentheses' )->rawParams( $talk )->escaped();
case 'am_default' :
$s .= Xml::tags( 'td', $this->getCellAttrs( 'am_actual', $row->am_actual ), $formatted )
. "</tr>\n";
}
+
return $s;
}
if ( !$isSecond ) {
$arr['id'] = Sanitizer::escapeId( 'msg_' . $this->getLanguage()->lcfirst( $row->am_title ) );
}
+
return $arr;
}
$out .= Xml::closeElement( 'fieldset' );
$out .= Xml::closeElement( 'form' );
$out .= Xml::closeElement( 'div' );
+
return $out;
}
} else {
$output->addHTML( $this->namespaceForm( $namespace, $from, $to, $hideredirects ) );
}
+
return;
}
'to' => $outpoint,
);
- if( $namespace ) {
+ if ( $namespace ) {
$queryParams['namespace'] = $namespace;
}
if ( $hideRedirects ) {
"<a href=\"$link\">$inpointf</a></td><td>",
"</td><td><a href=\"$link\">$outpointf</a>"
)->escaped();
+
return '<tr><td class="mw-allpages-alphaindexline">' . $out . '</td></tr>';
}
)
);
}
-
}
/**
$title,
htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) )
);
+
return $this->getLanguage()->specialList( $link, htmlspecialchars( $d ) );
}
} elseif ( IP::isIPAddress( $target ) ) {
return Title::makeTitleSafe( NS_USER, $target );
}
+
return null;
}
$status = self::validateTarget( $value, $form->getUser() );
if ( !$status->isOK() ) {
$errors = $status->getErrorsArray();
+
return call_user_func_array( array( $form, 'msg' ), $errors[0] );
} else {
return true;
}
# BC @since 1.18
-class IPBlockForm extends SpecialBlock {}
+class IPBlockForm extends SpecialBlock {
+}
# B/C @since 1.18: Unblock interface is now at Special:Unblock
$title = SpecialPage::getTitleFor( 'Unblock', $this->target );
$out->redirect( $title->getFullURL() );
+
return;
}
$pager->getBody() .
$pager->getNavigationBar()
);
-
} elseif ( $this->target ) {
$out->addWikiMsg( 'ipblocklist-no-results' );
-
} else {
$out->addWikiMsg( 'ipblocklist-empty' );
}
return true;
}
-
}
$ip = $this->getRequest()->getIP();
if ( !$wgBlockOpenProxies || $this->getRequest()->getText( 'ip' ) != md5( $ip . $wgProxyKey ) ) {
$this->getOutput()->addWikiMsg( 'proxyblocker-disabled' );
+
return;
}
return true;
}
}
+
return false;
}
$form .= ' ' . Xml::submitButton( $this->msg( 'booksources-go' )->text() ) . "</p>\n";
$form .= Html::closeElement( 'form' ) . "\n";
$form .= Html::closeElement( 'fieldset' ) . "\n";
+
return $form;
}
$text = $content->getNativeData();
$this->getOutput()->addWikiText( str_replace( 'MAGICNUMBER', $this->isbn, $text ) );
+
return true;
} else {
throw new MWException( "Unexpected content type for book sources: " . $content->getModel() );
foreach ( $items as $label => $url )
$this->getOutput()->addHTML( $this->makeListItem( $label, $url ) );
$this->getOutput()->addHTML( '</ul>' );
+
return true;
}
*/
private function makeListItem( $label, $url ) {
$url = str_replace( '$1', $this->isbn, $url );
+
return Html::rawElement( 'li', array(),
Html::element( 'a', array( 'href' => $url, 'class' => 'external' ), $label ) );
}
function getQueryInfo() {
$dbr = wfGetDB( DB_SLAVE );
+
return array(
'tables' => array(
'redirect',
$out .= $this->msg( 'parentheses' )->rawParams( $this->getLanguage()->pipeList( $links ) )->escaped();
$out .= " {$arr} {$to}";
+
return $out;
}
$this->getOutput()->setSubtitle( $this->cacheHelper->getCachedNotice( $this->getContext() ) );
}
}
-
}
function getDefaultQuery() {
parent::getDefaultQuery();
unset( $this->mDefaultQuery['from'] );
+
return $this->mDefaultQuery;
}
}
$batch->execute();
$this->mResult->rewind();
+
return parent::getBody();
}
$title = Title::makeTitle( NS_CATEGORY, $result->cat_title );
$titleText = Linker::link( $title, htmlspecialchars( $title->getText() ) );
$count = $this->msg( 'nmembers' )->numParams( $result->cat_pages )->escaped();
+
return Xml::tags( 'li', null, $this->getLanguage()->specialList( $titleText, $count ) ) . "\n";
}
Xml::inputLabel(
$this->msg( 'categoriesfrom' )->text(),
'from', 'from', 20, $from ) .
- ' ' .
- Xml::submitButton( $this->msg( 'allpagessubmit' )->text()
- )
+ ' ' .
+ Xml::submitButton( $this->msg( 'allpagessubmit' )->text()
+ )
)
);
}
*/
function isListed() {
global $wgAuth;
+
return $wgAuth->allowPropChange( 'emailaddress' );
}
if ( !$wgAuth->allowPropChange( 'emailaddress' ) ) {
$this->error( 'cannotchangeemail' );
+
return;
}
if ( !$request->wasPosted() && !$user->isLoggedIn() ) {
$this->error( 'changeemail-no-info' );
+
return;
}
if ( $request->wasPosted() && $request->getBool( 'wpCancel' ) ) {
$this->doReturnTo();
+
return;
}
$out .= "</td>\n";
$out .= "</tr>";
}
+
return $out;
}
if ( $newaddr != '' && !Sanitizer::validateEmail( $newaddr ) ) {
$this->error( 'invalidemailaddress' );
+
return false;
}
$throttleCount = LoginForm::incLoginThrottle( $user->getName() );
if ( $throttleCount === true ) {
$this->error( 'login-throttled' );
+
return false;
}
global $wgRequirePasswordforEmailChange;
if ( $wgRequirePasswordforEmailChange && !$user->checkTemporaryPassword( $pass ) && !$user->checkPassword( $pass ) ) {
$this->error( 'wrongpassword' );
+
return false;
}
'<p class="error">' .
$this->getOutput()->parseInline( $status->getWikiText( 'mailerror' ) ) .
'</p>' );
+
return false;
}
$user = $this->getUser();
if ( !$request->wasPosted() && !$user->isLoggedIn() ) {
$this->error( $this->msg( 'resetpass-no-info' )->text() );
+
return;
}
if ( $request->wasPosted() && $request->getBool( 'wpCancel' ) ) {
$this->doReturnTo();
+
return;
}
$this->mDomain = $wgAuth->getDomain();
if ( !$wgAuth->allowPasswordChange() ) {
$this->error( $this->msg( 'resetpass_forbidden' )->text() );
+
return;
}
$login->setContext( $this->getContext() );
$login->execute( null );
}
+
return;
} catch ( PasswordError $e ) {
$this->error( $e->getMessage() );
$out .= "</td>\n";
$out .= "</tr>";
}
+
return $out;
}
return $title->getLatestRevID();
}
}
+
return null;
}
if ( !$title->exists() ) {
return $this->msg( 'compare-title-not-exists' )->parseAsBlock();
}
+
return true;
}
if ( $revision === null ) {
return $this->msg( 'compare-revision-not-exists' )->parseAsBlock();
}
+
return true;
}
$user = User::newFromConfirmationCode( $code );
if ( !is_object( $user ) ) {
$this->getOutput()->addWikiMsg( 'confirmemail_invalid' );
+
return;
}
$user = User::newFromConfirmationCode( $code );
if ( !is_object( $user ) ) {
$this->getOutput()->addWikiMsg( 'confirmemail_invalid' );
+
return;
}
if ( !strlen( $target ) ) {
$out->addHTML( $this->getForm() );
+
return;
}
$nt = Title::makeTitleSafe( NS_USER, $target );
if ( !$nt ) {
$out->addHTML( $this->getForm() );
+
return;
}
$userObj = User::newFromName( $nt->getText(), false );
if ( !$userObj ) {
$out->addHTML( $this->getForm() );
+
return;
}
$id = $userObj->getID();
$url = wfAppendQuery( wfScript( 'api' ), $apiParams );
$out->redirect( $url, '301' );
+
return;
}
$oldMsg = $this->msg( 'contribsub' );
if ( $oldMsg->exists() ) {
$linksWithParentheses = $this->msg( 'parentheses' )->rawParams( $links )->escaped();
+
return $oldMsg->rawParams( "$user $linksWithParentheses" );
}
);
}
}
+
# Block log link
$tools[] = Linker::linkKnown(
SpecialPage::getTitleFor( 'Log', 'block' ),
}
wfRunHooks( 'ContributionsToolLinks', array( $id, $userpage, &$tools ) );
+
return $tools;
}
'class' => 'namespaceselector',
)
) . ' ' .
- Html::rawElement(
- 'span',
- array( 'style' => 'white-space: nowrap' ),
- Xml::checkLabel(
- $this->msg( 'invert' )->text(),
- 'nsInvert',
- 'nsInvert',
- $this->opts['nsInvert'],
- array(
- 'title' => $this->msg( 'tooltip-invert' )->text(),
- 'class' => 'mw-input'
- )
- ) . ' '
- ) .
- Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ),
- Xml::checkLabel(
- $this->msg( 'namespace_association' )->text(),
- 'associated',
- 'associated',
- $this->opts['associated'],
- array(
- 'title' => $this->msg( 'tooltip-namespace_association' )->text(),
- 'class' => 'mw-input'
- )
- ) . ' '
- )
+ Html::rawElement(
+ 'span',
+ array( 'style' => 'white-space: nowrap' ),
+ Xml::checkLabel(
+ $this->msg( 'invert' )->text(),
+ 'nsInvert',
+ 'nsInvert',
+ $this->opts['nsInvert'],
+ array(
+ 'title' => $this->msg( 'tooltip-invert' )->text(),
+ 'class' => 'mw-input'
+ )
+ ) . ' '
+ ) .
+ Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ),
+ Xml::checkLabel(
+ $this->msg( 'namespace_association' )->text(),
+ 'associated',
+ 'associated',
+ $this->opts['associated'],
+ array(
+ 'title' => $this->msg( 'tooltip-namespace_association' )->text(),
+ 'class' => 'mw-input'
+ )
+ ) . ' '
+ )
);
if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) {
function getDefaultQuery() {
$query = parent::getDefaultQuery();
$query['target'] = $this->target;
+
return $query;
}
);
wfRunHooks( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) );
+
return $queryInfo;
}
}
wfProfileOut( __METHOD__ );
+
return $ret;
}
function getQueryInfo() {
return array(
'tables' => array( 'page', 'pagelinks' ),
- 'fields' => array( 'namespace' => 'page_namespace',
- 'title' => 'page_title',
- 'value' => 'page_title'
+ 'fields' => array(
+ 'namespace' => 'page_namespace',
+ 'title' => 'page_title',
+ 'value' => 'page_title'
),
- 'conds' => array( 'pl_from IS NULL',
- 'page_namespace' => MWNamespace::getContentNamespaces(),
- 'page_is_redirect' => 0
+ 'conds' => array(
+ 'pl_from IS NULL',
+ 'page_namespace' => MWNamespace::getContentNamespaces(),
+ 'page_is_redirect' => 0
),
- 'join_conds' => array( 'pagelinks' => array( 'LEFT JOIN', array(
- 'page_id=pl_from'
- ) ) )
+ 'join_conds' => array(
+ 'pagelinks' => array(
+ 'LEFT JOIN',
+ array( 'page_id=pl_from' )
+ )
+ )
);
}
function getOrderFields() {
// For some crazy reason ordering by a constant
// causes a filesort
- if( count( MWNamespace::getContentNamespaces() ) > 1 ) {
+ if ( count( MWNamespace::getContentNamespaces() ) > 1 ) {
return array( 'page_namespace', 'page_title' );
} else {
return array( 'page_title' );
function getDefaultQuery() {
$query = parent::getDefaultQuery();
$query['target'] = $this->target;
+
return $query;
}
$conds[] = $this->mDb->bitAnd( 'ar_deleted', Revision::SUPPRESSED_USER ) .
' != ' . Revision::SUPPRESSED_USER;
}
+
return array(
'tables' => array( 'archive' ),
'fields' => array(
$ret = Html::rawElement( 'li', array(), $ret ) . "\n";
wfProfileOut( __METHOD__ );
+
return $ret;
}
if ( !$this->userCanExecute( $user ) ) {
$this->displayRestrictionError();
+
return;
}
if ( !strlen( $target ) ) {
$out->addHTML( $this->getForm( '' ) );
+
return;
}
$userObj = User::newFromName( $target, false );
if ( !$userObj ) {
$out->addHTML( $this->getForm( '' ) );
+
return;
}
$this->getSkin()->setRelevantUser( $userObj );
$pager = new DeletedContribsPager( $this->getContext(), $target, $options['namespace'] );
if ( !$pager->getNumRows() ) {
$out->addWikiMsg( 'nocontribs' );
+
return;
}
# If the text can be treated as a title, use it verbatim.
# Otherwise, pull the titles from the links table
$dp = Title::newFromText( $dMsgText );
- if( $dp ) {
- if( $dp->getNamespace() != NS_TEMPLATE ) {
+ if ( $dp ) {
+ if ( $dp->getNamespace() != NS_TEMPLATE ) {
# @todo FIXME: We assume the disambiguation message is a template but
# the page can potentially be from another namespace :/
wfDebug( "Mediawiki:disambiguationspage message does not refer to a template!\n" );
}
$linkBatch->addObj( $dp );
} else {
- # Get all the templates linked from the Mediawiki:Disambiguationspage
- $disPageObj = Title::makeTitleSafe( NS_MEDIAWIKI, 'disambiguationspage' );
- $res = $dbr->select(
- array( 'pagelinks', 'page' ),
- 'pl_title',
- array( 'page_id = pl_from',
- 'pl_namespace' => NS_TEMPLATE,
- 'page_namespace' => $disPageObj->getNamespace(),
- 'page_title' => $disPageObj->getDBkey()
- ), __METHOD__ );
-
- foreach ( $res as $row ) {
- $linkBatch->addObj( Title::makeTitle( NS_TEMPLATE, $row->pl_title ));
- }
+ # Get all the templates linked from the Mediawiki:Disambiguationspage
+ $disPageObj = Title::makeTitleSafe( NS_MEDIAWIKI, 'disambiguationspage' );
+ $res = $dbr->select(
+ array( 'pagelinks', 'page' ),
+ 'pl_title',
+ array(
+ 'page_id = pl_from',
+ 'pl_namespace' => NS_TEMPLATE,
+ 'page_namespace' => $disPageObj->getNamespace(),
+ 'page_title' => $disPageObj->getDBkey()
+ ),
+ __METHOD__
+ );
+
+ foreach ( $res as $row ) {
+ $linkBatch->addObj( Title::makeTitle( NS_TEMPLATE, $row->pl_title ) );
+ }
}
$set = $linkBatch->constructSet( 'tl', $dbr );
- if( $set === false ) {
+ if ( $set === false ) {
# We must always return a valid SQL query, but this way
# the DB will always quickly return an empty result
$set = 'FALSE';
// using the filter of reallyGetQueryInfo.
if ( $result && !isset( $result->nsb ) ) {
$dbr = wfGetDB( DB_SLAVE );
- $qi = $this->reallyGetQueryInfo( $result->namespace,
- $result->title );
- $res = $dbr->select( $qi['tables'], $qi['fields'],
- $qi['conds'], __METHOD__ );
+ $qi = $this->reallyGetQueryInfo(
+ $result->namespace,
+ $result->title
+ );
+ $res = $dbr->select(
+ $qi['tables'],
+ $qi['fields'],
+ $qi['conds'],
+ __METHOD__
+ );
+
if ( $res ) {
$result = $dbr->fetchObject( $res );
}
$lang = $this->getLanguage();
$arr = $lang->getArrow() . $lang->getDirMark();
- return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
+ return ( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
}
protected function getGroupName() {
* @author Rob Church <robchur@gmail.com>
*/
class SpecialEditWatchlist extends UnlistedSpecialPage {
-
/**
* Editing modes
*/
$out = $this->getOutput();
# Anons don't get a watchlist
- if( $this->getUser()->isAnon() ) {
+ if ( $this->getUser()->isAnon() ) {
$out->setPageTitle( $this->msg( 'watchnologin' ) );
$llink = Linker::linkKnown(
SpecialPage::getTitleFor( 'Userlogin' ),
array( 'returnto' => $this->getTitle()->getPrefixedText() )
);
$out->addHTML( $this->msg( 'watchlistanontext' )->rawParams( $llink )->parse() );
+
return;
}
$this->outputHeader();
- $out->addSubtitle( $this->msg( 'watchlistfor2', $this->getUser()->getName()
- )->rawParams( SpecialEditWatchlist::buildTools( null ) ) );
+ $out->addSubtitle( $this->msg( 'watchlistfor2', $this->getUser()->getName() )
+ ->rawParams( SpecialEditWatchlist::buildTools( null ) ) );
# B/C: $mode used to be waaay down the parameter list, and the first parameter
# was $wgUser
- if( $mode instanceof User ) {
+ if ( $mode instanceof User ) {
$args = func_get_args();
if ( count( $args ) >= 4 ) {
$mode = $args[3];
}
$mode = self::getMode( $this->getRequest(), $mode );
- switch( $mode ) {
+ switch ( $mode ) {
case self::EDIT_CLEAR:
// The "Clear" link scared people too much.
// Pass on to the raw editor, from which it's very easy to clear.
case self::EDIT_RAW:
$out->setPageTitle( $this->msg( 'watchlistedit-raw-title' ) );
$form = $this->getRawForm();
- if( $form->show() ) {
+ if ( $form->show() ) {
$out->addHTML( $this->successMessage );
$out->addReturnTo( SpecialPage::getTitleFor( 'Watchlist' ) );
}
default:
$out->setPageTitle( $this->msg( 'watchlistedit-normal-title' ) );
$form = $this->getNormalForm();
- if( $form->show() ) {
+ if ( $form->show() ) {
$out->addHTML( $this->successMessage );
$out->addReturnTo( SpecialPage::getTitleFor( 'Watchlist' ) );
} elseif ( $this->toc !== false ) {
*/
private function extractTitles( $list ) {
$list = explode( "\n", trim( $list ) );
- if( !is_array( $list ) ) {
+ if ( !is_array( $list ) ) {
return array();
}
+
$titles = array();
- foreach( $list as $text ) {
+
+ foreach ( $list as $text ) {
$text = trim( $text );
- if( strlen( $text ) > 0 ) {
+ if ( strlen( $text ) > 0 ) {
$title = Title::newFromText( $text );
- if( $title instanceof Title && $title->isWatchable() ) {
+ if ( $title instanceof Title && $title->isWatchable() ) {
$titles[] = $title;
}
}
GenderCache::singleton()->doTitlesArray( $titles );
$list = array();
- foreach( $titles as $title ) {
+ /** @var Title $title */
+ foreach ( $titles as $title ) {
$list[] = $title->getPrefixedText();
}
+
return array_unique( $list );
}
$wanted = $this->extractTitles( $data['Titles'] );
$current = $this->getWatchlist();
- if( count( $wanted ) > 0 ) {
+ if ( count( $wanted ) > 0 ) {
$toWatch = array_diff( $wanted, $current );
$toUnwatch = array_diff( $current, $wanted );
$this->watchTitles( $toWatch );
$this->unwatchTitles( $toUnwatch );
$this->getUser()->invalidateCache();
- if( count( $toWatch ) > 0 || count( $toUnwatch ) > 0 ) {
+ if ( count( $toWatch ) > 0 || count( $toUnwatch ) > 0 ) {
$this->successMessage = $this->msg( 'watchlistedit-raw-done' )->parse();
} else {
return false;
}
- if( count( $toWatch ) > 0 ) {
+ if ( count( $toWatch ) > 0 ) {
$this->successMessage .= ' ' . $this->msg( 'watchlistedit-raw-added'
- )->numParams( count( $toWatch ) )->parse();
+ )->numParams( count( $toWatch ) )->parse();
$this->showTitles( $toWatch, $this->successMessage );
}
- if( count( $toUnwatch ) > 0 ) {
+ if ( count( $toUnwatch ) > 0 ) {
$this->successMessage .= ' ' . $this->msg( 'watchlistedit-raw-removed'
- )->numParams( count( $toUnwatch ) )->parse();
+ )->numParams( count( $toUnwatch ) )->parse();
$this->showTitles( $toUnwatch, $this->successMessage );
}
} else {
$this->clearWatchlist();
$this->getUser()->invalidateCache();
- if( count( $current ) > 0 ) {
+ if ( count( $current ) > 0 ) {
$this->successMessage = $this->msg( 'watchlistedit-raw-done' )->parse();
} else {
return false;
}
- $this->successMessage .= ' ' . $this->msg( 'watchlistedit-raw-removed'
- )->numParams( count( $current ) )->parse();
+ $this->successMessage .= ' ' . $this->msg( 'watchlistedit-raw-removed' )
+ ->numParams( count( $current ) )->parse();
$this->showTitles( $current, $this->successMessage );
}
+
return true;
}
$talk = $this->msg( 'talkpagelinktext' )->escaped();
// Do a batch existence check
$batch = new LinkBatch();
- foreach( $titles as $title ) {
- if( !$title instanceof Title ) {
+ foreach ( $titles as $title ) {
+ if ( !$title instanceof Title ) {
$title = Title::newFromText( $title );
}
- if( $title instanceof Title ) {
+
+ if ( $title instanceof Title ) {
$batch->addObj( $title );
$batch->addObj( $title->getTalkPage() );
}
}
+
$batch->execute();
+
// Print out the list
$output .= "<ul>\n";
- foreach( $titles as $title ) {
- if( !$title instanceof Title ) {
+
+ foreach ( $titles as $title ) {
+ if ( !$title instanceof Title ) {
$title = Title::newFromText( $title );
}
- if( $title instanceof Title ) {
+
+ if ( $title instanceof Title ) {
$output .= "<li>"
. Linker::link( $title )
. ' (' . Linker::link( $title->getTalkPage(), $talk )
. ")</li>\n";
}
}
+
$output .= "</ul>\n";
}
private function getWatchlist() {
$list = array();
$dbr = wfGetDB( DB_MASTER );
+
$res = $dbr->select(
'watchlist',
array(
),
__METHOD__
);
- if( $res->numRows() > 0 ) {
+
+ if ( $res->numRows() > 0 ) {
$titles = array();
foreach ( $res as $row ) {
$title = Title::makeTitleSafe( $row->wl_namespace, $row->wl_title );
+
if ( $this->checkTitle( $title, $row->wl_namespace, $row->wl_title )
&& !$title->isTalkPage()
) {
GenderCache::singleton()->doTitlesArray( $titles );
- foreach( $titles as $title ) {
+ foreach ( $titles as $title ) {
$list[] = $title->getPrefixedText();
}
}
+
$this->cleanupWatchlist();
+
return $list;
}
);
$lb = new LinkBatch();
+
foreach ( $res as $row ) {
$lb->add( $row->wl_namespace, $row->wl_title );
if ( !MWNamespace::isTalk( $row->wl_namespace ) ) {
}
$lb->execute();
+
return $titles;
}
) {
$title = false; // unrecoverable
}
+
if ( !$title
|| $title->getNamespace() != $namespace
|| $title->getDBkey() != $dbKey
) {
$this->badItems[] = array( $title, $namespace, $dbKey );
}
+
return (bool)$title;
}
* Attempts to clean up broken items
*/
private function cleanupWatchlist() {
- if( !count( $this->badItems ) ) {
+ if ( !count( $this->badItems ) ) {
return; //nothing to do
}
+
$dbw = wfGetDB( DB_MASTER );
$user = $this->getUser();
+
foreach ( $this->badItems as $row ) {
list( $title, $namespace, $dbKey ) = $row;
- wfDebug( "User {$user->getName()} has broken watchlist item ns($namespace):$dbKey, "
- . ( $title ? 'cleaning up' : 'deleting' ) . ".\n"
- );
+ $action = $title ? 'cleaning up' : 'deleting';
+ wfDebug( "User {$user->getName()} has broken watchlist item ns($namespace):$dbKey, $action.\n" );
$dbw->delete( 'watchlist',
array(
private function watchTitles( $titles ) {
$dbw = wfGetDB( DB_MASTER );
$rows = array();
- foreach( $titles as $title ) {
- if( !$title instanceof Title ) {
+
+ foreach ( $titles as $title ) {
+ if ( !$title instanceof Title ) {
$title = Title::newFromText( $title );
}
- if( $title instanceof Title ) {
+
+ if ( $title instanceof Title ) {
$rows[] = array(
'wl_user' => $this->getUser()->getId(),
'wl_namespace' => MWNamespace::getSubject( $title->getNamespace() ),
);
}
}
+
$dbw->insert( 'watchlist', $rows, __METHOD__, 'IGNORE' );
}
*/
private function unwatchTitles( $titles ) {
$dbw = wfGetDB( DB_MASTER );
- foreach( $titles as $title ) {
- if( !$title instanceof Title ) {
+
+ foreach ( $titles as $title ) {
+ if ( !$title instanceof Title ) {
$title = Title::newFromText( $title );
}
- if( $title instanceof Title ) {
+
+ if ( $title instanceof Title ) {
$dbw->delete(
'watchlist',
array(
),
__METHOD__
);
+
$dbw->delete(
'watchlist',
array(
),
__METHOD__
);
+
$page = WikiPage::factory( $title );
wfRunHooks( 'UnwatchArticleComplete', array( $this->getUser(), &$page ) );
}
public function submitNormal( $data ) {
$removed = array();
- foreach( $data as $titles ) {
+ foreach ( $data as $titles ) {
$this->unwatchTitles( $titles );
$removed = array_merge( $removed, $titles );
}
- if( count( $removed ) > 0 ) {
+ if ( count( $removed ) > 0 ) {
$this->successMessage = $this->msg( 'watchlistedit-normal-done'
- )->numParams( count( $removed ) )->parse();
+ )->numParams( count( $removed ) )->parse();
$this->showTitles( $removed, $this->successMessage );
+
return true;
} else {
return false;
$fields = array();
$count = 0;
- foreach( $this->getWatchlistInfo() as $namespace => $pages ) {
+ foreach ( $this->getWatchlistInfo() as $namespace => $pages ) {
if ( $namespace >= 0 ) {
$fields['TitlesNs' . $namespace] = array(
'class' => 'EditWatchlistCheckboxSeriesField',
);
}
- foreach( array_keys( $pages ) as $dbkey ) {
+ foreach ( array_keys( $pages ) as $dbkey ) {
$title = Title::makeTitleSafe( $namespace, $dbkey );
+
if ( $this->checkTitle( $title, $namespace, $dbkey ) ) {
$text = $this->buildRemoveLine( $title );
$fields['TitlesNs' . $namespace]['options'][$text] = $title->getPrefixedText();
if ( count( $fields ) > 1 && $count > 30 ) {
$this->toc = Linker::tocIndent();
$tocLength = 0;
- foreach( $fields as $data ) {
+ foreach ( $fields as $data ) {
# strip out the 'ns' prefix from the section name:
$ns = substr( $data['section'], 2 );
- $nsText = ($ns == NS_MAIN)
+ $nsText = ( $ns == NS_MAIN )
? $this->msg( 'blanknamespace' )->escaped()
: htmlspecialchars( $wgContLang->getFormattedNsText( $ns ) );
$this->toc .= Linker::tocLine( "editwatchlist-{$data['section']}", $nsText,
$this->getLanguage()->formatNum( ++$tocLength ), 1 ) . Linker::tocLineEnd();
}
+
$this->toc = Linker::tocList( $this->toc );
} else {
$this->toc = false;
$form->setWrapperLegendMsg( 'watchlistedit-normal-legend' );
$form->addHeaderText( $this->msg( 'watchlistedit-normal-explain' )->parse() );
$form->setSubmitCallback( array( $this, 'submitNormal' ) );
+
return $form;
}
*/
private function buildRemoveLine( $title ) {
$link = Linker::link( $title );
- if( $title->isRedirect() ) {
+
+ if ( $title->isRedirect() ) {
// Linker already makes class mw-redirect, so this is redundant
$link = '<span class="watchlistredir">' . $link . '</span>';
}
+
$tools[] = Linker::link( $title->getTalkPage(), $this->msg( 'talkpagelinktext' )->escaped() );
- if( $title->exists() ) {
+
+ if ( $title->exists() ) {
$tools[] = Linker::linkKnown(
$title,
$this->msg( 'history_short' )->escaped(),
array( 'action' => 'history' )
);
}
- if( $title->getNamespace() == NS_USER && !$title->isSubpage() ) {
+
+ if ( $title->getNamespace() == NS_USER && !$title->isSubpage() ) {
$tools[] = Linker::linkKnown(
SpecialPage::getTitleFor( 'Contributions', $title->getText() ),
$this->msg( 'contributions' )->escaped()
$form->setWrapperLegendMsg( 'watchlistedit-raw-legend' );
$form->addHeaderText( $this->msg( 'watchlistedit-raw-explain' )->parse() );
$form->setSubmitCallback( array( $this, 'submitRaw' ) );
+
return $form;
}
*/
public static function getMode( $request, $par ) {
$mode = strtolower( $request->getVal( 'action', $par ) );
- switch( $mode ) {
+
+ switch ( $mode ) {
case 'clear':
case self::EDIT_CLEAR:
return self::EDIT_CLEAR;
-
case 'raw':
case self::EDIT_RAW:
return self::EDIT_RAW;
-
case 'edit':
case self::EDIT_NORMAL:
return self::EDIT_NORMAL;
-
default:
return false;
}
'edit' => array( 'EditWatchlist', false ),
'raw' => array( 'EditWatchlist', 'raw' ),
);
- foreach( $modes as $mode => $arr ) {
+
+ foreach ( $modes as $mode => $arr ) {
// can use messages 'watchlisttools-view', 'watchlisttools-edit', 'watchlisttools-raw'
$tools[] = Linker::linkKnown(
SpecialPage::getTitleFor( $arr[0], $arr[1] ),
wfMessage( "watchlisttools-{$mode}" )->escaped()
);
}
- return Html::rawElement( 'span',
- array( 'class' => 'mw-watchlist-toollinks' ),
- wfMessage( 'parentheses', $wgLang->pipeList( $tools ) )->text() );
+
+ return Html::rawElement(
+ 'span',
+ array( 'class' => 'mw-watchlist-toollinks' ),
+ wfMessage( 'parentheses', $wgLang->pipeList( $tools ) )->text()
+ );
}
}
# B/C since 1.18
-class WatchlistEditor extends SpecialEditWatchlist {}
+class WatchlistEditor extends SpecialEditWatchlist {
+}
/**
* Extend HTMLForm purely so we can have a more sane way of getting the section headers
class EditWatchlistNormalHTMLForm extends HTMLForm {
public function getLegend( $namespace ) {
$namespace = substr( $namespace, 2 );
+
return $namespace == NS_MAIN
? $this->msg( 'blanknamespace' )->escaped()
: htmlspecialchars( $this->getContext()->getLanguage()->getFormattedNsText( $namespace ) );
}
+
public function getBody() {
return $this->displaySection( $this->mFieldTree, '', 'editwatchlist-' );
}
class SpecialEmailUser extends UnlistedSpecialPage {
protected $mTarget;
+ /**
+ * @var User|string $mTargetObj
+ */
+ protected $mTargetObj;
+
public function __construct() {
parent::__construct( 'Emailuser' );
}
public function getDescription() {
$target = self::getTarget( $this->mTarget );
- if( !$target instanceof User ) {
+ if ( !$target instanceof User ) {
return $this->msg( 'emailuser-title-notarget' )->text();
}
$this->outputHeader();
// error out if sending user cannot do this
- $error = self::getPermissionsError( $this->getUser(), $this->getRequest()->getVal( 'wpEditToken' ) );
+ $error = self::getPermissionsError(
+ $this->getUser(),
+ $this->getRequest()->getVal( 'wpEditToken' )
+ );
+
switch ( $error ) {
case null:
# Wahey!
}
// Got a valid target user name? Else ask for one.
$ret = self::getTarget( $this->mTarget );
- if( !$ret instanceof User ) {
- if( $this->mTarget != '' ) {
+ if ( !$ret instanceof User ) {
+ if ( $this->mTarget != '' ) {
$ret = ( $ret == 'notarget' ) ? 'emailnotarget' : ( $ret . 'text' );
$out->wrapWikiMsg( "<p class='error'>$1</p>", $ret );
}
$out->addHTML( $this->userForm( $this->mTarget ) );
+
return false;
}
$form->setWrapperLegendMsg( 'email-legend' );
$form->loadData();
- if( !wfRunHooks( 'EmailUserForm', array( &$form ) ) ) {
+ if ( !wfRunHooks( 'EmailUserForm', array( &$form ) ) ) {
return false;
}
$result = $form->show();
- if( $result === true || ( $result instanceof Status && $result->isGood() ) ) {
+ if ( $result === true || ( $result instanceof Status && $result->isGood() ) ) {
$out->setPageTitle( $this->msg( 'emailsent' ) );
$out->addWikiMsg( 'emailsenttext' );
$out->returnToMain( false, $this->mTargetObj->getUserPage() );
public static function getTarget( $target ) {
if ( $target == '' ) {
wfDebug( "Target is empty.\n" );
+
return 'notarget';
}
$nu = User::newFromName( $target );
- if( !$nu instanceof User || !$nu->getId() ) {
+ if ( !$nu instanceof User || !$nu->getId() ) {
wfDebug( "Target is invalid user.\n" );
+
return 'notarget';
} elseif ( !$nu->isEmailConfirmed() ) {
wfDebug( "User has no valid email.\n" );
+
return 'noemail';
} elseif ( !$nu->canReceiveEmail() ) {
wfDebug( "User does not allow user emails.\n" );
+
return 'nowikiemail';
}
*/
public static function getPermissionsError( $user, $editToken ) {
global $wgEnableEmail, $wgEnableUserEmail;
- if( !$wgEnableEmail || !$wgEnableUserEmail ) {
+
+ if ( !$wgEnableEmail || !$wgEnableUserEmail ) {
return 'usermaildisabled';
}
- if( !$user->isAllowed( 'sendemail' ) ) {
+ if ( !$user->isAllowed( 'sendemail' ) ) {
return 'badaccess';
}
- if( !$user->isEmailConfirmed() ) {
+ if ( !$user->isEmailConfirmed() ) {
return 'mailnologin';
}
- if( $user->isBlockedFromEmailuser() ) {
+ if ( $user->isBlockedFromEmailuser() ) {
wfDebug( "User is blocked from sending e-mail.\n" );
+
return "blockedemailuser";
}
- if( $user->pingLimiter( 'emailuser' ) ) {
+ if ( $user->pingLimiter( 'emailuser' ) ) {
wfDebug( "Ping limiter triggered.\n" );
+
return 'actionthrottledtext';
}
$hookErr = false;
+
wfRunHooks( 'UserCanSendEmail', array( &$user, &$hookErr ) );
wfRunHooks( 'EmailUserPermissionsErrors', array( $user, $editToken, &$hookErr ) );
+
if ( $hookErr ) {
return $hookErr;
}
*/
protected function userForm( $name ) {
global $wgScript;
- $string = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'askusername' ) ) .
+ $string = Xml::openElement(
+ 'form',
+ array( 'method' => 'get', 'action' => $wgScript, 'id' => 'askusername' )
+ ) .
Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
Xml::openElement( 'fieldset' ) .
Html::rawElement( 'legend', null, $this->msg( 'emailtarget' )->parse() ) .
- Xml::inputLabel( $this->msg( 'emailusername' )->text(), 'target', 'emailusertarget', 30, $name ) . ' ' .
+ Xml::inputLabel(
+ $this->msg( 'emailusername' )->text(),
+ 'target',
+ 'emailusertarget',
+ 30,
+ $name
+ ) .
+ ' ' .
Xml::submitButton( $this->msg( 'emailusernamesubmit' )->text() ) .
Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' ) . "\n";
+
return $string;
}
global $wgUserEmailUseReplyTo;
$target = self::getTarget( $data['Target'] );
- if( !$target instanceof User ) {
+ if ( !$target instanceof User ) {
return $context->msg( $target . 'text' )->parseAsBlock();
}
+
$to = new MailAddress( $target );
$from = new MailAddress( $context->getUser() );
$subject = $data['Subject'];
$from->name, $to->name )->inContentLanguage()->text();
$error = '';
- if( !wfRunHooks( 'EmailUser', array( &$to, &$from, &$subject, &$text, &$error ) ) ) {
+ if ( !wfRunHooks( 'EmailUser', array( &$to, &$from, &$subject, &$text, &$error ) ) ) {
return $error;
}
- if( $wgUserEmailUseReplyTo ) {
+ if ( $wgUserEmailUseReplyTo ) {
// Put the generic wiki autogenerated address in the From:
// header and reserve the user for Reply-To.
//
// wiki-borne mails from direct mails and protects against
// SPF and bounce problems with some mailers (see below).
global $wgPasswordSender, $wgPasswordSenderName;
+
$mailFrom = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
$replyTo = $from;
} else {
$status = UserMailer::send( $to, $mailFrom, $subject, $text, $replyTo );
- if( !$status->isGood() ) {
+ if ( !$status->isGood() ) {
return $status;
} else {
// if the user requested a copy of this mail, do this now,
}
wfRunHooks( 'EmailUserComplete', array( $to, $from, $subject, $text ) );
+
return $status;
}
}
* @ingroup SpecialPage
*/
class SpecialExport extends SpecialPage {
-
private $curonly, $doExport, $pageLinkDepth, $templates;
private $images;
}
}
}
- }
- elseif( $request->getCheck( 'addns' ) && $wgExportFromNamespaces ) {
+ } elseif ( $request->getCheck( 'addns' ) && $wgExportFromNamespaces ) {
$page = $request->getText( 'pages' );
$nsindex = $request->getText( 'nsindex', '' );
$page .= "\n" . implode( "\n", $nspages );
}
}
- }
- elseif( $request->getCheck( 'exportall' ) && $wgExportAllowAll ) {
+ } elseif ( $request->getCheck( 'exportall' ) && $wgExportAllowAll ) {
$this->doExport = true;
$exportall = true;
doExport(...) further down) */
$page = '';
$history = '';
- }
- elseif( $request->wasPosted() && $par == '' ) {
+ } elseif ( $request->wasPosted() && $par == '' ) {
$page = $request->getText( 'pages' );
$this->curonly = $request->getCheck( 'curonly' );
$rawOffset = $request->getVal( 'offset' );
- if( $rawOffset ) {
+ if ( $rawOffset ) {
$offset = wfTimestamp( TS_MW, $rawOffset );
} else {
$offset = null;
if ( $limit > 0 && ( $wgExportMaxHistory == 0 || $limit < $wgExportMaxHistory ) ) {
$history['limit'] = $limit;
}
+
if ( !is_null( $offset ) ) {
$history['offset'] = $offset;
}
+
if ( strtolower( $dir ) == 'desc' ) {
$history['dir'] = 'desc';
}
}
- if( $page != '' ) {
+ if ( $page != '' ) {
$this->doExport = true;
}
} else {
$page = $request->getText( 'pages', $par );
$historyCheck = $request->getCheck( 'history' );
- if( $historyCheck ) {
+ if ( $historyCheck ) {
$history = WikiExporter::FULL;
} else {
$history = WikiExporter::CURRENT;
}
- if( $page != '' ) {
+ if ( $page != '' ) {
$this->doExport = true;
}
}
- if( !$wgExportAllowHistory ) {
+ if ( !$wgExportAllowHistory ) {
// Override
$history = WikiExporter::CURRENT;
}
wfResetOutputBuffers();
$request->response()->header( "Content-type: application/xml; charset=utf-8" );
- if( $request->getCheck( 'wpDownload' ) ) {
+ if ( $request->getCheck( 'wpDownload' ) ) {
// Provide a sane filename suggestion
$filename = urlencode( $wgSitename . '-' . wfTimestampNow() . '.xml' );
$request->response()->header( "Content-disposition: attachment;filename={$filename}" );
$form = Xml::openElement( 'form', array( 'method' => 'post',
'action' => $this->getTitle()->getLocalURL( 'action=submit' ) ) );
- $form .= Xml::inputLabel( $this->msg( 'export-addcattext' )->text(), 'catname', 'catname', 40 ) . ' ';
- $form .= Xml::submitButton( $this->msg( 'export-addcat' )->text(), array( 'name' => 'addcat' ) ) . '<br />';
+ $form .= Xml::inputLabel(
+ $this->msg( 'export-addcattext' )->text(),
+ 'catname',
+ 'catname',
+ 40
+ ) . ' ';
+ $form .= Xml::submitButton(
+ $this->msg( 'export-addcat' )->text(),
+ array( 'name' => 'addcat' )
+ ) . '<br />';
if ( $wgExportFromNamespaces ) {
$form .= Html::namespaceSelector(
'selected' => $nsindex,
'label' => $this->msg( 'export-addnstext' )->text()
), array(
- 'name' => 'nsindex',
- 'id' => 'namespace',
+ 'name' => 'nsindex',
+ 'id' => 'namespace',
'class' => 'namespaceselector',
)
) . ' ';
- $form .= Xml::submitButton( $this->msg( 'export-addns' )->text(), array( 'name' => 'addns' ) ) . '<br />';
+ $form .= Xml::submitButton(
+ $this->msg( 'export-addns' )->text(),
+ array( 'name' => 'addns' )
+ ) . '<br />';
}
if ( $wgExportAllowAll ) {
) . '<br />';
}
- $form .= Xml::element( 'textarea', array( 'name' => 'pages', 'cols' => 40, 'rows' => 10 ), $page, false );
+ $form .= Xml::element(
+ 'textarea',
+ array( 'name' => 'pages', 'cols' => 40, 'rows' => 10 ),
+ $page,
+ false
+ );
$form .= '<br />';
- if( $wgExportAllowHistory ) {
+ if ( $wgExportAllowHistory ) {
$form .= Xml::checkLabel(
$this->msg( 'exportcuronly' )->text(),
'curonly',
$request->wasPosted() ? $request->getCheck( 'templates' ) : false
) . '<br />';
- if( $wgExportMaxLinkDepth || $this->userCanOverrideExportDepth() ) {
- $form .= Xml::inputLabel( $this->msg( 'export-pagelinks' )->text(), 'pagelink-depth', 'pagelink-depth', 20, 0 ) . '<br />';
+ if ( $wgExportMaxLinkDepth || $this->userCanOverrideExportDepth() ) {
+ $form .= Xml::inputLabel(
+ $this->msg( 'export-pagelinks' )->text(),
+ 'pagelink-depth',
+ 'pagelink-depth',
+ 20,
+ 0
+ ) . '<br />';
}
+
// Enable this when we can do something useful exporting/importing image information. :)
//$form .= Xml::checkLabel( $this->msg( 'export-images' )->text(), 'images', 'wpExportImages', false ) . '<br />';
$form .= Xml::checkLabel(
) . '<br />';
}
- $form .= Xml::submitButton( $this->msg( 'export-submit' )->text(), Linker::tooltipAndAccesskeyAttribs( 'export' ) );
+ $form .= Xml::submitButton(
+ $this->msg( 'export-submit' )->text(),
+ Linker::tooltipAndAccesskeyAttribs( 'export' )
+ );
$form .= Xml::closeElement( 'form' );
$out->addHTML( $form );
$pageSet = array(); // Inverted index of all pages to look up
// Split up and normalize input
- foreach( explode( "\n", $page ) as $pageName ) {
+ foreach ( explode( "\n", $page ) as $pageName ) {
$pageName = trim( $pageName );
$title = Title::newFromText( $pageName );
- if( $title && $title->getInterwiki() == '' && $title->getText() !== '' ) {
+ if ( $title && $title->getInterwiki() == '' && $title->getText() !== '' ) {
// Only record each page once!
$pageSet[$title->getPrefixedText()] = true;
}
$inputPages = array_keys( $pageSet );
// Look up any linked pages if asked...
- if( $this->templates ) {
+ if ( $this->templates ) {
$pageSet = $this->getTemplates( $inputPages, $pageSet );
}
$linkDepth = $this->pageLinkDepth;
- if( $linkDepth ) {
+ if ( $linkDepth ) {
$pageSet = $this->getPageLinks( $inputPages, $pageSet, $linkDepth );
}
- /*
- // Enable this when we can do something useful exporting/importing image information. :)
- if( $this->images ) ) {
- $pageSet = $this->getImages( $inputPages, $pageSet );
- }
- */
+ // Enable this when we can do something useful exporting/importing image information.
+ // if( $this->images ) ) {
+ // $pageSet = $this->getImages( $inputPages, $pageSet );
+ // }
$pages = array_keys( $pageSet );
// Normalize titles to the same format and remove dupes, see bug 17374
- foreach( $pages as $k => $v ) {
+ foreach ( $pages as $k => $v ) {
$pages[$k] = str_replace( " ", "_", $v );
}
}
/* Ok, let's get to it... */
- if( $history == WikiExporter::CURRENT ) {
+ if ( $history == WikiExporter::CURRENT ) {
$lb = false;
$db = wfGetDB( DB_SLAVE );
$buffer = WikiExporter::BUFFER;
if ( $exportall ) {
$exporter->allPages();
} else {
- foreach( $pages as $page ) {
- /*
- if( $wgExportMaxHistory && !$this->curonly ) {
- $title = Title::newFromText( $page );
- if( $title ) {
- $count = Revision::countByTitle( $db, $title );
- if( $count > $wgExportMaxHistory ) {
- wfDebug( __FUNCTION__ .
- ": Skipped $page, $count revisions too big\n" );
- continue;
- }
- }
- }*/
- #Bug 8824: Only export pages the user can read
+ foreach ( $pages as $page ) {
+ #Bug 8824: Only export pages the user can read
$title = Title::newFromText( $page );
- if( is_null( $title ) ) {
- continue; #TODO: perhaps output an <error> tag or something.
+ if ( is_null( $title ) ) {
+ // @todo Perhaps output an <error> tag or something.
+ continue;
}
- if( !$title->userCan( 'read', $this->getUser() ) ) {
- continue; #TODO: perhaps output an <error> tag or something.
+
+ if ( !$title->userCan( 'read', $this->getUser() ) ) {
+ // @todo Perhaps output an <error> tag or something.
+ continue;
}
$exporter->pageByTitle( $title );
$exporter->closeStream();
- if( $lb ) {
+ if ( $lb ) {
$lb->closeAll();
}
}
$pages[] = $n;
}
+
return $pages;
}
$pages[] = $n;
}
+
return $pages;
}
private function validateLinkDepth( $depth ) {
global $wgExportMaxLinkDepth;
- if( $depth < 0 ) {
+ if ( $depth < 0 ) {
return 0;
}
if ( !$this->userCanOverrideExportDepth() ) {
- if( $depth > $wgExportMaxLinkDepth ) {
+ if ( $depth > $wgExportMaxLinkDepth ) {
return $wgExportMaxLinkDepth;
}
}
* crazy-big export from being done by someone setting the depth
* number too high. In other words, last resort safety net.
*/
+
return intval( min( $depth, 5 ) );
}
* @return array
*/
private function getPageLinks( $inputPages, $pageSet, $depth ) {
- for( ; $depth > 0; --$depth ) {
+ for ( ; $depth > 0; --$depth ) {
$pageSet = $this->getLinks(
$inputPages, $pageSet, 'pagelinks',
array( 'namespace' => 'pl_namespace', 'title' => 'pl_title' ),
private function getLinks( $inputPages, $pageSet, $table, $fields, $join ) {
$dbr = wfGetDB( DB_SLAVE );
- foreach( $inputPages as $page ) {
+ foreach ( $inputPages as $page ) {
$title = Title::newFromText( $page );
- if( $title ) {
+ if ( $title ) {
$pageSet[$title->getPrefixedText()] = true;
/// @todo FIXME: May or may not be more efficient to batch these
/// by namespace when given multiple input pages.
__METHOD__
);
- foreach( $result as $row ) {
+ foreach ( $result as $row ) {
$template = Title::makeTitle( $row->namespace, $row->title );
$pageSet[$template->getPrefixedText()] = true;
}
* @author Martin Drashkov
*/
class FewestrevisionsPage extends QueryPage {
-
function __construct( $name = 'Fewestrevisions' ) {
parent::__construct( $name );
}
function getQueryInfo() {
return array(
'tables' => array( 'revision', 'page' ),
- 'fields' => array( 'namespace' => 'page_namespace',
- 'title' => 'page_title',
- 'value' => 'COUNT(*)',
- 'redirect' => 'page_is_redirect' ),
- 'conds' => array( 'page_namespace' => MWNamespace::getContentNamespaces(),
- 'page_id = rev_page' ),
- 'options' => array( 'HAVING' => 'COUNT(*) > 1',
- // ^^^ This was probably here to weed out redirects.
- // Since we mark them as such now, it might be
- // useful to remove this. People _do_ create pages
- // and never revise them, they aren't necessarily
- // redirects.
- 'GROUP BY' => array( 'page_namespace', 'page_title', 'page_is_redirect' ) )
+ 'fields' => array(
+ 'namespace' => 'page_namespace',
+ 'title' => 'page_title',
+ 'value' => 'COUNT(*)',
+ 'redirect' => 'page_is_redirect'
+ ),
+ 'conds' => array(
+ 'page_namespace' => MWNamespace::getContentNamespaces(),
+ 'page_id = rev_page' ),
+ 'options' => array(
+ 'HAVING' => 'COUNT(*) > 1',
+ // ^^^ This was probably here to weed out redirects.
+ // Since we mark them as such now, it might be
+ // useful to remove this. People _do_ create pages
+ // and never revise them, they aren't necessarily
+ // redirects.
+ 'GROUP BY' => array( 'page_namespace', 'page_title', 'page_is_redirect' )
+ )
);
}
global $wgContLang;
$nt = Title::makeTitleSafe( $result->namespace, $result->title );
- if( !$nt ) {
- return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
- Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+ if ( !$nt ) {
+ return Html::element(
+ 'span',
+ array( 'class' => 'mw-invalidtitle' ),
+ Linker::getInvalidTitleDescription(
+ $this->getContext(),
+ $result->namespace,
+ $result->title
+ )
+ );
}
$text = htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) );
$this->setHeaders();
$this->outputHeader();
- $this->filename = isset( $par ) ? $par : $this->getRequest()->getText( 'filename' );
+ $this->filename = isset( $par ) ? $par : $this->getRequest()->getText( 'filename' );
$this->file = null;
$this->hash = '';
$title = Title::newFromText( $this->filename, NS_FILE );
- if( $title && $title->getText() != '' ) {
+ if ( $title && $title->getText() != '' ) {
$this->file = wfFindFile( $title );
}
# Create the input form
$out->addHTML(
- Html::openElement( 'form', array( 'id' => 'fileduplicatesearch', 'method' => 'get', 'action' => $wgScript ) ) . "\n" .
- Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" .
- Html::openElement( 'fieldset' ) . "\n" .
- Html::element( 'legend', null, $this->msg( 'fileduplicatesearch-legend' )->text() ) . "\n" .
- Xml::inputLabel( $this->msg( 'fileduplicatesearch-filename' )->text(), 'filename', 'filename', 50, $this->filename ) . "\n" .
- Xml::submitButton( $this->msg( 'fileduplicatesearch-submit' )->text() ) . "\n" .
- Html::closeElement( 'fieldset' ) . "\n" .
- Html::closeElement( 'form' )
+ Html::openElement(
+ 'form',
+ array( 'id' => 'fileduplicatesearch', 'method' => 'get', 'action' => $wgScript )
+ ) . "\n" .
+ Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" .
+ Html::openElement( 'fieldset' ) . "\n" .
+ Html::element( 'legend', null, $this->msg( 'fileduplicatesearch-legend' )->text() ) . "\n" .
+ Xml::inputLabel(
+ $this->msg( 'fileduplicatesearch-filename' )->text(),
+ 'filename',
+ 'filename',
+ 50,
+ $this->filename
+ ) . "\n" .
+ Xml::submitButton( $this->msg( 'fileduplicatesearch-submit' )->text() ) . "\n" .
+ Html::closeElement( 'fieldset' ) . "\n" .
+ Html::closeElement( 'form' )
);
- if( $this->file ) {
+ if ( $this->file ) {
$this->hash = $this->file->getSha1();
- } elseif( $this->filename !== '' ) {
+ } elseif ( $this->filename !== '' ) {
$out->wrapWikiMsg(
"<p class='mw-fileduplicatesearch-noresults'>\n$1\n</p>",
array( 'fileduplicatesearch-noresults', wfEscapeWikiText( $this->filename ) )
);
}
- if( $this->hash != '' ) {
+ if ( $this->hash != '' ) {
# Show a thumbnail of the file
$img = $this->file;
if ( $img ) {
$thumb = $img->transform( array( 'width' => 120, 'height' => 120 ) );
- if( $thumb ) {
+ if ( $thumb ) {
$out->addHTML( '<div id="mw-fileduplicatesearch-icon">' .
$thumb->toHtml( array( 'desc-link' => false ) ) . '<br />' .
$this->msg( 'fileduplicatesearch-info' )->numParams(
$img->getWidth(), $img->getHeight() )->params(
- $this->getLanguage()->formatSize( $img->getSize() ),
- $img->getMimeType() )->parseAsBlock() .
+ $this->getLanguage()->formatSize( $img->getSize() ),
+ $img->getMimeType() )->parseAsBlock() .
'</div>' );
}
}
$numRows = count( $dupes );
# Show a short summary
- if( $numRows == 1 ) {
+ if ( $numRows == 1 ) {
$out->wrapWikiMsg(
"<p class='mw-fileduplicatesearch-result-1'>\n$1\n</p>",
array( 'fileduplicatesearch-result-1', wfEscapeWikiText( $this->filename ) )
function doBatchLookups( $list ) {
$batch = new LinkBatch();
- foreach( $list as $file ) {
+ /** @var File $file */
+ foreach ( $list as $file ) {
$batch->addObj( $file->getTitle() );
- if( $file->isLocal() ) {
+ if ( $file->isLocal() ) {
$userName = $file->getUser( 'text' );
$batch->add( NS_USER, $userName );
$batch->add( NS_USER_TALK, $userName );
}
}
+
$batch->execute();
}
* @ingroup SpecialPage
*/
class SpecialFilepath extends SpecialPage {
-
function __construct() {
parent::__construct( 'Filepath' );
}
// If a width is requested...
if ( $width != -1 ) {
$mto = $file->transform( array( 'width' => $width, 'height' => $height ) );
+
// ... and we can
if ( $mto && !$mto->isError() ) {
// ... change the URL to point to a thumbnail.
global $wgScript;
$this->getOutput()->addHTML(
- Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'specialfilepath' ) ) .
- Html::openElement( 'fieldset' ) .
- Html::element( 'legend', null, $this->msg( 'filepath' )->text() ) .
- Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
- Xml::inputLabel( $this->msg( 'filepath-page' )->text(), 'file', 'file', 25, is_object( $title ) ? $title->getText() : '' ) . ' ' .
- Xml::submitButton( $this->msg( 'filepath-submit' )->text() ) . "\n" .
- Html::closeElement( 'fieldset' ) .
- Html::closeElement( 'form' )
+ Html::openElement(
+ 'form',
+ array( 'method' => 'get', 'action' => $wgScript, 'id' => 'specialfilepath' )
+ ) .
+ Html::openElement( 'fieldset' ) .
+ Html::element( 'legend', null, $this->msg( 'filepath' )->text() ) .
+ Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
+ Xml::inputLabel(
+ $this->msg( 'filepath-page' )->text(),
+ 'file',
+ 'file',
+ 25,
+ is_object( $title ) ? $title->getText() : ''
+ ) . ' ' .
+ Xml::submitButton( $this->msg( 'filepath-submit' )->text() ) . "\n" .
+ Html::closeElement( 'fieldset' ) .
+ Html::closeElement( 'form' )
);
}
* @ingroup SpecialPage
*/
class SpecialImport extends SpecialPage {
-
private $interwiki = false;
private $namespace;
private $rootpage = '';
$source = Status::newFatal( 'import-token-mismatch' );
} elseif ( $sourceName == 'upload' ) {
$isUpload = true;
- if( $user->isAllowed( 'importupload' ) ) {
+ if ( $user->isAllowed( 'importupload' ) ) {
$source = ImportStreamSource::newFromUpload( "xmlimport" );
} else {
throw new PermissionsError( 'importupload' );
}
} elseif ( $sourceName == "interwiki" ) {
- if( !$user->isAllowed( 'import' ) ) {
+ if ( !$user->isAllowed( 'import' ) ) {
throw new PermissionsError( 'import' );
}
$this->interwiki = $request->getVal( 'interwiki' );
}
$out = $this->getOutput();
- if( !$source->isGood() ) {
- $out->wrapWikiMsg( "<p class=\"error\">\n$1\n</p>", array( 'importfailed', $source->getWikiText() ) );
+ if ( !$source->isGood() ) {
+ $out->wrapWikiMsg(
+ "<p class=\"error\">\n$1\n</p>",
+ array( 'importfailed', $source->getWikiText() )
+ );
} else {
$importer = new WikiImporter( $source->value );
- if( !is_null( $this->namespace ) ) {
+ if ( !is_null( $this->namespace ) ) {
$importer->setTargetNamespace( $this->namespace );
}
- if( !is_null( $this->rootpage ) ) {
+ if ( !is_null( $this->rootpage ) ) {
$statusRootPage = $importer->setTargetRootPage( $this->rootpage );
- if( !$statusRootPage->isGood() ) {
- $out->wrapWikiMsg( "<p class=\"error\">\n$1\n</p>", array( 'import-options-wrong', $statusRootPage->getWikiText(), count( $statusRootPage->getErrorsArray() ) ) );
+ if ( !$statusRootPage->isGood() ) {
+ $out->wrapWikiMsg(
+ "<p class=\"error\">\n$1\n</p>",
+ array(
+ 'import-options-wrong',
+ $statusRootPage->getWikiText(),
+ count( $statusRootPage->getErrorsArray() )
+ )
+ );
+
return;
}
}
$out->addWikiMsg( "importstart" );
- $reporter = new ImportReporter( $importer, $isUpload, $this->interwiki, $this->logcomment );
+ $reporter = new ImportReporter(
+ $importer,
+ $isUpload,
+ $this->interwiki,
+ $this->logcomment
+ );
$reporter->setContext( $this->getContext() );
$exception = false;
if ( $exception ) {
# No source or XML parse error
- $out->wrapWikiMsg( "<p class=\"error\">\n$1\n</p>", array( 'importfailed', $exception->getMessage() ) );
- } elseif( !$result->isGood() ) {
+ $out->wrapWikiMsg(
+ "<p class=\"error\">\n$1\n</p>",
+ array( 'importfailed', $exception->getMessage() )
+ );
+ } elseif ( !$result->isGood() ) {
# Zero revisions
- $out->wrapWikiMsg( "<p class=\"error\">\n$1\n</p>", array( 'importfailed', $result->getWikiText() ) );
+ $out->wrapWikiMsg(
+ "<p class=\"error\">\n$1\n</p>",
+ array( 'importfailed', $result->getWikiText() )
+ );
} else {
# Success!
$out->addWikiMsg( 'importsuccess' );
$user = $this->getUser();
$out = $this->getOutput();
- if( $user->isAllowed( 'importupload' ) ) {
+ if ( $user->isAllowed( 'importupload' ) ) {
$out->addHTML(
Xml::fieldset( $this->msg( 'import-upload' )->text() ) .
- Xml::openElement( 'form', array( 'enctype' => 'multipart/form-data', 'method' => 'post',
- 'action' => $action, 'id' => 'mw-import-upload-form' ) ) .
- $this->msg( 'importtext' )->parseAsBlock() .
- Html::hidden( 'action', 'submit' ) .
- Html::hidden( 'source', 'upload' ) .
- Xml::openElement( 'table', array( 'id' => 'mw-import-table-upload' ) ) .
-
- "<tr>
+ Xml::openElement(
+ 'form',
+ array(
+ 'enctype' => 'multipart/form-data',
+ 'method' => 'post',
+ 'action' => $action,
+ 'id' => 'mw-import-upload-form'
+ )
+ ) .
+ $this->msg( 'importtext' )->parseAsBlock() .
+ Html::hidden( 'action', 'submit' ) .
+ Html::hidden( 'source', 'upload' ) .
+ Xml::openElement( 'table', array( 'id' => 'mw-import-table-upload' ) ) .
+ "<tr>
<td class='mw-label'>" .
- Xml::label( $this->msg( 'import-upload-filename' )->text(), 'xmlimport' ) .
+ Xml::label( $this->msg( 'import-upload-filename' )->text(), 'xmlimport' ) .
"</td>
<td class='mw-input'>" .
- Html::input( 'xmlimport', '', 'file', array( 'id' => 'xmlimport' ) ) . ' ' .
+ Html::input( 'xmlimport', '', 'file', array( 'id' => 'xmlimport' ) ) . ' ' .
"</td>
</tr>
<tr>
<td class='mw-label'>" .
- Xml::label( $this->msg( 'import-comment' )->text(), 'mw-import-comment' ) .
+ Xml::label( $this->msg( 'import-comment' )->text(), 'mw-import-comment' ) .
"</td>
<td class='mw-input'>" .
- Xml::input( 'log-comment', 50, '',
- array( 'id' => 'mw-import-comment', 'type' => 'text' ) ) . ' ' .
+ Xml::input( 'log-comment', 50, '',
+ array( 'id' => 'mw-import-comment', 'type' => 'text' ) ) . ' ' .
"</td>
</tr>
<tr>
<td class='mw-label'>" .
- Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage-upload' ) .
+ Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage-upload' ) .
"</td>
<td class='mw-input'>" .
- Xml::input( 'rootpage', 50, $this->rootpage,
- array( 'id' => 'mw-interwiki-rootpage-upload', 'type' => 'text' ) ) . ' ' .
+ Xml::input( 'rootpage', 50, $this->rootpage,
+ array( 'id' => 'mw-interwiki-rootpage-upload', 'type' => 'text' ) ) . ' ' .
"</td>
</tr>
<tr>
<td></td>
<td class='mw-submit'>" .
- Xml::submitButton( $this->msg( 'uploadbtn' )->text() ) .
+ Xml::submitButton( $this->msg( 'uploadbtn' )->text() ) .
"</td>
</tr>" .
- Xml::closeElement( 'table' ) .
- Html::hidden( 'editToken', $user->getEditToken() ) .
- Xml::closeElement( 'form' ) .
- Xml::closeElement( 'fieldset' )
+ Xml::closeElement( 'table' ) .
+ Html::hidden( 'editToken', $user->getEditToken() ) .
+ Xml::closeElement( 'form' ) .
+ Xml::closeElement( 'fieldset' )
);
} else {
- if( empty( $wgImportSources ) ) {
+ if ( empty( $wgImportSources ) ) {
$out->addWikiMsg( 'importnosources' );
}
}
- if( $user->isAllowed( 'import' ) && !empty( $wgImportSources ) ) {
+ if ( $user->isAllowed( 'import' ) && !empty( $wgImportSources ) ) {
# Show input field for import depth only if $wgExportMaxLinkDepth > 0
$importDepth = '';
- if( $wgExportMaxLinkDepth > 0 ) {
+ if ( $wgExportMaxLinkDepth > 0 ) {
$importDepth = "<tr>
<td class='mw-label'>" .
- $this->msg( 'export-pagelinks' )->parse() .
- "</td>
+ $this->msg( 'export-pagelinks' )->parse() .
+ "</td>
<td class='mw-input'>" .
- Xml::input( 'pagelink-depth', 3, 0 ) .
- "</td>
- </tr>";
+ Xml::input( 'pagelink-depth', 3, 0 ) .
+ "</td>
+ </tr>";
}
$out->addHTML(
Xml::fieldset( $this->msg( 'importinterwiki' )->text() ) .
- Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'mw-import-interwiki-form' ) ) .
- $this->msg( 'import-interwiki-text' )->parseAsBlock() .
- Html::hidden( 'action', 'submit' ) .
- Html::hidden( 'source', 'interwiki' ) .
- Html::hidden( 'editToken', $user->getEditToken() ) .
- Xml::openElement( 'table', array( 'id' => 'mw-import-table-interwiki' ) ) .
- "<tr>
+ Xml::openElement(
+ 'form',
+ array(
+ 'method' => 'post',
+ 'action' => $action,
+ 'id' => 'mw-import-interwiki-form'
+ )
+ ) .
+ $this->msg( 'import-interwiki-text' )->parseAsBlock() .
+ Html::hidden( 'action', 'submit' ) .
+ Html::hidden( 'source', 'interwiki' ) .
+ Html::hidden( 'editToken', $user->getEditToken() ) .
+ Xml::openElement( 'table', array( 'id' => 'mw-import-table-interwiki' ) ) .
+ "<tr>
<td class='mw-label'>" .
- Xml::label( $this->msg( 'import-interwiki-source' )->text(), 'interwiki' ) .
+ Xml::label( $this->msg( 'import-interwiki-source' )->text(), 'interwiki' ) .
"</td>
<td class='mw-input'>" .
- Xml::openElement( 'select', array( 'name' => 'interwiki', 'id' => 'interwiki' ) )
+ Xml::openElement(
+ 'select',
+ array( 'name' => 'interwiki', 'id' => 'interwiki' )
+ )
);
- foreach( $wgImportSources as $prefix ) {
+
+ foreach ( $wgImportSources as $prefix ) {
$selected = ( $this->interwiki === $prefix ) ? ' selected="selected"' : '';
$out->addHTML( Xml::option( $prefix, $prefix, $selected ) );
}
$out->addHTML(
- Xml::closeElement( 'select' ) .
- Xml::input( 'frompage', 50, $this->frompage, array( 'id' => 'frompage' ) ) .
+ Xml::closeElement( 'select' ) .
+ Xml::input( 'frompage', 50, $this->frompage, array( 'id' => 'frompage' ) ) .
"</td>
</tr>
<tr>
<td>
</td>
<td class='mw-input'>" .
- Xml::checkLabel( $this->msg( 'import-interwiki-history' )->text(), 'interwikiHistory', 'interwikiHistory', $this->history ) .
+ Xml::checkLabel(
+ $this->msg( 'import-interwiki-history' )->text(),
+ 'interwikiHistory',
+ 'interwikiHistory',
+ $this->history
+ ) .
"</td>
</tr>
<tr>
<td>
</td>
<td class='mw-input'>" .
- Xml::checkLabel( $this->msg( 'import-interwiki-templates' )->text(), 'interwikiTemplates', 'interwikiTemplates', $this->includeTemplates ) .
+ Xml::checkLabel(
+ $this->msg( 'import-interwiki-templates' )->text(),
+ 'interwikiTemplates',
+ 'interwikiTemplates',
+ $this->includeTemplates
+ ) .
"</td>
</tr>
$importDepth
<tr>
<td class='mw-label'>" .
- Xml::label( $this->msg( 'import-interwiki-namespace' )->text(), 'namespace' ) .
+ Xml::label( $this->msg( 'import-interwiki-namespace' )->text(), 'namespace' ) .
"</td>
<td class='mw-input'>" .
- Html::namespaceSelector(
- array(
- 'selected' => $this->namespace,
- 'all' => '',
- ), array(
- 'name' => 'namespace',
- 'id' => 'namespace',
- 'class' => 'namespaceselector',
- )
- ) .
+ Html::namespaceSelector(
+ array(
+ 'selected' => $this->namespace,
+ 'all' => '',
+ ), array(
+ 'name' => 'namespace',
+ 'id' => 'namespace',
+ 'class' => 'namespaceselector',
+ )
+ ) .
"</td>
</tr>
<tr>
<td class='mw-label'>" .
- Xml::label( $this->msg( 'import-comment' )->text(), 'mw-interwiki-comment' ) .
+ Xml::label( $this->msg( 'import-comment' )->text(), 'mw-interwiki-comment' ) .
"</td>
<td class='mw-input'>" .
- Xml::input( 'log-comment', 50, '',
- array( 'id' => 'mw-interwiki-comment', 'type' => 'text' ) ) . ' ' .
+ Xml::input( 'log-comment', 50, '',
+ array( 'id' => 'mw-interwiki-comment', 'type' => 'text' ) ) . ' ' .
"</td>
</tr>
<tr>
<td class='mw-label'>" .
- Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage-interwiki' ) .
+ Xml::label(
+ $this->msg( 'import-interwiki-rootpage' )->text(),
+ 'mw-interwiki-rootpage-interwiki'
+ ) .
"</td>
<td class='mw-input'>" .
- Xml::input( 'rootpage', 50, $this->rootpage,
- array( 'id' => 'mw-interwiki-rootpage-interwiki', 'type' => 'text' ) ) . ' ' .
+ Xml::input( 'rootpage', 50, $this->rootpage,
+ array( 'id' => 'mw-interwiki-rootpage-interwiki', 'type' => 'text' ) ) . ' ' .
"</td>
</tr>
<tr>
<td>
</td>
<td class='mw-submit'>" .
- Xml::submitButton( $this->msg( 'import-interwiki-submit' )->text(), Linker::tooltipAndAccesskeyAttribs( 'import' ) ) .
+ Xml::submitButton(
+ $this->msg( 'import-interwiki-submit' )->text(),
+ Linker::tooltipAndAccesskeyAttribs( 'import' )
+ ) .
"</td>
</tr>" .
- Xml::closeElement( 'table' ) .
- Xml::closeElement( 'form' ) .
- Xml::closeElement( 'fieldset' )
+ Xml::closeElement( 'table' ) .
+ Xml::closeElement( 'form' ) .
+ Xml::closeElement( 'fieldset' )
);
}
}
private $mOriginalPageOutCallback = null;
private $mLogItemCount = 0;
+
+ /**
+ * @param WikiImporter $importer
+ * @param $upload
+ * @param $interwiki
+ * @param string|bool $reason
+ */
function __construct( $importer, $upload, $interwiki, $reason = false ) {
$this->mOriginalPageOutCallback =
- $importer->setPageOutCallback( array( $this, 'reportPage' ) );
+ $importer->setPageOutCallback( array( $this, 'reportPage' ) );
$this->mOriginalLogCallback =
$importer->setLogItemCallback( array( $this, 'reportLogItem' ) );
$importer->setNoticeCallback( array( $this, 'reportNotice' ) );
$this->mPageCount++;
- if( $successCount > 0 ) {
- $this->getOutput()->addHTML( "<li>" . Linker::linkKnown( $title ) . " " .
- $this->msg( 'import-revision-count' )->numParams( $successCount )->escaped() .
- "</li>\n"
+ if ( $successCount > 0 ) {
+ $this->getOutput()->addHTML(
+ "<li>" . Linker::linkKnown( $title ) . " " .
+ $this->msg( 'import-revision-count' )->numParams( $successCount )->escaped() .
+ "</li>\n"
);
$log = new LogPage( 'import' );
- if( $this->mIsUpload ) {
+ if ( $this->mIsUpload ) {
$detail = $this->msg( 'import-logentry-upload-detail' )->numParams(
$successCount )->inContentLanguage()->text();
if ( $this->reason ) {
if ( $this->mLogItemCount > 0 ) {
$msg = $this->msg( 'imported-log-entries' )->numParams( $this->mLogItemCount )->parse();
$out->addHTML( Xml::tags( 'li', null, $msg ) );
- } elseif( $this->mPageCount == 0 && $this->mLogItemCount == 0 ) {
+ } elseif ( $this->mPageCount == 0 && $this->mLogItemCount == 0 ) {
$out->addHTML( "</ul>\n" );
+
return Status::newFatal( 'importnopages' );
}
$out->addHTML( "</ul>\n" );