$s.=" | <strong>". str_replace( "$1", $tl, wfMsg("newmessages") ) . "</strong>";
}
}
+ if( $wgUser->isSysop() &&
+ ($n = $wgTitle->isDeleted() ) ) {
+ $s .= " | <strong>" . wfMsg( "thisisdeleted",
+ $this->makeKnownLink(
+ $wgLang->SpecialPage( "Undelete/" . $wgTitle->getText() ),
+ wfMsg( "restorelink", $n ) ) ) . "</strong>";
+ }
return $s;
}
<?
-function wfSpecialUndelete( )
+function wfSpecialUndelete( $par )
{
global $wgLang, $wgUser, $wgOut, $action, $target, $timestamp, $restore;
+ if( $par != "" ) $target = $par;
if( isset($target ) ) {
$t = Title::newFromURL( $target );
$title = $t->mDbkeyform;
function newFromText( $text )
{
+ wfProfileIn( "Title::newFromText" );
+
# Note - mixing latin1 named entities and unicode numbered
# ones will result in a bad link.
$trans = get_html_translation_table( HTML_ENTITIES );
$t = new Title();
$t->mDbkeyform = str_replace( " ", "_", $text );
$t->secureAndSplit();
+
+ wfProfileOut();
return $t;
}
}
return $this->mRestrictions;
}
+
+ function isDeleted() {
+ $ns = $this->getNamespace();
+ $t = wfStrencode( $this->getDBkey() );
+ $sql = "SELECT COUNT(*) AS n FROM archive WHERE ar_namespace=$ns AND ar_title='$t'";
+ if( $res = wfQuery( $sql ) ) {
+ $s = wfFetchObject( $res );
+ return $s->n;
+ }
+ return 0;
+ }
function getArticleID()
{
/* private */ function secureAndSplit()
{
global $wgLang, $wgLocalInterwiki;
-
+ wfProfileIn( "Title::secureAndSplit" );
+
$validNamespaces = $wgLang->getNamespaces();
unset( $validNamespaces[0] );
$this->mDbkeyform = $t;
$this->mUrlform = wfUrlencode( $t );
$this->mTextform = str_replace( "_", " ", $t );
+
+ wfProfileOut();
}
}
?>
"toc" => "Table of contents",
"showtoc" => "show",
"hidetoc" => "hide",
+"thisisdeleted" => "View or restore $1?",
+"restorelink" => "$1 deleted edits",
# Main script and global functions
#