* Constructor.
*/
function wfSpecialAllmessages() {
- global $wgOut, $wgRequest, $wgMessageCache, $wgTitle;
+ global $wgOut, $wgRequest, $wgMessageCache;
global $wgUseDatabaseMessages, $wgLang;
# The page isn't much use if the MediaWiki namespace is not being used
wfProfileIn( __METHOD__ . '-output' );
$wgOut->addScriptFile( 'allmessages.js' );
+ $title = SpecialPage::getTitleFor( 'Allmessages' );
if ( $ot == 'php' ) {
$navText .= wfAllMessagesMakePhp( $messages );
$wgOut->addHTML( $wgLang->pipeList( array(
'PHP',
- '<a href="' . $wgTitle->escapeLocalUrl( 'ot=html' ) . '">HTML</a>',
- '<a href="' . $wgTitle->escapeLocalUrl( 'ot=xml' ) . '">XML</a>' .
+ '<a href="' . $title->escapeLocalUrl( 'ot=html' ) . '">HTML</a>',
+ '<a href="' . $title->escapeLocalUrl( 'ot=xml' ) . '">XML</a>' .
'<pre>' . htmlspecialchars( $navText ) . '</pre>'
) ) );
} else if ( $ot == 'xml' ) {
echo wfAllMessagesMakeXml( $messages );
} else {
$wgOut->addHTML( $wgLang->pipeList( array(
- '<a href="' . $wgTitle->escapeLocalUrl( 'ot=php' ) . '">PHP</a>',
+ '<a href="' . $title->escapeLocalUrl( 'ot=php' ) . '">PHP</a>',
'HTML',
- '<a href="' . $wgTitle->escapeLocalUrl( 'ot=xml' ) . '">XML</a>'
+ '<a href="' . $title->escapeLocalUrl( 'ot=xml' ) . '">XML</a>'
) ) );
$wgOut->addWikiText( $navText );
$wgOut->addHTML( wfAllMessagesMakeHTMLText( $messages ) );
* @param $this->opts Array: the options to be included.
*/
protected function getForm() {
- global $wgScript, $wgTitle;
+ global $wgScript;
- $this->opts['title'] = $wgTitle->getPrefixedText();
+ $this->opts['title'] = SpecialPage::getTitleFor( 'Contributions' )->getPrefixedText();
if( !isset( $this->opts['target'] ) ) {
$this->opts['target'] = '';
} else {
* @param $options Array: the options to be included.
*/
function getForm( $options ) {
- global $wgScript, $wgTitle, $wgRequest;
+ global $wgScript, $wgRequest;
- $options['title'] = $wgTitle->getPrefixedText();
+ $options['title'] = SpecialPage::getTitleFor( 'DeletedContributions' )->getPrefixedText();
if ( !isset( $options['target'] ) ) {
$options['target'] = '';
} else {
}
function execute() {
- global $wgOut, $wgTitle, $wgScript;
+ global $wgOut, $wgScript;
$wgOut->addHTML(
Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'specialfilepath' ) ) .
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', null, wfMsg( 'filepath' ) ) .
- Xml::hidden( 'title', $wgTitle->getPrefixedText() ) .
+ Xml::hidden( 'title', SpecialPage::getTitleFor( 'Filepath' )->getPrefixedText() ) .
Xml::inputLabel( wfMsg( 'filepath-page' ), 'file', 'file', 25, is_object( $this->mTitle ) ? $this->mTitle->getText() : '' ) . ' ' .
Xml::submitButton( wfMsg( 'filepath-submit' ) ) . "\n" .
Xml::closeElement( 'fieldset' ) .
}
private function showForm() {
- global $wgUser, $wgOut, $wgRequest, $wgTitle, $wgImportSources, $wgExportMaxLinkDepth;
+ global $wgUser, $wgOut, $wgRequest, $wgImportSources, $wgExportMaxLinkDepth;
if( !$wgUser->isAllowed( 'import' ) && !$wgUser->isAllowed( 'importupload' ) )
return $wgOut->permissionRequired( 'import' );
- $action = $wgTitle->getLocalUrl( 'action=submit' );
+ $action = SpecialPage::getTitleFor( 'Import' )->getLocalUrl( 'action=submit' );
if( $wgUser->isAllowed( 'importupload' ) ) {
$wgOut->addWikiMsg( "importtext" );
}
function searchForm() {
- global $wgTitle, $wgScript, $wgRequest, $wgLang;
+ global $wgScript, $wgRequest, $wgLang;
$showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ) );
$nondefaults = array();
return
Xml::tags( 'form', array( 'action' => $wgScript ),
- Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() ) .
+ Xml::hidden( 'title', SpecialPage::getTitleFor( 'Ipblocklist' )->getPrefixedDbKey() ) .
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', null, wfMsg( 'ipblocklist-legend' ) ) .
Xml::inputLabel( wfMsg( 'ipblocklist-username' ), 'ip', 'ip', /* size */ false, $this->ip ) .
class SpecialListUserRestrictionsForm {
public function getHTML() {
- global $wgRequest, $wgScript, $wgTitle;
+ global $wgRequest, $wgScript;
$action = htmlspecialchars( $wgScript );
$s = '';
$s .= Xml::fieldset( wfMsg( 'listuserrestrictions-legend' ) );
$s .= "<form action=\"{$action}\">";
- $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() );
+ $s .= Xml::hidden( 'title', SpecialPage::getTitleFor('ListUserRestrictions')->getPrefixedDbKey() );
$s .= Xml::label( wfMsgHtml( 'listuserrestrictions-type' ), 'type' ) . ' ' .
self::typeSelector( 'type', $wgRequest->getVal( 'type' ), 'type' );
$s .= ' ';
* Output the HTML search form, and constructs the MIMEsearchPage object.
*/
function wfSpecialMIMEsearch( $par = null ) {
- global $wgRequest, $wgTitle, $wgOut;
+ global $wgRequest, $wgOut;
$mime = isset( $par ) ? $par : $wgRequest->getText( 'mime' );
$wgOut->addHTML(
- Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgTitle->getLocalUrl() ) ) .
+ Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => SpecialPage::getTitleFor( 'MIMEsearch' )->getLocalUrl() ) ) .
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', null, wfMsg( 'mimesearch' ) ) .
Xml::inputLabel( wfMsg( 'mimetype' ), 'mime', 'mime', 20, $mime ) . ' ' .
}
function execute() {
- global $wgUser, $wgOut, $wgTitle;
+ global $wgUser, $wgOut;
if ( $wgUser->isAnon() ) {
- $wgOut->showErrorPage( 'prefsnologin', 'prefsnologintext', array($wgTitle->getPrefixedDBkey()) );
+ $wgOut->showErrorPage( 'prefsnologin', 'prefsnologintext',
+ array( SpecialPage::getTitleFor( 'Preferences' )->getPrefixedDBkey() ) );
return;
}
if ( wfReadOnly() ) {
<?php
function wfSpecialRemoveRestrictions() {
- global $wgOut, $wgRequest, $wgUser, $wgLang, $wgTitle;
+ global $wgOut, $wgRequest, $wgUser, $wgLang;
$sk = $wgUser->getSkin();
-
+ $title = SpecialPage::getTitleFor( 'RemoveRestrictions' );
$id = $wgRequest->getVal( 'id' );
if( !is_numeric( $id ) ) {
$wgOut->addWikiMsg( 'removerestrictions-noid' );
if( $result )
$wgOut->addHTML( '<strong class="success">' . wfMsgExt( 'removerestrictions-success',
'parseinline', $r->getSubjectText() ) . '</strong>' );
- $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => $wgTitle->getLocalUrl( array( 'id' => $id ) ),
+ $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => $title->getLocalUrl( array( 'id' => $id ) ),
'method' => 'post' ) ) );
$wgOut->addHTML( Xml::buildForm( $form, 'removerestrictions-submit' ) );
$wgOut->addHTML( Xml::hidden( 'id', $r->getId() ) );
- $wgOut->addHTML( Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() ) );
+ $wgOut->addHTML( Xml::hidden( 'title', $title->getPrefixedDbKey() ) );
$wgOut->addHTML( Xml::hidden( 'edittoken', $wgUser->editToken() ) );
$wgOut->addHTML( "</form></fieldset>" );
}
class RestrictUserForm {
public static function selectUserForm( $val = null, $error = null ) {
- global $wgScript, $wgTitle;
+ global $wgScript;
$action = htmlspecialchars( $wgScript );
$s = Xml::fieldset( wfMsg( 'restrictuser-userselect' ) ) . "<form action=\"{$action}\">";
if( $error )
$s .= '<p>' . $error . '</p>';
- $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() );
+ $s .= Xml::hidden( 'title', SpecialPage::getTitleFor( 'RestrictUser' )->getPrefixedDbKey() );
$form = array( 'restrictuser-user' => Xml::input( 'user', false, $val ) );
$s .= Xml::buildForm( $form, 'restrictuser-go' );
$s .= "</form></fieldset>";
}
public static function pageRestrictionForm( $uid, $user, $oldRestrictions ) {
- global $wgOut, $wgTitle, $wgRequest, $wgUser;
+ global $wgOut, $wgRequest, $wgUser;
$error = '';
$success = false;
if( $wgRequest->wasPosted() && $wgRequest->getVal( 'type' ) == UserRestriction::PAGE &&
self::printSuccessError( $success, $error );
- $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => $wgTitle->getLocalUrl(),
+ $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => SpecialPage::getTitleFor( 'RestrictUser' )->getLocalUrl(),
'method' => 'post' ) ) );
$wgOut->addHTML( Xml::hidden( 'type', UserRestriction::PAGE ) );
$wgOut->addHTML( Xml::hidden( 'edittoken', $wgUser->editToken() ) );
}
public static function namespaceRestrictionForm( $uid, $user, $oldRestrictions ) {
- global $wgOut, $wgTitle, $wgRequest, $wgUser, $wgContLang;
+ global $wgOut, $wgRequest, $wgUser, $wgContLang;
$error = '';
$success = false;
if( $wgRequest->wasPosted() && $wgRequest->getVal( 'type' ) == UserRestriction::NAMESPACE &&
self::printSuccessError( $success, $error );
- $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => $wgTitle->getLocalUrl(),
+ $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => SpecialPage::getTitleFor( 'RestrictUser' )->getLocalUrl(),
'method' => 'post' ) ) );
$wgOut->addHTML( Xml::hidden( 'type', UserRestriction::NAMESPACE ) );
$wgOut->addHTML( Xml::hidden( 'edittoken', $wgUser->editToken() ) );
* @returns string
*/
private function fileLine( $file ) {
- global $wgLang, $wgTitle;
+ global $wgLang;
$target = $this->page->getPrefixedText();
$date = $wgLang->timeanddate( $file->getTimestamp(), true );
if( !$file->userCan(File::DELETED_FILE) ) {
$pageLink = $date;
} else {
- $pageLink = $this->skin->makeKnownLinkObj( $wgTitle, $date,
+ $pageLink = $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Revisiondelete' ), $date,
"target=$target&file=$file->sha1.".$file->getExtension() );
}
$pageLink = '<span class="history-deleted">' . $pageLink . '</span>';
}
function whatlinkshereForm() {
- global $wgScript, $wgTitle;
+ global $wgScript;
// We get nicer value from the title object
$this->opts->consumeValue( 'target' );
$f = Xml::openElement( 'form', array( 'action' => $wgScript ) );
# Values that should not be forgotten
- $f .= Xml::hidden( 'title', $wgTitle->getPrefixedText() );
+ $f .= Xml::hidden( 'title', SpecialPage::getTitleFor( 'Whatlinkshere' )->getPrefixedText() );
foreach ( $this->opts->getUnconsumedValues() as $name => $value ) {
$f .= Xml::hidden( $name, $value );
}